diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/CHANGELOG.md b/sdk/resourcemanager/mediaservices/armmediaservices/CHANGELOG.md index 15e00d3e9c92..91b203de2fe9 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/CHANGELOG.md +++ b/sdk/resourcemanager/mediaservices/armmediaservices/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 3.2.1 (2023-02-07) +### Other Changes + + ## 3.2.0 (2023-01-13) ### Features Added diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/accountfilters_client.go b/sdk/resourcemanager/mediaservices/armmediaservices/accountfilters_client.go index ab6660e24877..6e36e4f1af13 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/accountfilters_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/accountfilters_client.go @@ -32,9 +32,9 @@ type AccountFiltersClient struct { } // NewAccountFiltersClient creates a new instance of AccountFiltersClient with the specified values. -// subscriptionID - The unique identifier for a Microsoft Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The unique identifier for a Microsoft Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAccountFiltersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AccountFiltersClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,13 +57,14 @@ 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 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 -// parameters - The request parameters -// options - AccountFiltersClientCreateOrUpdateOptions contains the optional parameters for the AccountFiltersClient.CreateOrUpdate -// method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - filterName - The Account Filter name +// - parameters - The request parameters +// - options - AccountFiltersClientCreateOrUpdateOptions contains the optional parameters for the AccountFiltersClient.CreateOrUpdate +// method. func (client *AccountFiltersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, filterName string, parameters AccountFilter, options *AccountFiltersClientCreateOrUpdateOptions) (AccountFiltersClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, accountName, filterName, parameters, options) if err != nil { @@ -120,11 +121,12 @@ 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 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 -// options - AccountFiltersClientDeleteOptions contains the optional parameters for the AccountFiltersClient.Delete method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - filterName - The Account Filter name +// - options - AccountFiltersClientDeleteOptions contains the optional parameters for the AccountFiltersClient.Delete method. func (client *AccountFiltersClient) Delete(ctx context.Context, resourceGroupName string, accountName string, filterName string, options *AccountFiltersClientDeleteOptions) (AccountFiltersClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, filterName, options) if err != nil { @@ -172,11 +174,12 @@ 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 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 -// options - AccountFiltersClientGetOptions contains the optional parameters for the AccountFiltersClient.Get method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - filterName - The Account Filter name +// - options - AccountFiltersClientGetOptions contains the optional parameters for the AccountFiltersClient.Get method. func (client *AccountFiltersClient) Get(ctx context.Context, resourceGroupName string, accountName string, filterName string, options *AccountFiltersClientGetOptions) (AccountFiltersClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, filterName, options) if err != nil { @@ -232,10 +235,11 @@ func (client *AccountFiltersClient) getHandleResponse(resp *http.Response) (Acco } // NewListPager - List Account Filters in the Media Services account. +// // 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. +// - 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.NewListPager method. func (client *AccountFiltersClient) NewListPager(resourceGroupName string, accountName string, options *AccountFiltersClientListOptions) *runtime.Pager[AccountFiltersClientListResponse] { return runtime.NewPager(runtime.PagingHandler[AccountFiltersClientListResponse]{ More: func(page AccountFiltersClientListResponse) bool { @@ -301,12 +305,13 @@ 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 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 -// parameters - The request parameters -// options - AccountFiltersClientUpdateOptions contains the optional parameters for the AccountFiltersClient.Update method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - filterName - The Account Filter name +// - parameters - The request parameters +// - options - AccountFiltersClientUpdateOptions contains the optional parameters for the AccountFiltersClient.Update method. func (client *AccountFiltersClient) Update(ctx context.Context, resourceGroupName string, accountName string, filterName string, parameters AccountFilter, options *AccountFiltersClientUpdateOptions) (AccountFiltersClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, filterName, parameters, options) if err != nil { 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 6fa9661de8eb..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/accountfilters_client_example_test.go +++ /dev/null @@ -1,176 +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/Metadata/stable/2022-08-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/Metadata/stable/2022-08-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/Metadata/stable/2022-08-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/Metadata/stable/2022-08-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/Metadata/stable/2022-08-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 9976359f527b..8883805c89db 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/assetfilters_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/assetfilters_client.go @@ -32,9 +32,9 @@ type AssetFiltersClient struct { } // NewAssetFiltersClient creates a new instance of AssetFiltersClient with the specified values. -// subscriptionID - The unique identifier for a Microsoft Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The unique identifier for a Microsoft Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAssetFiltersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AssetFiltersClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,14 +57,15 @@ 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 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// assetName - The Asset name. -// filterName - The Asset Filter name -// parameters - The request parameters -// options - AssetFiltersClientCreateOrUpdateOptions contains the optional parameters for the AssetFiltersClient.CreateOrUpdate -// method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - assetName - The Asset name. +// - filterName - The Asset Filter name +// - parameters - The request parameters +// - options - AssetFiltersClientCreateOrUpdateOptions contains the optional parameters for the AssetFiltersClient.CreateOrUpdate +// method. func (client *AssetFiltersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, assetName string, filterName string, parameters AssetFilter, options *AssetFiltersClientCreateOrUpdateOptions) (AssetFiltersClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, accountName, assetName, filterName, parameters, options) if err != nil { @@ -125,12 +126,13 @@ 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 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// assetName - The Asset name. -// filterName - The Asset Filter name -// options - AssetFiltersClientDeleteOptions contains the optional parameters for the AssetFiltersClient.Delete method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - assetName - The Asset name. +// - filterName - The Asset Filter name +// - options - AssetFiltersClientDeleteOptions contains the optional parameters for the AssetFiltersClient.Delete method. func (client *AssetFiltersClient) Delete(ctx context.Context, resourceGroupName string, accountName string, assetName string, filterName string, options *AssetFiltersClientDeleteOptions) (AssetFiltersClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, assetName, filterName, options) if err != nil { @@ -182,12 +184,13 @@ 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 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// assetName - The Asset name. -// filterName - The Asset Filter name -// options - AssetFiltersClientGetOptions contains the optional parameters for the AssetFiltersClient.Get method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - assetName - The Asset name. +// - filterName - The Asset Filter name +// - options - AssetFiltersClientGetOptions contains the optional parameters for the AssetFiltersClient.Get method. func (client *AssetFiltersClient) Get(ctx context.Context, resourceGroupName string, accountName string, assetName string, filterName string, options *AssetFiltersClientGetOptions) (AssetFiltersClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, assetName, filterName, options) if err != nil { @@ -247,11 +250,12 @@ func (client *AssetFiltersClient) getHandleResponse(resp *http.Response) (AssetF } // NewListPager - List Asset Filters associated with the specified Asset. +// // 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. -// options - AssetFiltersClientListOptions contains the optional parameters for the AssetFiltersClient.List method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - assetName - The Asset name. +// - options - AssetFiltersClientListOptions contains the optional parameters for the AssetFiltersClient.NewListPager method. func (client *AssetFiltersClient) NewListPager(resourceGroupName string, accountName string, assetName string, options *AssetFiltersClientListOptions) *runtime.Pager[AssetFiltersClientListResponse] { return runtime.NewPager(runtime.PagingHandler[AssetFiltersClientListResponse]{ More: func(page AssetFiltersClientListResponse) bool { @@ -321,13 +325,14 @@ 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 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// assetName - The Asset name. -// filterName - The Asset Filter name -// parameters - The request parameters -// options - AssetFiltersClientUpdateOptions contains the optional parameters for the AssetFiltersClient.Update method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - assetName - The Asset name. +// - filterName - The Asset Filter name +// - parameters - The request parameters +// - options - AssetFiltersClientUpdateOptions contains the optional parameters for the AssetFiltersClient.Update method. func (client *AssetFiltersClient) Update(ctx context.Context, resourceGroupName string, accountName string, assetName string, filterName string, parameters AssetFilter, options *AssetFiltersClientUpdateOptions) (AssetFiltersClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, assetName, filterName, parameters, options) if err != nil { 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 6112557c9a56..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/assetfilters_client_example_test.go +++ /dev/null @@ -1,176 +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/Metadata/stable/2022-08-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/Metadata/stable/2022-08-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/Metadata/stable/2022-08-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/Metadata/stable/2022-08-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/Metadata/stable/2022-08-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 2bbc116ffe11..85c135288ac7 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/assets_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/assets_client.go @@ -33,9 +33,9 @@ type AssetsClient struct { } // NewAssetsClient creates a new instance of AssetsClient with the specified values. -// subscriptionID - The unique identifier for a Microsoft Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The unique identifier for a Microsoft Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAssetsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AssetsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,12 +58,13 @@ 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 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// assetName - The Asset name. -// parameters - The request parameters -// options - AssetsClientCreateOrUpdateOptions contains the optional parameters for the AssetsClient.CreateOrUpdate method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - assetName - The Asset name. +// - parameters - The request parameters +// - options - AssetsClientCreateOrUpdateOptions contains the optional parameters for the AssetsClient.CreateOrUpdate method. func (client *AssetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, assetName string, parameters Asset, options *AssetsClientCreateOrUpdateOptions) (AssetsClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, accountName, assetName, parameters, options) if err != nil { @@ -120,11 +121,12 @@ 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 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// assetName - The Asset name. -// options - AssetsClientDeleteOptions contains the optional parameters for the AssetsClient.Delete method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - assetName - The Asset name. +// - options - AssetsClientDeleteOptions contains the optional parameters for the AssetsClient.Delete method. func (client *AssetsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, assetName string, options *AssetsClientDeleteOptions) (AssetsClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, assetName, options) if err != nil { @@ -172,11 +174,12 @@ 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 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// assetName - The Asset name. -// options - AssetsClientGetOptions contains the optional parameters for the AssetsClient.Get method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - assetName - The Asset name. +// - options - AssetsClientGetOptions contains the optional parameters for the AssetsClient.Get method. func (client *AssetsClient) Get(ctx context.Context, resourceGroupName string, accountName string, assetName string, options *AssetsClientGetOptions) (AssetsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, assetName, options) if err != nil { @@ -234,11 +237,12 @@ 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 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// assetName - The Asset name. -// options - AssetsClientGetEncryptionKeyOptions contains the optional parameters for the AssetsClient.GetEncryptionKey method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - assetName - The Asset name. +// - options - AssetsClientGetEncryptionKeyOptions contains the optional parameters for the AssetsClient.GetEncryptionKey method. func (client *AssetsClient) GetEncryptionKey(ctx context.Context, resourceGroupName string, accountName string, assetName string, options *AssetsClientGetEncryptionKeyOptions) (AssetsClientGetEncryptionKeyResponse, error) { req, err := client.getEncryptionKeyCreateRequest(ctx, resourceGroupName, accountName, assetName, options) if err != nil { @@ -294,10 +298,11 @@ func (client *AssetsClient) getEncryptionKeyHandleResponse(resp *http.Response) } // NewListPager - List Assets in the Media Services account with optional filtering and ordering +// // 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. +// - 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.NewListPager method. func (client *AssetsClient) NewListPager(resourceGroupName string, accountName string, options *AssetsClientListOptions) *runtime.Pager[AssetsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[AssetsClientListResponse]{ More: func(page AssetsClientListResponse) bool { @@ -373,12 +378,13 @@ 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 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// assetName - The Asset name. -// parameters - The request parameters -// options - AssetsClientListContainerSasOptions contains the optional parameters for the AssetsClient.ListContainerSas method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - assetName - The Asset name. +// - parameters - The request parameters +// - options - AssetsClientListContainerSasOptions contains the optional parameters for the AssetsClient.ListContainerSas method. func (client *AssetsClient) ListContainerSas(ctx context.Context, resourceGroupName string, accountName string, assetName string, parameters ListContainerSasInput, options *AssetsClientListContainerSasOptions) (AssetsClientListContainerSasResponse, error) { req, err := client.listContainerSasCreateRequest(ctx, resourceGroupName, accountName, assetName, parameters, options) if err != nil { @@ -435,12 +441,13 @@ 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 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// assetName - The Asset name. -// options - AssetsClientListStreamingLocatorsOptions contains the optional parameters for the AssetsClient.ListStreamingLocators -// method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - assetName - The Asset name. +// - options - AssetsClientListStreamingLocatorsOptions contains the optional parameters for the AssetsClient.ListStreamingLocators +// method. func (client *AssetsClient) ListStreamingLocators(ctx context.Context, resourceGroupName string, accountName string, assetName string, options *AssetsClientListStreamingLocatorsOptions) (AssetsClientListStreamingLocatorsResponse, error) { req, err := client.listStreamingLocatorsCreateRequest(ctx, resourceGroupName, accountName, assetName, options) if err != nil { @@ -497,12 +504,13 @@ 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 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// assetName - The Asset name. -// parameters - The request parameters -// options - AssetsClientUpdateOptions contains the optional parameters for the AssetsClient.Update method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - assetName - The Asset name. +// - parameters - The request parameters +// - options - AssetsClientUpdateOptions contains the optional parameters for the AssetsClient.Update method. func (client *AssetsClient) Update(ctx context.Context, resourceGroupName string, accountName string, assetName string, parameters Asset, options *AssetsClientUpdateOptions) (AssetsClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, assetName, parameters, options) if err != nil { 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 d0292b1ff69f..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/assets_client_example_test.go +++ /dev/null @@ -1,244 +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/Metadata/stable/2022-08-01/examples/assets-list-in-date-range.json -func ExampleAssetsClient_NewListPager_listAssetCreatedInADateRange() { - 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/Metadata/stable/2022-08-01/examples/assets-list-by-date.json -func ExampleAssetsClient_NewListPager_listAssetOrderedByDate() { - 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: nil, - 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/Metadata/stable/2022-08-01/examples/assets-list-all.json -func ExampleAssetsClient_NewListPager_listAllAssets() { - 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: 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/Metadata/stable/2022-08-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/Metadata/stable/2022-08-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/Metadata/stable/2022-08-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/Metadata/stable/2022-08-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/Metadata/stable/2022-08-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/Metadata/stable/2022-08-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/Metadata/stable/2022-08-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 5112c1fc2a74..783f9bdcc3e9 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/assettrackoperationresults_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/assettrackoperationresults_client.go @@ -33,9 +33,9 @@ type AssetTrackOperationResultsClient struct { } // NewAssetTrackOperationResultsClient creates a new instance of AssetTrackOperationResultsClient with the specified values. -// subscriptionID - The unique identifier for a Microsoft Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The unique identifier for a Microsoft Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAssetTrackOperationResultsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AssetTrackOperationResultsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,14 +58,15 @@ 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 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// assetName - The Asset name. -// trackName - The Asset Track name. -// operationID - Operation Id. -// options - AssetTrackOperationResultsClientGetOptions contains the optional parameters for the AssetTrackOperationResultsClient.Get -// method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - assetName - The Asset name. +// - trackName - The Asset Track name. +// - operationID - Operation Id. +// - options - AssetTrackOperationResultsClientGetOptions contains the optional parameters for the AssetTrackOperationResultsClient.Get +// method. func (client *AssetTrackOperationResultsClient) Get(ctx context.Context, resourceGroupName string, accountName string, assetName string, trackName string, operationID string, options *AssetTrackOperationResultsClientGetOptions) (AssetTrackOperationResultsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, assetName, trackName, operationID, options) if err != 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 cf9e72c8eb3a..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/assettrackoperationresults_client_example_test.go +++ /dev/null @@ -1,36 +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/Metadata/stable/2022-08-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 b0b154abc42e..1c0f076cebac 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/assettrackoperationstatuses_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/assettrackoperationstatuses_client.go @@ -32,9 +32,9 @@ type AssetTrackOperationStatusesClient struct { } // NewAssetTrackOperationStatusesClient creates a new instance of AssetTrackOperationStatusesClient with the specified values. -// subscriptionID - The unique identifier for a Microsoft Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The unique identifier for a Microsoft Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAssetTrackOperationStatusesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AssetTrackOperationStatusesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,14 +57,15 @@ 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 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// assetName - The Asset name. -// trackName - The Asset Track name. -// operationID - Operation Id. -// options - AssetTrackOperationStatusesClientGetOptions contains the optional parameters for the AssetTrackOperationStatusesClient.Get -// method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - assetName - The Asset name. +// - trackName - The Asset Track name. +// - operationID - Operation Id. +// - options - AssetTrackOperationStatusesClientGetOptions contains the optional parameters for the AssetTrackOperationStatusesClient.Get +// method. func (client *AssetTrackOperationStatusesClient) Get(ctx context.Context, resourceGroupName string, accountName string, assetName string, trackName string, operationID string, options *AssetTrackOperationStatusesClientGetOptions) (AssetTrackOperationStatusesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, assetName, trackName, operationID, options) if err != 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 41137f0c8e50..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/assettrackoperationstatuses_client_example_test.go +++ /dev/null @@ -1,74 +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/Metadata/stable/2022-08-01/examples/asset-tracks-operation-status-by-id-terminal-state-failed.json -func ExampleAssetTrackOperationStatusesClient_Get_getStatusOfAsynchronousOperationWhenItIsCompletedWithError() { - 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 -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-operation-status-by-id-terminal-state.json -func ExampleAssetTrackOperationStatusesClient_Get_getStatusOfAsynchronousOperationWhenItIsCompleted() { - 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", "e78f8d40-7aaa-4f2f-8ae6-73987e7c5a08", 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/Metadata/stable/2022-08-01/examples/asset-tracks-operation-status-by-id-non-terminal-state.json -func ExampleAssetTrackOperationStatusesClient_Get_getStatusOfAsynchronousOperationWhenItIsOngoing() { - 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", "5827d9a1-1fb4-4e54-ac40-8eeed9b862c8", 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 9b1a90e57325..7a73d74ca837 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/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/mediaservices/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/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.2.0 +module-version: 3.2.1 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/client.go b/sdk/resourcemanager/mediaservices/armmediaservices/client.go index 670ef5004345..564dc9349547 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/client.go @@ -32,9 +32,9 @@ type Client struct { } // NewClient creates a new instance of Client with the specified values. -// subscriptionID - The unique identifier for a Microsoft Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The unique identifier for a Microsoft Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*Client, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,11 +57,12 @@ func NewClient(subscriptionID string, credential azcore.TokenCredential, options // BeginCreateOrUpdate - Creates or updates a Media Services account // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-11-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// parameters - The request parameters -// options - ClientBeginCreateOrUpdateOptions contains the optional parameters for the Client.BeginCreateOrUpdate method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - parameters - The request parameters +// - options - ClientBeginCreateOrUpdateOptions contains the optional parameters for the Client.BeginCreateOrUpdate method. func (client *Client) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, parameters MediaService, options *ClientBeginCreateOrUpdateOptions) (*runtime.Poller[ClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, accountName, parameters, options) @@ -76,6 +77,7 @@ func (client *Client) BeginCreateOrUpdate(ctx context.Context, resourceGroupName // CreateOrUpdate - Creates or updates a Media Services account // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-11-01 func (client *Client) createOrUpdate(ctx context.Context, resourceGroupName string, accountName string, parameters MediaService, options *ClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, accountName, parameters, options) @@ -120,10 +122,11 @@ func (client *Client) createOrUpdateCreateRequest(ctx context.Context, resourceG // Delete - Deletes a Media Services account // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-11-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// options - ClientDeleteOptions contains the optional parameters for the Client.Delete method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - options - ClientDeleteOptions contains the optional parameters for the Client.Delete method. func (client *Client) Delete(ctx context.Context, resourceGroupName string, accountName string, options *ClientDeleteOptions) (ClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, options) if err != nil { @@ -167,10 +170,11 @@ func (client *Client) deleteCreateRequest(ctx context.Context, resourceGroupName // Get - Get the details of a Media Services account // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-11-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// options - ClientGetOptions contains the optional parameters for the Client.Get method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - options - ClientGetOptions contains the optional parameters for the Client.Get method. func (client *Client) Get(ctx context.Context, resourceGroupName string, accountName string, options *ClientGetOptions) (ClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, options) if err != nil { @@ -222,9 +226,10 @@ func (client *Client) getHandleResponse(resp *http.Response) (ClientGetResponse, } // NewListPager - List Media Services accounts in the resource group +// // Generated from API version 2021-11-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// options - ClientListOptions contains the optional parameters for the Client.List method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - options - ClientListOptions contains the optional parameters for the Client.NewListPager method. func (client *Client) NewListPager(resourceGroupName string, options *ClientListOptions) *runtime.Pager[ClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ClientListResponse]{ More: func(page ClientListResponse) bool { @@ -285,8 +290,9 @@ func (client *Client) listHandleResponse(resp *http.Response) (ClientListRespons } // NewListBySubscriptionPager - List Media Services accounts in the subscription. +// // Generated from API version 2021-11-01 -// options - ClientListBySubscriptionOptions contains the optional parameters for the Client.ListBySubscription method. +// - options - ClientListBySubscriptionOptions contains the optional parameters for the Client.NewListBySubscriptionPager method. func (client *Client) NewListBySubscriptionPager(options *ClientListBySubscriptionOptions) *runtime.Pager[ClientListBySubscriptionResponse] { return runtime.NewPager(runtime.PagingHandler[ClientListBySubscriptionResponse]{ More: func(page ClientListBySubscriptionResponse) bool { @@ -344,11 +350,12 @@ func (client *Client) listBySubscriptionHandleResponse(resp *http.Response) (Cli // ListEdgePolicies - List all the media edge policies associated with the Media Services account. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-11-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// parameters - The request parameters -// options - ClientListEdgePoliciesOptions contains the optional parameters for the Client.ListEdgePolicies method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - parameters - The request parameters +// - options - ClientListEdgePoliciesOptions contains the optional parameters for the Client.ListEdgePolicies method. func (client *Client) ListEdgePolicies(ctx context.Context, resourceGroupName string, accountName string, parameters ListEdgePoliciesInput, options *ClientListEdgePoliciesOptions) (ClientListEdgePoliciesResponse, error) { req, err := client.listEdgePoliciesCreateRequest(ctx, resourceGroupName, accountName, parameters, options) if err != nil { @@ -401,11 +408,12 @@ func (client *Client) listEdgePoliciesHandleResponse(resp *http.Response) (Clien // SyncStorageKeys - Synchronizes storage account keys for a storage account associated with the Media Service account. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-11-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// parameters - The request parameters -// options - ClientSyncStorageKeysOptions contains the optional parameters for the Client.SyncStorageKeys method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - parameters - The request parameters +// - options - ClientSyncStorageKeysOptions contains the optional parameters for the Client.SyncStorageKeys method. func (client *Client) SyncStorageKeys(ctx context.Context, resourceGroupName string, accountName string, parameters SyncStorageKeysInput, options *ClientSyncStorageKeysOptions) (ClientSyncStorageKeysResponse, error) { req, err := client.syncStorageKeysCreateRequest(ctx, resourceGroupName, accountName, parameters, options) if err != nil { @@ -449,11 +457,12 @@ func (client *Client) syncStorageKeysCreateRequest(ctx context.Context, resource // BeginUpdate - Updates an existing Media Services account // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-11-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// parameters - The request parameters -// options - ClientBeginUpdateOptions contains the optional parameters for the Client.BeginUpdate method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - parameters - The request parameters +// - options - ClientBeginUpdateOptions contains the optional parameters for the Client.BeginUpdate method. func (client *Client) BeginUpdate(ctx context.Context, resourceGroupName string, accountName string, parameters MediaServiceUpdate, options *ClientBeginUpdateOptions) (*runtime.Poller[ClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, accountName, parameters, options) @@ -468,6 +477,7 @@ func (client *Client) BeginUpdate(ctx context.Context, resourceGroupName string, // Update - Updates an existing Media Services account // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-11-01 func (client *Client) update(ctx context.Context, resourceGroupName string, accountName string, parameters MediaServiceUpdate, options *ClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, parameters, options) diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/client_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/client_example_test.go deleted file mode 100644 index eaedef2ccdfb..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/client_example_test.go +++ /dev/null @@ -1,228 +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/Accounts/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/Accounts/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/Accounts/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/Accounts/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/Accounts/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/Accounts/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/Accounts/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/Accounts/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/constants.go b/sdk/resourcemanager/mediaservices/armmediaservices/constants.go index d06c95274a6a..0f1b6c227586 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.2.0" + moduleVersion = "v3.2.1" ) // AacAudioProfile - The encoding profile to be used when encoding audio with AAC. diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/contentkeypolicies_client.go b/sdk/resourcemanager/mediaservices/armmediaservices/contentkeypolicies_client.go index 397d5ff782a9..67c324707f50 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/contentkeypolicies_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/contentkeypolicies_client.go @@ -33,9 +33,9 @@ type ContentKeyPoliciesClient struct { } // NewContentKeyPoliciesClient creates a new instance of ContentKeyPoliciesClient with the specified values. -// subscriptionID - The unique identifier for a Microsoft Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The unique identifier for a Microsoft Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewContentKeyPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ContentKeyPoliciesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,13 +58,14 @@ 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 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. -// parameters - The request parameters -// options - ContentKeyPoliciesClientCreateOrUpdateOptions contains the optional parameters for the ContentKeyPoliciesClient.CreateOrUpdate -// method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - contentKeyPolicyName - The Content Key Policy name. +// - parameters - The request parameters +// - options - ContentKeyPoliciesClientCreateOrUpdateOptions contains the optional parameters for the ContentKeyPoliciesClient.CreateOrUpdate +// method. func (client *ContentKeyPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, contentKeyPolicyName string, parameters ContentKeyPolicy, options *ContentKeyPoliciesClientCreateOrUpdateOptions) (ContentKeyPoliciesClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, accountName, contentKeyPolicyName, parameters, options) if err != nil { @@ -121,12 +122,13 @@ 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 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. -// options - ContentKeyPoliciesClientDeleteOptions contains the optional parameters for the ContentKeyPoliciesClient.Delete -// method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - contentKeyPolicyName - The Content Key Policy name. +// - options - ContentKeyPoliciesClientDeleteOptions contains the optional parameters for the ContentKeyPoliciesClient.Delete +// method. func (client *ContentKeyPoliciesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, contentKeyPolicyName string, options *ContentKeyPoliciesClientDeleteOptions) (ContentKeyPoliciesClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, contentKeyPolicyName, options) if err != nil { @@ -174,11 +176,12 @@ 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 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. -// options - ContentKeyPoliciesClientGetOptions contains the optional parameters for the ContentKeyPoliciesClient.Get method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - contentKeyPolicyName - The Content Key Policy name. +// - options - ContentKeyPoliciesClientGetOptions contains the optional parameters for the ContentKeyPoliciesClient.Get method. func (client *ContentKeyPoliciesClient) Get(ctx context.Context, resourceGroupName string, accountName string, contentKeyPolicyName string, options *ContentKeyPoliciesClientGetOptions) (ContentKeyPoliciesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, contentKeyPolicyName, options) if err != nil { @@ -235,12 +238,13 @@ 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 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. -// options - ContentKeyPoliciesClientGetPolicyPropertiesWithSecretsOptions contains the optional parameters for the ContentKeyPoliciesClient.GetPolicyPropertiesWithSecrets -// method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - contentKeyPolicyName - The Content Key Policy name. +// - options - ContentKeyPoliciesClientGetPolicyPropertiesWithSecretsOptions contains the optional parameters for the ContentKeyPoliciesClient.GetPolicyPropertiesWithSecrets +// method. func (client *ContentKeyPoliciesClient) GetPolicyPropertiesWithSecrets(ctx context.Context, resourceGroupName string, accountName string, contentKeyPolicyName string, options *ContentKeyPoliciesClientGetPolicyPropertiesWithSecretsOptions) (ContentKeyPoliciesClientGetPolicyPropertiesWithSecretsResponse, error) { req, err := client.getPolicyPropertiesWithSecretsCreateRequest(ctx, resourceGroupName, accountName, contentKeyPolicyName, options) if err != nil { @@ -296,10 +300,12 @@ func (client *ContentKeyPoliciesClient) getPolicyPropertiesWithSecretsHandleResp } // NewListPager - Lists the Content Key Policies in the account +// // 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. +// - 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.NewListPager +// method. func (client *ContentKeyPoliciesClient) NewListPager(resourceGroupName string, accountName string, options *ContentKeyPoliciesClientListOptions) *runtime.Pager[ContentKeyPoliciesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ContentKeyPoliciesClientListResponse]{ More: func(page ContentKeyPoliciesClientListResponse) bool { @@ -374,13 +380,14 @@ 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 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. -// parameters - The request parameters -// options - ContentKeyPoliciesClientUpdateOptions contains the optional parameters for the ContentKeyPoliciesClient.Update -// method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - contentKeyPolicyName - The Content Key Policy name. +// - parameters - The request parameters +// - options - ContentKeyPoliciesClientUpdateOptions contains the optional parameters for the ContentKeyPoliciesClient.Update +// method. func (client *ContentKeyPoliciesClient) Update(ctx context.Context, resourceGroupName string, accountName string, contentKeyPolicyName string, parameters ContentKeyPolicy, options *ContentKeyPoliciesClientUpdateOptions) (ContentKeyPoliciesClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, contentKeyPolicyName, parameters, options) if err != nil { 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 cf50db3b8cf7..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/contentkeypolicies_client_example_test.go +++ /dev/null @@ -1,377 +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/Metadata/stable/2022-08-01/examples/content-key-policies-list-by-lastModified.json -func ExampleContentKeyPoliciesClient_NewListPager_listsContentKeyPoliciesOrderedByLastModified() { - 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/Metadata/stable/2022-08-01/examples/content-key-policies-list-in-date-range.json -func ExampleContentKeyPoliciesClient_NewListPager_listsContentKeyPoliciesWithCreatedAndLastModifiedFilters() { - 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: to.Ptr("properties/lastModified gt 2016-06-01 and properties/created lt 2013-07-01"), - 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/Metadata/stable/2022-08-01/examples/content-key-policies-list-all.json -func ExampleContentKeyPoliciesClient_NewListPager_listsAllContentKeyPolicies() { - 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: 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/Metadata/stable/2022-08-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/Metadata/stable/2022-08-01/examples/content-key-policies-create-nodrm-token.json -func ExampleContentKeyPoliciesClient_CreateOrUpdate_createsAContentKeyPolicyWithClearKeyOptionAndTokenRestriction() { - 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/Metadata/stable/2022-08-01/examples/content-key-policies-create-playready-open.json -func ExampleContentKeyPoliciesClient_CreateOrUpdate_createsAContentKeyPolicyWithPlayReadyOptionAndOpenRestriction() { - 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", "PolicyWithPlayReadyOptionAndOpenRestriction", armmediaservices.ContentKeyPolicy{ - Properties: &armmediaservices.ContentKeyPolicyProperties{ - Description: to.Ptr("ArmPolicyDescription"), - Options: []*armmediaservices.ContentKeyPolicyOption{ - { - Name: to.Ptr("ArmPolicyOptionName"), - Configuration: &armmediaservices.ContentKeyPolicyPlayReadyConfiguration{ - ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicyPlayReadyConfiguration"), - Licenses: []*armmediaservices.ContentKeyPolicyPlayReadyLicense{ - { - AllowTestDevices: to.Ptr(true), - BeginDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-10-16T18:22:53.46Z"); return t }()), - ContentKeyLocation: &armmediaservices.ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader{ - ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader"), - }, - ContentType: to.Ptr(armmediaservices.ContentKeyPolicyPlayReadyContentTypeUltraVioletDownload), - LicenseType: to.Ptr(armmediaservices.ContentKeyPolicyPlayReadyLicenseTypePersistent), - PlayRight: &armmediaservices.ContentKeyPolicyPlayReadyPlayRight{ - AllowPassingVideoContentToUnknownOutput: to.Ptr(armmediaservices.ContentKeyPolicyPlayReadyUnknownOutputPassingOptionNotAllowed), - DigitalVideoOnlyContentRestriction: to.Ptr(false), - ImageConstraintForAnalogComponentVideoRestriction: to.Ptr(true), - ImageConstraintForAnalogComputerMonitorRestriction: to.Ptr(false), - ScmsRestriction: to.Ptr[int32](2), - }, - SecurityLevel: to.Ptr(armmediaservices.SecurityLevelSL150), - }}, - }, - 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/Metadata/stable/2022-08-01/examples/content-key-policies-create-widevine-token.json -func ExampleContentKeyPoliciesClient_CreateOrUpdate_createsAContentKeyPolicyWithWidevineOptionAndTokenRestriction() { - 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", "PolicyWithWidevineOptionAndJwtTokenRestriction", armmediaservices.ContentKeyPolicy{ - Properties: &armmediaservices.ContentKeyPolicyProperties{ - Description: to.Ptr("ArmPolicyDescription"), - Options: []*armmediaservices.ContentKeyPolicyOption{ - { - Name: to.Ptr("widevineoption"), - Configuration: &armmediaservices.ContentKeyPolicyWidevineConfiguration{ - ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicyWidevineConfiguration"), - WidevineTemplate: to.Ptr("{\"allowed_track_types\":\"SD_HD\",\"content_key_specs\":[{\"track_type\":\"SD\",\"security_level\":1,\"required_output_protection\":{\"hdcp\":\"HDCP_V2\"}}],\"policy_overrides\":{\"can_play\":true,\"can_persist\":true,\"can_renew\":false}}"), - }, - Restriction: &armmediaservices.ContentKeyPolicyTokenRestriction{ - ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicyTokenRestriction"), - AlternateVerificationKeys: []armmediaservices.ContentKeyPolicyRestrictionTokenKeyClassification{ - &armmediaservices.ContentKeyPolicySymmetricTokenKey{ - ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicySymmetricTokenKey"), - KeyValue: []byte("AAAAAAAAAAAAAAAAAAAAAA=="), - }}, - Audience: to.Ptr("urn:audience"), - Issuer: to.Ptr("urn:issuer"), - PrimaryVerificationKey: &armmediaservices.ContentKeyPolicyRsaTokenKey{ - ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicyRsaTokenKey"), - Exponent: []byte("AQAB"), - Modulus: []byte("AQAD"), - }, - RestrictionTokenType: to.Ptr(armmediaservices.ContentKeyPolicyRestrictionTokenTypeJwt), - }, - }}, - }, - }, 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/Metadata/stable/2022-08-01/examples/content-key-policies-create-multiple-options.json -func ExampleContentKeyPoliciesClient_CreateOrUpdate_createsAContentKeyPolicyWithMultipleOptions() { - 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", "PolicyCreatedWithMultipleOptions", 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), - }, - }, - { - Name: to.Ptr("widevineoption"), - Configuration: &armmediaservices.ContentKeyPolicyWidevineConfiguration{ - ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicyWidevineConfiguration"), - WidevineTemplate: to.Ptr("{\"allowed_track_types\":\"SD_HD\",\"content_key_specs\":[{\"track_type\":\"SD\",\"security_level\":1,\"required_output_protection\":{\"hdcp\":\"HDCP_V2\"}}],\"policy_overrides\":{\"can_play\":true,\"can_persist\":true,\"can_renew\":false}}"), - }, - 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/Metadata/stable/2022-08-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/Metadata/stable/2022-08-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/Metadata/stable/2022-08-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 7782fef3f2a2..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.2.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.7.0 // indirect - github.com/golang-jwt/jwt/v4 v4.4.2 // 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 8c0539b73123..3afb578030a5 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/go.sum +++ b/sdk/resourcemanager/mediaservices/armmediaservices/go.sum @@ -1,30 +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.2.0 h1:t/W5MYAuQy81cvM8VUNfRLzhtKpXhVUAN7Cd7KVbTyc= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0/go.mod h1:NBanQUfSWiWn3QEpWDTCU0IjBECKOYvl2R8xdRtMtiM= 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.7.0 h1:VgSJlZH5u0k2qxSpqyghcFQKmvYckj46uymKK5XzkBM= -github.com/AzureAD/microsoft-authentication-library-for-go v0.7.0/go.mod h1:BDJ5qMFKx9DugEg3+uQSDCdbYPr5s9vBTrL9P8TpqOU= 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/v4 v4.4.2 h1:rcc4lwaZgFMCZ5jxF9ABolDcIHdBytAFgqFPbSJQAYs= -github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -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/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-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.go b/sdk/resourcemanager/mediaservices/armmediaservices/jobs_client.go index 012811c8199f..bbbb22eca391 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/jobs_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/jobs_client.go @@ -32,9 +32,9 @@ type JobsClient struct { } // NewJobsClient creates a new instance of JobsClient with the specified values. -// subscriptionID - The unique identifier for a Microsoft Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The unique identifier for a Microsoft Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewJobsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*JobsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,12 +57,13 @@ func NewJobsClient(subscriptionID string, credential azcore.TokenCredential, opt // CancelJob - Cancel a Job. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-07-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// transformName - The Transform name. -// jobName - The Job name. -// options - JobsClientCancelJobOptions contains the optional parameters for the JobsClient.CancelJob method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - transformName - The Transform name. +// - jobName - The Job name. +// - options - JobsClientCancelJobOptions contains the optional parameters for the JobsClient.CancelJob method. func (client *JobsClient) CancelJob(ctx context.Context, resourceGroupName string, accountName string, transformName string, jobName string, options *JobsClientCancelJobOptions) (JobsClientCancelJobResponse, error) { req, err := client.cancelJobCreateRequest(ctx, resourceGroupName, accountName, transformName, jobName, options) if err != nil { @@ -114,13 +115,14 @@ func (client *JobsClient) cancelJobCreateRequest(ctx context.Context, resourceGr // Create - Creates a Job. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-07-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// transformName - The Transform name. -// jobName - The Job name. -// parameters - The request parameters -// options - JobsClientCreateOptions contains the optional parameters for the JobsClient.Create method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - transformName - The Transform name. +// - jobName - The Job name. +// - parameters - The request parameters +// - options - JobsClientCreateOptions contains the optional parameters for the JobsClient.Create method. func (client *JobsClient) Create(ctx context.Context, resourceGroupName string, accountName string, transformName string, jobName string, parameters Job, options *JobsClientCreateOptions) (JobsClientCreateResponse, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, accountName, transformName, jobName, parameters, options) if err != nil { @@ -181,12 +183,13 @@ func (client *JobsClient) createHandleResponse(resp *http.Response) (JobsClientC // Delete - Deletes a Job. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-07-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// transformName - The Transform name. -// jobName - The Job name. -// options - JobsClientDeleteOptions contains the optional parameters for the JobsClient.Delete method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - transformName - The Transform name. +// - jobName - The Job name. +// - options - JobsClientDeleteOptions contains the optional parameters for the JobsClient.Delete method. func (client *JobsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, transformName string, jobName string, options *JobsClientDeleteOptions) (JobsClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, transformName, jobName, options) if err != nil { @@ -238,12 +241,13 @@ func (client *JobsClient) deleteCreateRequest(ctx context.Context, resourceGroup // Get - Gets a Job. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-07-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// transformName - The Transform name. -// jobName - The Job name. -// options - JobsClientGetOptions contains the optional parameters for the JobsClient.Get method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - transformName - The Transform name. +// - jobName - The Job name. +// - options - JobsClientGetOptions contains the optional parameters for the JobsClient.Get method. func (client *JobsClient) Get(ctx context.Context, resourceGroupName string, accountName string, transformName string, jobName string, options *JobsClientGetOptions) (JobsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, transformName, jobName, options) if err != nil { @@ -303,11 +307,12 @@ func (client *JobsClient) getHandleResponse(resp *http.Response) (JobsClientGetR } // NewListPager - Lists all of the Jobs for the Transform. +// // Generated from API version 2022-07-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// transformName - The Transform name. -// options - JobsClientListOptions contains the optional parameters for the JobsClient.List method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - transformName - The Transform name. +// - options - JobsClientListOptions contains the optional parameters for the JobsClient.NewListPager method. func (client *JobsClient) NewListPager(resourceGroupName string, accountName string, transformName string, options *JobsClientListOptions) *runtime.Pager[JobsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[JobsClientListResponse]{ More: func(page JobsClientListResponse) bool { @@ -384,13 +389,14 @@ func (client *JobsClient) listHandleResponse(resp *http.Response) (JobsClientLis // Update - Update is only supported for description and priority. Updating Priority will take effect when the Job state is // Queued or Scheduled and depending on the timing the priority update may be ignored. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-07-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// transformName - The Transform name. -// jobName - The Job name. -// parameters - The request parameters -// options - JobsClientUpdateOptions contains the optional parameters for the JobsClient.Update method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - transformName - The Transform name. +// - jobName - The Job name. +// - parameters - The request parameters +// - options - JobsClientUpdateOptions contains the optional parameters for the JobsClient.Update method. func (client *JobsClient) Update(ctx context.Context, resourceGroupName string, accountName string, transformName string, jobName string, parameters Job, options *JobsClientUpdateOptions) (JobsClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, transformName, jobName, parameters, options) if err != nil { 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 31c77113a5a2..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/jobs_client_example_test.go +++ /dev/null @@ -1,319 +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/Encoding/stable/2022-07-01/examples/jobs-list-all-filter-by-created.json -func ExampleJobsClient_NewListPager_listsJobsForTheTransformFilterByCreated() { - 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-06-01T00:00:10.0000000Z and properties/created le 2021-06-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/Encoding/stable/2022-07-01/examples/jobs-list-all-filter-by-lastmodified.json -func ExampleJobsClient_NewListPager_listsJobsForTheTransformFilterByLastmodified() { - 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/lastmodified ge 2021-06-01T00:00:10.0000000Z and properties/lastmodified le 2021-06-01T00:00:20.0000000Z"), - Orderby: to.Ptr("properties/lastmodified desc"), - }) - 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/Encoding/stable/2022-07-01/examples/jobs-list-all-filter-by-name-and-state.json -func ExampleJobsClient_NewListPager_listsJobsForTheTransformFilterByNameAndState() { - 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("name eq 'job3' and properties/state eq Microsoft.Media.JobState'finished'"), - 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/Encoding/stable/2022-07-01/examples/jobs-list-all-filter-by-name.json -func ExampleJobsClient_NewListPager_listsJobsForTheTransformFilterByName() { - 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("name eq 'job1' or name eq 'job2'"), - Orderby: to.Ptr("name"), - }) - 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/Encoding/stable/2022-07-01/examples/jobs-list-all-filter-by-state-eq.json -func ExampleJobsClient_NewListPager_listsJobsForTheTransformFilterByStateEqual() { - 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/state eq Microsoft.Media.JobState'Processing'"), - 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/Encoding/stable/2022-07-01/examples/jobs-list-all-filter-by-state-ne.json -func ExampleJobsClient_NewListPager_listsJobsForTheTransformFilterByStateNotEqual() { - 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/state ne Microsoft.Media.JobState'processing'"), - 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/Encoding/stable/2022-07-01/examples/jobs-list-all.json -func ExampleJobsClient_NewListPager_listsAllOfTheJobsForTheTransform() { - 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: 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/Encoding/stable/2022-07-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/Encoding/stable/2022-07-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/Encoding/stable/2022-07-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/Encoding/stable/2022-07-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/Encoding/stable/2022-07-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 8cded9e37c31..20a2b25deb4e 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/liveevents_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/liveevents_client.go @@ -33,9 +33,9 @@ type LiveEventsClient struct { } // NewLiveEventsClient creates a new instance of LiveEventsClient with the specified values. -// subscriptionID - The unique identifier for a Microsoft Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The unique identifier for a Microsoft Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewLiveEventsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LiveEventsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,12 +58,13 @@ 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 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. -// options - LiveEventsClientBeginAllocateOptions contains the optional parameters for the LiveEventsClient.BeginAllocate -// method. +// - 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. +// - options - LiveEventsClientBeginAllocateOptions contains the optional parameters for the LiveEventsClient.BeginAllocate +// method. func (client *LiveEventsClient) BeginAllocate(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, options *LiveEventsClientBeginAllocateOptions) (*runtime.Poller[LiveEventsClientAllocateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.allocate(ctx, resourceGroupName, accountName, liveEventName, options) @@ -78,6 +79,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 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) @@ -126,12 +128,13 @@ func (client *LiveEventsClient) allocateCreateRequest(ctx context.Context, resou // 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. +// - 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 { @@ -188,12 +191,13 @@ func (client *LiveEventsClient) asyncOperationHandleResponse(resp *http.Response // BeginCreate - Creates a new live event. // 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. -// parameters - Live event properties needed for creation. -// options - LiveEventsClientBeginCreateOptions contains the optional parameters for the LiveEventsClient.BeginCreate method. +// - 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. +// - parameters - Live event properties needed for creation. +// - options - LiveEventsClientBeginCreateOptions contains the optional parameters for the LiveEventsClient.BeginCreate method. func (client *LiveEventsClient) BeginCreate(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, parameters LiveEvent, options *LiveEventsClientBeginCreateOptions) (*runtime.Poller[LiveEventsClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.create(ctx, resourceGroupName, accountName, liveEventName, parameters, options) @@ -208,6 +212,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 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) @@ -259,11 +264,12 @@ 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 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. -// options - LiveEventsClientBeginDeleteOptions contains the optional parameters for the LiveEventsClient.BeginDelete method. +// - 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. +// - options - LiveEventsClientBeginDeleteOptions contains the optional parameters for the LiveEventsClient.BeginDelete method. func (client *LiveEventsClient) BeginDelete(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, options *LiveEventsClientBeginDeleteOptions) (*runtime.Poller[LiveEventsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, accountName, liveEventName, options) @@ -278,6 +284,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 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) @@ -326,11 +333,12 @@ 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 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. -// options - LiveEventsClientGetOptions contains the optional parameters for the LiveEventsClient.Get method. +// - 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. +// - options - LiveEventsClientGetOptions contains the optional parameters for the LiveEventsClient.Get method. func (client *LiveEventsClient) Get(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, options *LiveEventsClientGetOptions) (LiveEventsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, liveEventName, options) if err != nil { @@ -386,10 +394,11 @@ func (client *LiveEventsClient) getHandleResponse(resp *http.Response) (LiveEven } // NewListPager - Lists all the live events in the account. +// // 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. +// - 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.NewListPager method. func (client *LiveEventsClient) NewListPager(resourceGroupName string, accountName string, options *LiveEventsClientListOptions) *runtime.Pager[LiveEventsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[LiveEventsClientListResponse]{ More: func(page LiveEventsClientListResponse) bool { @@ -455,13 +464,14 @@ func (client *LiveEventsClient) listHandleResponse(resp *http.Response) (LiveEve // 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. +// - 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 { @@ -524,11 +534,12 @@ func (client *LiveEventsClient) operationLocationHandleResponse(resp *http.Respo // 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 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. -// options - LiveEventsClientBeginResetOptions contains the optional parameters for the LiveEventsClient.BeginReset method. +// - 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. +// - options - LiveEventsClientBeginResetOptions contains the optional parameters for the LiveEventsClient.BeginReset method. func (client *LiveEventsClient) BeginReset(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, options *LiveEventsClientBeginResetOptions) (*runtime.Poller[LiveEventsClientResetResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.reset(ctx, resourceGroupName, accountName, liveEventName, options) @@ -545,6 +556,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 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) @@ -593,11 +605,12 @@ 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 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. -// options - LiveEventsClientBeginStartOptions contains the optional parameters for the LiveEventsClient.BeginStart method. +// - 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. +// - options - LiveEventsClientBeginStartOptions contains the optional parameters for the LiveEventsClient.BeginStart method. func (client *LiveEventsClient) BeginStart(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, options *LiveEventsClientBeginStartOptions) (*runtime.Poller[LiveEventsClientStartResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.start(ctx, resourceGroupName, accountName, liveEventName, options) @@ -612,6 +625,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 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) @@ -660,12 +674,13 @@ 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 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. -// parameters - LiveEvent stop parameters -// options - LiveEventsClientBeginStopOptions contains the optional parameters for the LiveEventsClient.BeginStop method. +// - 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. +// - parameters - LiveEvent stop parameters +// - options - LiveEventsClientBeginStopOptions contains the optional parameters for the LiveEventsClient.BeginStop method. func (client *LiveEventsClient) BeginStop(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, parameters LiveEventActionInput, options *LiveEventsClientBeginStopOptions) (*runtime.Poller[LiveEventsClientStopResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.stop(ctx, resourceGroupName, accountName, liveEventName, parameters, options) @@ -680,6 +695,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 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) @@ -728,12 +744,13 @@ 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 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. -// parameters - Live event properties needed for patch. -// options - LiveEventsClientBeginUpdateOptions contains the optional parameters for the LiveEventsClient.BeginUpdate method. +// - 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. +// - parameters - Live event properties needed for patch. +// - options - LiveEventsClientBeginUpdateOptions contains the optional parameters for the LiveEventsClient.BeginUpdate method. func (client *LiveEventsClient) BeginUpdate(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, parameters LiveEvent, options *LiveEventsClientBeginUpdateOptions) (*runtime.Poller[LiveEventsClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, accountName, liveEventName, parameters, options) @@ -748,6 +765,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 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) 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 1f5474643f7a..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/liveevents_client_example_test.go +++ /dev/null @@ -1,321 +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/Streaming/stable/2022-08-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/Streaming/stable/2022-08-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/Streaming/stable/2022-08-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/Streaming/stable/2022-08-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/Streaming/stable/2022-08-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/Streaming/stable/2022-08-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/Streaming/stable/2022-08-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/Streaming/stable/2022-08-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/Streaming/stable/2022-08-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) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/async-operation-result.json -func ExampleLiveEventsClient_AsyncOperation() { - 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.AsyncOperation(ctx, "mediaresources", "slitestmedia10", "62e4d893-d233-4005-988e-a428d9f77076", 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/Streaming/stable/2022-08-01/examples/liveevent-operation-location.json -func ExampleLiveEventsClient_OperationLocation() { - 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.OperationLocation(ctx, "mediaresources", "slitestmedia10", "myLiveEvent1", "62e4d893-d233-4005-988e-a428d9f77076", 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/liveoutputs_client.go b/sdk/resourcemanager/mediaservices/armmediaservices/liveoutputs_client.go index 62051711e29a..ce906d99ad6d 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/liveoutputs_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/liveoutputs_client.go @@ -32,9 +32,9 @@ type LiveOutputsClient struct { } // NewLiveOutputsClient creates a new instance of LiveOutputsClient with the specified values. -// subscriptionID - The unique identifier for a Microsoft Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The unique identifier for a Microsoft Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewLiveOutputsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LiveOutputsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,12 +57,13 @@ func NewLiveOutputsClient(subscriptionID string, credential azcore.TokenCredenti // 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. +// - 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 { @@ -119,13 +120,14 @@ func (client *LiveOutputsClient) asyncOperationHandleResponse(resp *http.Respons // BeginCreate - Creates a new live output. // 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. -// parameters - Live Output properties needed for creation. -// options - LiveOutputsClientBeginCreateOptions contains the optional parameters for the LiveOutputsClient.BeginCreate method. +// - 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. +// - parameters - Live Output properties needed for creation. +// - options - LiveOutputsClientBeginCreateOptions contains the optional parameters for the LiveOutputsClient.BeginCreate method. func (client *LiveOutputsClient) BeginCreate(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, liveOutputName string, parameters LiveOutput, options *LiveOutputsClientBeginCreateOptions) (*runtime.Poller[LiveOutputsClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.create(ctx, resourceGroupName, accountName, liveEventName, liveOutputName, parameters, options) @@ -140,6 +142,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 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) @@ -192,12 +195,13 @@ 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 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. -// options - LiveOutputsClientBeginDeleteOptions contains the optional parameters for the LiveOutputsClient.BeginDelete method. +// - 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. +// - options - LiveOutputsClientBeginDeleteOptions contains the optional parameters for the LiveOutputsClient.BeginDelete method. func (client *LiveOutputsClient) BeginDelete(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, liveOutputName string, options *LiveOutputsClientBeginDeleteOptions) (*runtime.Poller[LiveOutputsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, accountName, liveEventName, liveOutputName, options) @@ -212,6 +216,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 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) @@ -264,12 +269,13 @@ 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 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. -// options - LiveOutputsClientGetOptions contains the optional parameters for the LiveOutputsClient.Get method. +// - 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. +// - options - LiveOutputsClientGetOptions contains the optional parameters for the LiveOutputsClient.Get method. func (client *LiveOutputsClient) Get(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, liveOutputName string, options *LiveOutputsClientGetOptions) (LiveOutputsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, liveEventName, liveOutputName, options) if err != nil { @@ -329,11 +335,12 @@ func (client *LiveOutputsClient) getHandleResponse(resp *http.Response) (LiveOut } // NewListPager - Lists the live outputs of a live event. +// // 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. -// options - LiveOutputsClientListOptions contains the optional parameters for the LiveOutputsClient.List method. +// - 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. +// - options - LiveOutputsClientListOptions contains the optional parameters for the LiveOutputsClient.NewListPager method. func (client *LiveOutputsClient) NewListPager(resourceGroupName string, accountName string, liveEventName string, options *LiveOutputsClientListOptions) *runtime.Pager[LiveOutputsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[LiveOutputsClientListResponse]{ More: func(page LiveOutputsClientListResponse) bool { @@ -403,14 +410,15 @@ func (client *LiveOutputsClient) listHandleResponse(resp *http.Response) (LiveOu // 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. +// - 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 { 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 752dcffdfc95..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/liveoutputs_client_example_test.go +++ /dev/null @@ -1,154 +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/Streaming/stable/2022-08-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/Streaming/stable/2022-08-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/Streaming/stable/2022-08-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"), - RewindWindowLength: to.Ptr("PT4M"), - }, - }, 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/Streaming/stable/2022-08-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) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/async-operation-result.json -func ExampleLiveOutputsClient_AsyncOperation() { - 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.AsyncOperation(ctx, "mediaresources", "slitestmedia10", "62e4d893-d233-4005-988e-a428d9f77076", 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/Streaming/stable/2022-08-01/examples/liveoutput-operation-location.json -func ExampleLiveOutputsClient_OperationLocation() { - 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.OperationLocation(ctx, "mediaresources", "slitestmedia10", "myLiveEvent1", "myLiveOutput1", "62e4d893-d233-4005-988e-a428d9f77076", 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/locations_client.go b/sdk/resourcemanager/mediaservices/armmediaservices/locations_client.go index 01c0240c09fc..a573cdd85be8 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/locations_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/locations_client.go @@ -32,9 +32,9 @@ type LocationsClient struct { } // NewLocationsClient creates a new instance of LocationsClient with the specified values. -// subscriptionID - The unique identifier for a Microsoft Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The unique identifier for a Microsoft Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewLocationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LocationsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,11 +57,12 @@ func NewLocationsClient(subscriptionID string, credential azcore.TokenCredential // CheckNameAvailability - Checks whether the Media Service resource name is available. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-11-01 -// locationName - Location name. -// parameters - The request parameters -// options - LocationsClientCheckNameAvailabilityOptions contains the optional parameters for the LocationsClient.CheckNameAvailability -// method. +// - locationName - Location name. +// - parameters - The request parameters +// - options - LocationsClientCheckNameAvailabilityOptions contains the optional parameters for the LocationsClient.CheckNameAvailability +// method. func (client *LocationsClient) CheckNameAvailability(ctx context.Context, locationName string, parameters CheckNameAvailabilityInput, options *LocationsClientCheckNameAvailabilityOptions) (LocationsClientCheckNameAvailabilityResponse, error) { req, err := client.checkNameAvailabilityCreateRequest(ctx, locationName, parameters, options) if err != nil { 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 eabf3acd5e40..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/locations_client_example_test.go +++ /dev/null @@ -1,40 +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/Accounts/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/models.go b/sdk/resourcemanager/mediaservices/armmediaservices/models.go index 0de1eb1f7514..350c9feab9d8 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/models.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/models.go @@ -135,7 +135,7 @@ type AccountFiltersClientGetOptions struct { // placeholder for future optional parameters } -// AccountFiltersClientListOptions contains the optional parameters for the AccountFiltersClient.List method. +// AccountFiltersClientListOptions contains the optional parameters for the AccountFiltersClient.NewListPager method. type AccountFiltersClientListOptions struct { // placeholder for future optional parameters } @@ -289,7 +289,7 @@ type AssetFiltersClientGetOptions struct { // placeholder for future optional parameters } -// AssetFiltersClientListOptions contains the optional parameters for the AssetFiltersClient.List method. +// AssetFiltersClientListOptions contains the optional parameters for the AssetFiltersClient.NewListPager method. type AssetFiltersClientListOptions struct { // placeholder for future optional parameters } @@ -441,7 +441,7 @@ type AssetsClientListContainerSasOptions struct { // placeholder for future optional parameters } -// AssetsClientListOptions contains the optional parameters for the AssetsClient.List method. +// AssetsClientListOptions contains the optional parameters for the AssetsClient.NewListPager method. type AssetsClientListOptions struct { // Restricts the set of items returned. Filter *string @@ -752,7 +752,7 @@ type ClientGetOptions struct { // placeholder for future optional parameters } -// ClientListBySubscriptionOptions contains the optional parameters for the Client.ListBySubscription method. +// ClientListBySubscriptionOptions contains the optional parameters for the Client.NewListBySubscriptionPager method. type ClientListBySubscriptionOptions struct { // placeholder for future optional parameters } @@ -762,7 +762,7 @@ type ClientListEdgePoliciesOptions struct { // placeholder for future optional parameters } -// ClientListOptions contains the optional parameters for the Client.List method. +// ClientListOptions contains the optional parameters for the Client.NewListPager method. type ClientListOptions struct { // placeholder for future optional parameters } @@ -869,7 +869,7 @@ type ContentKeyPoliciesClientGetPolicyPropertiesWithSecretsOptions struct { // placeholder for future optional parameters } -// ContentKeyPoliciesClientListOptions contains the optional parameters for the ContentKeyPoliciesClient.List method. +// ContentKeyPoliciesClientListOptions contains the optional parameters for the ContentKeyPoliciesClient.NewListPager method. type ContentKeyPoliciesClientListOptions struct { // Restricts the set of items returned. Filter *string @@ -1565,7 +1565,7 @@ type EnvelopeEncryption struct { // ErrorAdditionalInfo - The resource management error additional info. type ErrorAdditionalInfo struct { // READ-ONLY; The additional info. - Info interface{} `json:"info,omitempty" azure:"ro"` + Info any `json:"info,omitempty" azure:"ro"` // READ-ONLY; The additional info type. Type *string `json:"type,omitempty" azure:"ro"` @@ -2650,7 +2650,7 @@ type JobsClientGetOptions struct { // placeholder for future optional parameters } -// JobsClientListOptions contains the optional parameters for the JobsClient.List method. +// JobsClientListOptions contains the optional parameters for the JobsClient.NewListPager method. type JobsClientListOptions struct { // Restricts the set of items returned. Filter *string @@ -3147,7 +3147,7 @@ type LiveEventsClientGetOptions struct { // placeholder for future optional parameters } -// LiveEventsClientListOptions contains the optional parameters for the LiveEventsClient.List method. +// LiveEventsClientListOptions contains the optional parameters for the LiveEventsClient.NewListPager method. type LiveEventsClientListOptions struct { // placeholder for future optional parameters } @@ -3251,7 +3251,7 @@ type LiveOutputsClientGetOptions struct { // placeholder for future optional parameters } -// LiveOutputsClientListOptions contains the optional parameters for the LiveOutputsClient.List method. +// LiveOutputsClientListOptions contains the optional parameters for the LiveOutputsClient.NewListPager method. type LiveOutputsClientListOptions struct { // placeholder for future optional parameters } @@ -4372,7 +4372,7 @@ type StreamingEndpointsClientGetOptions struct { // placeholder for future optional parameters } -// StreamingEndpointsClientListOptions contains the optional parameters for the StreamingEndpointsClient.List method. +// StreamingEndpointsClientListOptions contains the optional parameters for the StreamingEndpointsClient.NewListPager method. type StreamingEndpointsClientListOptions struct { // placeholder for future optional parameters } @@ -4500,7 +4500,7 @@ type StreamingLocatorsClientListContentKeysOptions struct { // placeholder for future optional parameters } -// StreamingLocatorsClientListOptions contains the optional parameters for the StreamingLocatorsClient.List method. +// StreamingLocatorsClientListOptions contains the optional parameters for the StreamingLocatorsClient.NewListPager method. type StreamingLocatorsClientListOptions struct { // Restricts the set of items returned. Filter *string @@ -4543,7 +4543,7 @@ type StreamingPoliciesClientGetOptions struct { // placeholder for future optional parameters } -// StreamingPoliciesClientListOptions contains the optional parameters for the StreamingPoliciesClient.List method. +// StreamingPoliciesClientListOptions contains the optional parameters for the StreamingPoliciesClient.NewListPager method. type StreamingPoliciesClientListOptions struct { // Restricts the set of items returned. Filter *string @@ -4824,7 +4824,7 @@ type TracksClientGetOptions struct { // placeholder for future optional parameters } -// TracksClientListOptions contains the optional parameters for the TracksClient.List method. +// TracksClientListOptions contains the optional parameters for the TracksClient.NewListPager method. type TracksClientListOptions struct { // placeholder for future optional parameters } @@ -4905,7 +4905,7 @@ type TransformsClientGetOptions struct { // placeholder for future optional parameters } -// TransformsClientListOptions contains the optional parameters for the TransformsClient.List method. +// TransformsClientListOptions contains the optional parameters for the TransformsClient.NewListPager method. type TransformsClientListOptions struct { // Restricts the set of items returned. Filter *string diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/models_serde.go b/sdk/resourcemanager/mediaservices/armmediaservices/models_serde.go index d91e1a7520da..76cda9a36262 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/models_serde.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/models_serde.go @@ -19,7 +19,7 @@ import ( // MarshalJSON implements the json.Marshaller interface for type AacAudio. func (a AacAudio) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "bitrate", a.Bitrate) populate(objectMap, "channels", a.Channels) populate(objectMap, "label", a.Label) @@ -66,7 +66,7 @@ func (a *AacAudio) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AbsoluteClipTime. func (a AbsoluteClipTime) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["@odata.type"] = "#Microsoft.Media.AbsoluteClipTime" populate(objectMap, "time", a.Time) return json.Marshal(objectMap) @@ -97,7 +97,7 @@ func (a *AbsoluteClipTime) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AccessControl. func (a AccessControl) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "defaultAction", a.DefaultAction) populate(objectMap, "ipAllowList", a.IPAllowList) return json.Marshal(objectMap) @@ -128,7 +128,7 @@ func (a *AccessControl) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AccountEncryption. func (a AccountEncryption) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "identity", a.Identity) populate(objectMap, "keyVaultProperties", a.KeyVaultProperties) populate(objectMap, "status", a.Status) @@ -167,7 +167,7 @@ func (a *AccountEncryption) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AccountFilter. func (a AccountFilter) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", a.ID) populate(objectMap, "name", a.Name) populate(objectMap, "properties", a.Properties) @@ -210,7 +210,7 @@ func (a *AccountFilter) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AccountFilterCollection. func (a AccountFilterCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "@odata.nextLink", a.ODataNextLink) populate(objectMap, "value", a.Value) return json.Marshal(objectMap) @@ -241,7 +241,7 @@ func (a *AccountFilterCollection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AkamaiAccessControl. func (a AkamaiAccessControl) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "akamaiSignatureHeaderAuthenticationKeyList", a.AkamaiSignatureHeaderAuthenticationKeyList) return json.Marshal(objectMap) } @@ -268,7 +268,7 @@ func (a *AkamaiAccessControl) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AkamaiSignatureHeaderAuthenticationKey. func (a AkamaiSignatureHeaderAuthenticationKey) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "base64Key", a.Base64Key) populateTimeRFC3339(objectMap, "expiration", a.Expiration) populate(objectMap, "identifier", a.Identifier) @@ -303,7 +303,7 @@ func (a *AkamaiSignatureHeaderAuthenticationKey) UnmarshalJSON(data []byte) erro // MarshalJSON implements the json.Marshaller interface for type ArmStreamingEndpointCapacity. func (a ArmStreamingEndpointCapacity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "default", a.Default) populate(objectMap, "maximum", a.Maximum) populate(objectMap, "minimum", a.Minimum) @@ -342,7 +342,7 @@ func (a *ArmStreamingEndpointCapacity) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ArmStreamingEndpointCurrentSKU. func (a ArmStreamingEndpointCurrentSKU) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "capacity", a.Capacity) populate(objectMap, "name", a.Name) return json.Marshal(objectMap) @@ -373,7 +373,7 @@ func (a *ArmStreamingEndpointCurrentSKU) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ArmStreamingEndpointSKU. func (a ArmStreamingEndpointSKU) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "name", a.Name) return json.Marshal(objectMap) } @@ -400,7 +400,7 @@ func (a *ArmStreamingEndpointSKU) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ArmStreamingEndpointSKUInfo. func (a ArmStreamingEndpointSKUInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "capacity", a.Capacity) populate(objectMap, "resourceType", a.ResourceType) populate(objectMap, "sku", a.SKU) @@ -435,7 +435,7 @@ func (a *ArmStreamingEndpointSKUInfo) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Asset. func (a Asset) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", a.ID) populate(objectMap, "name", a.Name) populate(objectMap, "properties", a.Properties) @@ -478,7 +478,7 @@ func (a *Asset) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AssetCollection. func (a AssetCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "@odata.nextLink", a.ODataNextLink) populate(objectMap, "value", a.Value) return json.Marshal(objectMap) @@ -509,7 +509,7 @@ func (a *AssetCollection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AssetContainerSas. func (a AssetContainerSas) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "assetContainerSasUrls", a.AssetContainerSasUrls) return json.Marshal(objectMap) } @@ -536,7 +536,7 @@ func (a *AssetContainerSas) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AssetFileEncryptionMetadata. func (a AssetFileEncryptionMetadata) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "assetFileId", a.AssetFileID) populate(objectMap, "assetFileName", a.AssetFileName) populate(objectMap, "initializationVector", a.InitializationVector) @@ -571,7 +571,7 @@ func (a *AssetFileEncryptionMetadata) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AssetFilter. func (a AssetFilter) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", a.ID) populate(objectMap, "name", a.Name) populate(objectMap, "properties", a.Properties) @@ -614,7 +614,7 @@ func (a *AssetFilter) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AssetFilterCollection. func (a AssetFilterCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "@odata.nextLink", a.ODataNextLink) populate(objectMap, "value", a.Value) return json.Marshal(objectMap) @@ -645,7 +645,7 @@ func (a *AssetFilterCollection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AssetProperties. func (a AssetProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "alternateId", a.AlternateID) populate(objectMap, "assetId", a.AssetID) populate(objectMap, "container", a.Container) @@ -700,7 +700,7 @@ func (a *AssetProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AssetStreamingLocator. func (a AssetStreamingLocator) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "assetName", a.AssetName) populateTimeRFC3339(objectMap, "created", a.Created) populate(objectMap, "defaultContentKeyPolicyName", a.DefaultContentKeyPolicyName) @@ -755,7 +755,7 @@ func (a *AssetStreamingLocator) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AssetTrack. func (a AssetTrack) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", a.ID) populate(objectMap, "name", a.Name) populate(objectMap, "properties", a.Properties) @@ -794,7 +794,7 @@ func (a *AssetTrack) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AssetTrackCollection. func (a AssetTrackCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", a.Value) return json.Marshal(objectMap) } @@ -821,7 +821,7 @@ func (a *AssetTrackCollection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AssetTrackOperationStatus. func (a AssetTrackOperationStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "endTime", a.EndTime) populate(objectMap, "error", a.Error) populate(objectMap, "id", a.ID) @@ -868,7 +868,7 @@ func (a *AssetTrackOperationStatus) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AssetTrackProperties. func (a AssetTrackProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "provisioningState", a.ProvisioningState) populate(objectMap, "track", a.Track) return json.Marshal(objectMap) @@ -899,7 +899,7 @@ func (a *AssetTrackProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AsyncOperationResult. func (a AsyncOperationResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "error", a.Error) populate(objectMap, "name", a.Name) populate(objectMap, "status", a.Status) @@ -934,7 +934,7 @@ func (a *AsyncOperationResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Audio. func (a Audio) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "bitrate", a.Bitrate) populate(objectMap, "channels", a.Channels) populate(objectMap, "label", a.Label) @@ -977,7 +977,7 @@ func (a *Audio) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AudioAnalyzerPreset. func (a AudioAnalyzerPreset) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "audioLanguage", a.AudioLanguage) populate(objectMap, "experimentalOptions", a.ExperimentalOptions) populate(objectMap, "mode", a.Mode) @@ -1016,7 +1016,7 @@ func (a *AudioAnalyzerPreset) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AudioOverlay. func (a AudioOverlay) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "audioGainLevel", a.AudioGainLevel) populate(objectMap, "end", a.End) populate(objectMap, "fadeInDuration", a.FadeInDuration) @@ -1067,7 +1067,7 @@ 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{}) + objectMap := make(map[string]any) populate(objectMap, "bitRate", a.BitRate) populate(objectMap, "dashSettings", a.DashSettings) populate(objectMap, "displayName", a.DisplayName) @@ -1122,7 +1122,7 @@ func (a *AudioTrack) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AudioTrackDescriptor. func (a AudioTrackDescriptor) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "channelMapping", a.ChannelMapping) objectMap["@odata.type"] = "#Microsoft.Media.AudioTrackDescriptor" return json.Marshal(objectMap) @@ -1153,7 +1153,7 @@ func (a *AudioTrackDescriptor) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type BuiltInStandardEncoderPreset. func (b BuiltInStandardEncoderPreset) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "configurations", b.Configurations) objectMap["@odata.type"] = "#Microsoft.Media.BuiltInStandardEncoderPreset" populate(objectMap, "presetName", b.PresetName) @@ -1188,7 +1188,7 @@ func (b *BuiltInStandardEncoderPreset) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CbcsDrmConfiguration. func (c CbcsDrmConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "fairPlay", c.FairPlay) populate(objectMap, "playReady", c.PlayReady) populate(objectMap, "widevine", c.Widevine) @@ -1223,7 +1223,7 @@ func (c *CbcsDrmConfiguration) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CencDrmConfiguration. func (c CencDrmConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "playReady", c.PlayReady) populate(objectMap, "widevine", c.Widevine) return json.Marshal(objectMap) @@ -1254,7 +1254,7 @@ func (c *CencDrmConfiguration) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityInput. func (c CheckNameAvailabilityInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "name", c.Name) populate(objectMap, "type", c.Type) return json.Marshal(objectMap) @@ -1285,7 +1285,7 @@ func (c *CheckNameAvailabilityInput) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ClearKeyEncryptionConfiguration. func (c ClearKeyEncryptionConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "customKeysAcquisitionUrlTemplate", c.CustomKeysAcquisitionURLTemplate) return json.Marshal(objectMap) } @@ -1312,7 +1312,7 @@ func (c *ClearKeyEncryptionConfiguration) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ClipTime. func (c ClipTime) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["@odata.type"] = c.ODataType return json.Marshal(objectMap) } @@ -1339,7 +1339,7 @@ func (c *ClipTime) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Codec. func (c Codec) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "label", c.Label) objectMap["@odata.type"] = c.ODataType return json.Marshal(objectMap) @@ -1370,7 +1370,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{}) + objectMap := make(map[string]any) populate(objectMap, "clearKeyEncryptionConfiguration", c.ClearKeyEncryptionConfiguration) populate(objectMap, "clearTracks", c.ClearTracks) populate(objectMap, "contentKeys", c.ContentKeys) @@ -1413,7 +1413,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{}) + objectMap := make(map[string]any) populate(objectMap, "clearKeyEncryptionConfiguration", c.ClearKeyEncryptionConfiguration) populate(objectMap, "clearTracks", c.ClearTracks) populate(objectMap, "contentKeys", c.ContentKeys) @@ -1456,7 +1456,7 @@ func (c *CommonEncryptionCenc) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicy. func (c ContentKeyPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", c.ID) populate(objectMap, "name", c.Name) populate(objectMap, "properties", c.Properties) @@ -1499,7 +1499,7 @@ func (c *ContentKeyPolicy) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicyClearKeyConfiguration. func (c ContentKeyPolicyClearKeyConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["@odata.type"] = "#Microsoft.Media.ContentKeyPolicyClearKeyConfiguration" return json.Marshal(objectMap) } @@ -1526,7 +1526,7 @@ func (c *ContentKeyPolicyClearKeyConfiguration) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicyCollection. func (c ContentKeyPolicyCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "@odata.nextLink", c.ODataNextLink) populate(objectMap, "value", c.Value) return json.Marshal(objectMap) @@ -1557,7 +1557,7 @@ func (c *ContentKeyPolicyCollection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicyConfiguration. func (c ContentKeyPolicyConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["@odata.type"] = c.ODataType return json.Marshal(objectMap) } @@ -1584,7 +1584,7 @@ func (c *ContentKeyPolicyConfiguration) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicyFairPlayConfiguration. func (c ContentKeyPolicyFairPlayConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateByteArray(objectMap, "ask", c.Ask, runtime.Base64StdFormat) populate(objectMap, "fairPlayPfx", c.FairPlayPfx) populate(objectMap, "fairPlayPfxPassword", c.FairPlayPfxPassword) @@ -1635,7 +1635,7 @@ func (c *ContentKeyPolicyFairPlayConfiguration) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicyFairPlayOfflineRentalConfiguration. func (c ContentKeyPolicyFairPlayOfflineRentalConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "playbackDurationSeconds", c.PlaybackDurationSeconds) populate(objectMap, "storageDurationSeconds", c.StorageDurationSeconds) return json.Marshal(objectMap) @@ -1666,7 +1666,7 @@ func (c *ContentKeyPolicyFairPlayOfflineRentalConfiguration) UnmarshalJSON(data // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicyOpenRestriction. func (c ContentKeyPolicyOpenRestriction) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["@odata.type"] = "#Microsoft.Media.ContentKeyPolicyOpenRestriction" return json.Marshal(objectMap) } @@ -1693,7 +1693,7 @@ func (c *ContentKeyPolicyOpenRestriction) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicyOption. func (c ContentKeyPolicyOption) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "configuration", c.Configuration) populate(objectMap, "name", c.Name) populate(objectMap, "policyOptionId", c.PolicyOptionID) @@ -1732,7 +1732,7 @@ func (c *ContentKeyPolicyOption) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicyPlayReadyConfiguration. func (c ContentKeyPolicyPlayReadyConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "licenses", c.Licenses) objectMap["@odata.type"] = "#Microsoft.Media.ContentKeyPolicyPlayReadyConfiguration" populate(objectMap, "responseCustomData", c.ResponseCustomData) @@ -1767,7 +1767,7 @@ func (c *ContentKeyPolicyPlayReadyConfiguration) UnmarshalJSON(data []byte) erro // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader. func (c ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["@odata.type"] = "#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader" return json.Marshal(objectMap) } @@ -1794,7 +1794,7 @@ func (c *ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader) UnmarshalJSON( // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier. func (c ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "keyId", c.KeyID) objectMap["@odata.type"] = "#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier" return json.Marshal(objectMap) @@ -1825,7 +1825,7 @@ func (c *ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier) Unmarsh // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicyPlayReadyContentKeyLocation. func (c ContentKeyPolicyPlayReadyContentKeyLocation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["@odata.type"] = c.ODataType return json.Marshal(objectMap) } @@ -1852,7 +1852,7 @@ func (c *ContentKeyPolicyPlayReadyContentKeyLocation) UnmarshalJSON(data []byte) // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction. func (c ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "bestEffort", c.BestEffort) populate(objectMap, "configurationData", c.ConfigurationData) return json.Marshal(objectMap) @@ -1883,7 +1883,7 @@ func (c *ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction) Unmarshal // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicyPlayReadyLicense. func (c ContentKeyPolicyPlayReadyLicense) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "allowTestDevices", c.AllowTestDevices) populateTimeRFC3339(objectMap, "beginDate", c.BeginDate) populate(objectMap, "contentKeyLocation", c.ContentKeyLocation) @@ -1950,7 +1950,7 @@ func (c *ContentKeyPolicyPlayReadyLicense) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicyPlayReadyPlayRight. func (c ContentKeyPolicyPlayReadyPlayRight) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "agcAndColorStripeRestriction", c.AgcAndColorStripeRestriction) populate(objectMap, "allowPassingVideoContentToUnknownOutput", c.AllowPassingVideoContentToUnknownOutput) populate(objectMap, "analogVideoOpl", c.AnalogVideoOpl) @@ -2025,7 +2025,7 @@ func (c *ContentKeyPolicyPlayReadyPlayRight) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicyProperties. func (c ContentKeyPolicyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "created", c.Created) populate(objectMap, "description", c.Description) populateTimeRFC3339(objectMap, "lastModified", c.LastModified) @@ -2068,7 +2068,7 @@ func (c *ContentKeyPolicyProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicyRestriction. func (c ContentKeyPolicyRestriction) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["@odata.type"] = c.ODataType return json.Marshal(objectMap) } @@ -2095,7 +2095,7 @@ func (c *ContentKeyPolicyRestriction) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicyRestrictionTokenKey. func (c ContentKeyPolicyRestrictionTokenKey) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["@odata.type"] = c.ODataType return json.Marshal(objectMap) } @@ -2122,7 +2122,7 @@ func (c *ContentKeyPolicyRestrictionTokenKey) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicyRsaTokenKey. func (c ContentKeyPolicyRsaTokenKey) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateByteArray(objectMap, "exponent", c.Exponent, runtime.Base64StdFormat) populateByteArray(objectMap, "modulus", c.Modulus, runtime.Base64StdFormat) objectMap["@odata.type"] = "#Microsoft.Media.ContentKeyPolicyRsaTokenKey" @@ -2157,7 +2157,7 @@ func (c *ContentKeyPolicyRsaTokenKey) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicySymmetricTokenKey. func (c ContentKeyPolicySymmetricTokenKey) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateByteArray(objectMap, "keyValue", c.KeyValue, runtime.Base64StdFormat) objectMap["@odata.type"] = "#Microsoft.Media.ContentKeyPolicySymmetricTokenKey" return json.Marshal(objectMap) @@ -2188,7 +2188,7 @@ func (c *ContentKeyPolicySymmetricTokenKey) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicyTokenClaim. func (c ContentKeyPolicyTokenClaim) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "claimType", c.ClaimType) populate(objectMap, "claimValue", c.ClaimValue) return json.Marshal(objectMap) @@ -2219,7 +2219,7 @@ func (c *ContentKeyPolicyTokenClaim) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicyTokenRestriction. func (c ContentKeyPolicyTokenRestriction) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "alternateVerificationKeys", c.AlternateVerificationKeys) populate(objectMap, "audience", c.Audience) populate(objectMap, "issuer", c.Issuer) @@ -2274,7 +2274,7 @@ func (c *ContentKeyPolicyTokenRestriction) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicyUnknownConfiguration. func (c ContentKeyPolicyUnknownConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["@odata.type"] = "#Microsoft.Media.ContentKeyPolicyUnknownConfiguration" return json.Marshal(objectMap) } @@ -2301,7 +2301,7 @@ func (c *ContentKeyPolicyUnknownConfiguration) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicyUnknownRestriction. func (c ContentKeyPolicyUnknownRestriction) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["@odata.type"] = "#Microsoft.Media.ContentKeyPolicyUnknownRestriction" return json.Marshal(objectMap) } @@ -2328,7 +2328,7 @@ func (c *ContentKeyPolicyUnknownRestriction) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicyWidevineConfiguration. func (c ContentKeyPolicyWidevineConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["@odata.type"] = "#Microsoft.Media.ContentKeyPolicyWidevineConfiguration" populate(objectMap, "widevineTemplate", c.WidevineTemplate) return json.Marshal(objectMap) @@ -2359,7 +2359,7 @@ func (c *ContentKeyPolicyWidevineConfiguration) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicyX509CertificateTokenKey. func (c ContentKeyPolicyX509CertificateTokenKey) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["@odata.type"] = "#Microsoft.Media.ContentKeyPolicyX509CertificateTokenKey" populateByteArray(objectMap, "rawBody", c.RawBody, runtime.Base64StdFormat) return json.Marshal(objectMap) @@ -2390,7 +2390,7 @@ func (c *ContentKeyPolicyX509CertificateTokenKey) UnmarshalJSON(data []byte) err // MarshalJSON implements the json.Marshaller interface for type CopyAudio. func (c CopyAudio) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "label", c.Label) objectMap["@odata.type"] = "#Microsoft.Media.CopyAudio" return json.Marshal(objectMap) @@ -2421,7 +2421,7 @@ func (c *CopyAudio) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CopyVideo. func (c CopyVideo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "label", c.Label) objectMap["@odata.type"] = "#Microsoft.Media.CopyVideo" return json.Marshal(objectMap) @@ -2452,7 +2452,7 @@ func (c *CopyVideo) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CrossSiteAccessPolicies. func (c CrossSiteAccessPolicies) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "clientAccessPolicy", c.ClientAccessPolicy) populate(objectMap, "crossDomainPolicy", c.CrossDomainPolicy) return json.Marshal(objectMap) @@ -2483,7 +2483,7 @@ func (c *CrossSiteAccessPolicies) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DDAudio. func (d DDAudio) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "bitrate", d.Bitrate) populate(objectMap, "channels", d.Channels) populate(objectMap, "label", d.Label) @@ -2526,7 +2526,7 @@ func (d *DDAudio) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DashSettings. func (d DashSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "role", d.Role) return json.Marshal(objectMap) } @@ -2553,7 +2553,7 @@ func (d *DashSettings) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DefaultKey. func (d DefaultKey) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "label", d.Label) populate(objectMap, "policyName", d.PolicyName) return json.Marshal(objectMap) @@ -2584,7 +2584,7 @@ func (d *DefaultKey) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Deinterlace. func (d Deinterlace) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "mode", d.Mode) populate(objectMap, "parity", d.Parity) return json.Marshal(objectMap) @@ -2615,7 +2615,7 @@ func (d *Deinterlace) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type EdgePolicies. func (e EdgePolicies) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "usageDataCollectionPolicy", e.UsageDataCollectionPolicy) return json.Marshal(objectMap) } @@ -2642,7 +2642,7 @@ func (e *EdgePolicies) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type EdgeUsageDataCollectionPolicy. func (e EdgeUsageDataCollectionPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "dataCollectionFrequency", e.DataCollectionFrequency) populate(objectMap, "dataReportingFrequency", e.DataReportingFrequency) populate(objectMap, "eventHubDetails", e.EventHubDetails) @@ -2681,7 +2681,7 @@ func (e *EdgeUsageDataCollectionPolicy) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type EdgeUsageDataEventHub. func (e EdgeUsageDataEventHub) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "name", e.Name) populate(objectMap, "namespace", e.Namespace) populate(objectMap, "token", e.Token) @@ -2716,7 +2716,7 @@ func (e *EdgeUsageDataEventHub) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type EnabledProtocols. func (e EnabledProtocols) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "dash", e.Dash) populate(objectMap, "download", e.Download) populate(objectMap, "hls", e.Hls) @@ -2755,7 +2755,7 @@ func (e *EnabledProtocols) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type EntityNameAvailabilityCheckOutput. func (e EntityNameAvailabilityCheckOutput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "message", e.Message) populate(objectMap, "nameAvailable", e.NameAvailable) populate(objectMap, "reason", e.Reason) @@ -2790,7 +2790,7 @@ func (e *EntityNameAvailabilityCheckOutput) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type EnvelopeEncryption. func (e EnvelopeEncryption) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "clearTracks", e.ClearTracks) populate(objectMap, "contentKeys", e.ContentKeys) populate(objectMap, "customKeyAcquisitionUrlTemplate", e.CustomKeyAcquisitionURLTemplate) @@ -2829,7 +2829,7 @@ func (e *EnvelopeEncryption) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo. func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "info", &e.Info) populate(objectMap, "type", e.Type) return json.Marshal(objectMap) @@ -2860,7 +2860,7 @@ func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ErrorDetail. func (e ErrorDetail) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "additionalInfo", e.AdditionalInfo) populate(objectMap, "code", e.Code) populate(objectMap, "details", e.Details) @@ -2903,7 +2903,7 @@ func (e *ErrorDetail) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ErrorResponse. func (e ErrorResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "error", e.Error) return json.Marshal(objectMap) } @@ -2930,7 +2930,7 @@ func (e *ErrorResponse) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type FaceDetectorPreset. func (f FaceDetectorPreset) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "blurType", f.BlurType) populate(objectMap, "experimentalOptions", f.ExperimentalOptions) populate(objectMap, "mode", f.Mode) @@ -2973,7 +2973,7 @@ func (f *FaceDetectorPreset) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Fade. func (f Fade) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "duration", f.Duration) populate(objectMap, "fadeColor", f.FadeColor) populate(objectMap, "start", f.Start) @@ -3008,7 +3008,7 @@ func (f *Fade) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type FilterTrackPropertyCondition. func (f FilterTrackPropertyCondition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "operation", f.Operation) populate(objectMap, "property", f.Property) populate(objectMap, "value", f.Value) @@ -3043,7 +3043,7 @@ func (f *FilterTrackPropertyCondition) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type FilterTrackSelection. func (f FilterTrackSelection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "trackSelections", f.TrackSelections) return json.Marshal(objectMap) } @@ -3070,7 +3070,7 @@ func (f *FilterTrackSelection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Filters. func (f Filters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "crop", f.Crop) populate(objectMap, "deinterlace", f.Deinterlace) populate(objectMap, "fadeIn", f.FadeIn) @@ -3117,7 +3117,7 @@ func (f *Filters) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type FirstQuality. func (f FirstQuality) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "bitrate", f.Bitrate) return json.Marshal(objectMap) } @@ -3144,7 +3144,7 @@ func (f *FirstQuality) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Format. func (f Format) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "filenamePattern", f.FilenamePattern) objectMap["@odata.type"] = f.ODataType return json.Marshal(objectMap) @@ -3175,7 +3175,7 @@ func (f *Format) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type FromAllInputFile. func (f FromAllInputFile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "includedTracks", f.IncludedTracks) objectMap["@odata.type"] = "#Microsoft.Media.FromAllInputFile" return json.Marshal(objectMap) @@ -3206,7 +3206,7 @@ func (f *FromAllInputFile) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type FromEachInputFile. func (f FromEachInputFile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "includedTracks", f.IncludedTracks) objectMap["@odata.type"] = "#Microsoft.Media.FromEachInputFile" return json.Marshal(objectMap) @@ -3237,7 +3237,7 @@ func (f *FromEachInputFile) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type H264Layer. func (h H264Layer) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "adaptiveBFrame", h.AdaptiveBFrame) populate(objectMap, "bFrames", h.BFrames) populate(objectMap, "bitrate", h.Bitrate) @@ -3320,7 +3320,7 @@ func (h *H264Layer) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type H264Video. func (h H264Video) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "complexity", h.Complexity) populate(objectMap, "keyFrameInterval", h.KeyFrameInterval) populate(objectMap, "label", h.Label) @@ -3379,7 +3379,7 @@ func (h *H264Video) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type H265Layer. func (h H265Layer) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "adaptiveBFrame", h.AdaptiveBFrame) populate(objectMap, "bFrames", h.BFrames) populate(objectMap, "bitrate", h.Bitrate) @@ -3458,7 +3458,7 @@ func (h *H265Layer) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type H265Video. func (h H265Video) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "complexity", h.Complexity) populate(objectMap, "keyFrameInterval", h.KeyFrameInterval) populate(objectMap, "label", h.Label) @@ -3513,7 +3513,7 @@ func (h *H265Video) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type H265VideoLayer. func (h H265VideoLayer) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "adaptiveBFrame", h.AdaptiveBFrame) populate(objectMap, "bFrames", h.BFrames) populate(objectMap, "bitrate", h.Bitrate) @@ -3572,7 +3572,7 @@ func (h *H265VideoLayer) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Hls. func (h Hls) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "fragmentsPerTsSegment", h.FragmentsPerTsSegment) return json.Marshal(objectMap) } @@ -3599,7 +3599,7 @@ func (h *Hls) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type HlsSettings. func (h HlsSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "characteristics", h.Characteristics) populate(objectMap, "default", h.Default) populate(objectMap, "forced", h.Forced) @@ -3634,7 +3634,7 @@ func (h *HlsSettings) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type IPAccessControl. func (i IPAccessControl) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "allow", i.Allow) return json.Marshal(objectMap) } @@ -3661,7 +3661,7 @@ func (i *IPAccessControl) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type IPRange. func (i IPRange) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "address", i.Address) populate(objectMap, "name", i.Name) populate(objectMap, "subnetPrefixLength", i.SubnetPrefixLength) @@ -3696,7 +3696,7 @@ func (i *IPRange) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Image. func (i Image) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "keyFrameInterval", i.KeyFrameInterval) populate(objectMap, "label", i.Label) objectMap["@odata.type"] = "#Microsoft.Media.Image" @@ -3751,7 +3751,7 @@ func (i *Image) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ImageFormat. func (i ImageFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "filenamePattern", i.FilenamePattern) objectMap["@odata.type"] = "#Microsoft.Media.ImageFormat" return json.Marshal(objectMap) @@ -3782,7 +3782,7 @@ func (i *ImageFormat) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type InputDefinition. func (i InputDefinition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "includedTracks", i.IncludedTracks) objectMap["@odata.type"] = i.ODataType return json.Marshal(objectMap) @@ -3813,7 +3813,7 @@ func (i *InputDefinition) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type InputFile. func (i InputFile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "filename", i.Filename) populate(objectMap, "includedTracks", i.IncludedTracks) objectMap["@odata.type"] = "#Microsoft.Media.InputFile" @@ -3848,7 +3848,7 @@ func (i *InputFile) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Job. func (j Job) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", j.ID) populate(objectMap, "name", j.Name) populate(objectMap, "properties", j.Properties) @@ -3891,7 +3891,7 @@ func (j *Job) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type JobCollection. func (j JobCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "@odata.nextLink", j.ODataNextLink) populate(objectMap, "value", j.Value) return json.Marshal(objectMap) @@ -3922,7 +3922,7 @@ func (j *JobCollection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type JobError. func (j JobError) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "category", j.Category) populate(objectMap, "code", j.Code) populate(objectMap, "details", j.Details) @@ -3965,7 +3965,7 @@ func (j *JobError) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type JobErrorDetail. func (j JobErrorDetail) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "code", j.Code) populate(objectMap, "message", j.Message) return json.Marshal(objectMap) @@ -3996,7 +3996,7 @@ func (j *JobErrorDetail) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type JobInput. func (j JobInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["@odata.type"] = j.ODataType return json.Marshal(objectMap) } @@ -4023,7 +4023,7 @@ func (j *JobInput) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type JobInputAsset. func (j JobInputAsset) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "assetName", j.AssetName) populate(objectMap, "end", j.End) populate(objectMap, "files", j.Files) @@ -4074,7 +4074,7 @@ func (j *JobInputAsset) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type JobInputClip. func (j JobInputClip) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "end", j.End) populate(objectMap, "files", j.Files) populate(objectMap, "inputDefinitions", j.InputDefinitions) @@ -4121,7 +4121,7 @@ func (j *JobInputClip) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type JobInputHTTP. func (j JobInputHTTP) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "baseUri", j.BaseURI) populate(objectMap, "end", j.End) populate(objectMap, "files", j.Files) @@ -4172,7 +4172,7 @@ func (j *JobInputHTTP) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type JobInputSequence. func (j JobInputSequence) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "inputs", j.Inputs) objectMap["@odata.type"] = "#Microsoft.Media.JobInputSequence" return json.Marshal(objectMap) @@ -4203,7 +4203,7 @@ func (j *JobInputSequence) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type JobInputs. func (j JobInputs) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "inputs", j.Inputs) objectMap["@odata.type"] = "#Microsoft.Media.JobInputs" return json.Marshal(objectMap) @@ -4234,7 +4234,7 @@ func (j *JobInputs) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type JobOutput. func (j JobOutput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "endTime", j.EndTime) populate(objectMap, "error", j.Error) populate(objectMap, "label", j.Label) @@ -4289,7 +4289,7 @@ func (j *JobOutput) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type JobOutputAsset. func (j JobOutputAsset) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "assetName", j.AssetName) populateTimeRFC3339(objectMap, "endTime", j.EndTime) populate(objectMap, "error", j.Error) @@ -4348,7 +4348,7 @@ func (j *JobOutputAsset) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type JobProperties. func (j JobProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "correlationData", j.CorrelationData) populateTimeRFC3339(objectMap, "created", j.Created) populate(objectMap, "description", j.Description) @@ -4411,7 +4411,7 @@ func (j *JobProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type JpgFormat. func (j JpgFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "filenamePattern", j.FilenamePattern) objectMap["@odata.type"] = "#Microsoft.Media.JpgFormat" return json.Marshal(objectMap) @@ -4442,7 +4442,7 @@ func (j *JpgFormat) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type JpgImage. func (j JpgImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "keyFrameInterval", j.KeyFrameInterval) populate(objectMap, "label", j.Label) populate(objectMap, "layers", j.Layers) @@ -4505,7 +4505,7 @@ func (j *JpgImage) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type JpgLayer. func (j JpgLayer) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "height", j.Height) populate(objectMap, "label", j.Label) populate(objectMap, "quality", j.Quality) @@ -4544,7 +4544,7 @@ func (j *JpgLayer) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type KeyDelivery. func (k KeyDelivery) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "accessControl", k.AccessControl) return json.Marshal(objectMap) } @@ -4571,7 +4571,7 @@ func (k *KeyDelivery) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type KeyVaultProperties. func (k KeyVaultProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "currentKeyIdentifier", k.CurrentKeyIdentifier) populate(objectMap, "keyIdentifier", k.KeyIdentifier) return json.Marshal(objectMap) @@ -4602,7 +4602,7 @@ func (k *KeyVaultProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Layer. func (l Layer) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "height", l.Height) populate(objectMap, "label", l.Label) populate(objectMap, "width", l.Width) @@ -4637,7 +4637,7 @@ func (l *Layer) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ListContainerSasInput. func (l ListContainerSasInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "expiryTime", l.ExpiryTime) populate(objectMap, "permissions", l.Permissions) return json.Marshal(objectMap) @@ -4668,7 +4668,7 @@ func (l *ListContainerSasInput) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ListContentKeysResponse. func (l ListContentKeysResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "contentKeys", l.ContentKeys) return json.Marshal(objectMap) } @@ -4695,7 +4695,7 @@ func (l *ListContentKeysResponse) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ListEdgePoliciesInput. func (l ListEdgePoliciesInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "deviceId", l.DeviceID) return json.Marshal(objectMap) } @@ -4722,7 +4722,7 @@ func (l *ListEdgePoliciesInput) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ListPathsResponse. func (l ListPathsResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "downloadPaths", l.DownloadPaths) populate(objectMap, "streamingPaths", l.StreamingPaths) return json.Marshal(objectMap) @@ -4753,7 +4753,7 @@ func (l *ListPathsResponse) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ListStreamingLocatorsResponse. func (l ListStreamingLocatorsResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "streamingLocators", l.StreamingLocators) return json.Marshal(objectMap) } @@ -4780,7 +4780,7 @@ func (l *ListStreamingLocatorsResponse) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type LiveEvent. func (l LiveEvent) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", l.ID) populate(objectMap, "location", l.Location) populate(objectMap, "name", l.Name) @@ -4831,7 +4831,7 @@ func (l *LiveEvent) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type LiveEventActionInput. func (l LiveEventActionInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "removeOutputsOnStop", l.RemoveOutputsOnStop) return json.Marshal(objectMap) } @@ -4858,7 +4858,7 @@ func (l *LiveEventActionInput) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type LiveEventEncoding. func (l LiveEventEncoding) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "encodingType", l.EncodingType) populate(objectMap, "keyFrameInterval", l.KeyFrameInterval) populate(objectMap, "presetName", l.PresetName) @@ -4897,7 +4897,7 @@ func (l *LiveEventEncoding) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type LiveEventEndpoint. func (l LiveEventEndpoint) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "protocol", l.Protocol) populate(objectMap, "url", l.URL) return json.Marshal(objectMap) @@ -4928,7 +4928,7 @@ func (l *LiveEventEndpoint) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type LiveEventInput. func (l LiveEventInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "accessControl", l.AccessControl) populate(objectMap, "accessToken", l.AccessToken) populate(objectMap, "endpoints", l.Endpoints) @@ -4971,7 +4971,7 @@ func (l *LiveEventInput) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type LiveEventInputAccessControl. func (l LiveEventInputAccessControl) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "ip", l.IP) return json.Marshal(objectMap) } @@ -4998,7 +4998,7 @@ func (l *LiveEventInputAccessControl) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type LiveEventInputTrackSelection. func (l LiveEventInputTrackSelection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "operation", l.Operation) populate(objectMap, "property", l.Property) populate(objectMap, "value", l.Value) @@ -5033,7 +5033,7 @@ func (l *LiveEventInputTrackSelection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type LiveEventListResult. func (l LiveEventListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "@odata.count", l.ODataCount) populate(objectMap, "@odata.nextLink", l.ODataNextLink) populate(objectMap, "value", l.Value) @@ -5068,7 +5068,7 @@ func (l *LiveEventListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type LiveEventOutputTranscriptionTrack. func (l LiveEventOutputTranscriptionTrack) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "trackName", l.TrackName) return json.Marshal(objectMap) } @@ -5095,7 +5095,7 @@ func (l *LiveEventOutputTranscriptionTrack) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type LiveEventPreview. func (l LiveEventPreview) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "accessControl", l.AccessControl) populate(objectMap, "alternativeMediaId", l.AlternativeMediaID) populate(objectMap, "endpoints", l.Endpoints) @@ -5138,7 +5138,7 @@ func (l *LiveEventPreview) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type LiveEventPreviewAccessControl. func (l LiveEventPreviewAccessControl) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "ip", l.IP) return json.Marshal(objectMap) } @@ -5165,7 +5165,7 @@ func (l *LiveEventPreviewAccessControl) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type LiveEventProperties. func (l LiveEventProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "created", l.Created) populate(objectMap, "crossSiteAccessPolicies", l.CrossSiteAccessPolicies) populate(objectMap, "description", l.Description) @@ -5240,7 +5240,7 @@ func (l *LiveEventProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type LiveEventTranscription. func (l LiveEventTranscription) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "inputTrackSelection", l.InputTrackSelection) populate(objectMap, "language", l.Language) populate(objectMap, "outputTranscriptionTrack", l.OutputTranscriptionTrack) @@ -5275,7 +5275,7 @@ func (l *LiveEventTranscription) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type LiveOutput. func (l LiveOutput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", l.ID) populate(objectMap, "name", l.Name) populate(objectMap, "properties", l.Properties) @@ -5318,7 +5318,7 @@ func (l *LiveOutput) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type LiveOutputListResult. func (l LiveOutputListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "@odata.count", l.ODataCount) populate(objectMap, "@odata.nextLink", l.ODataNextLink) populate(objectMap, "value", l.Value) @@ -5353,7 +5353,7 @@ func (l *LiveOutputListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type LiveOutputProperties. func (l LiveOutputProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "archiveWindowLength", l.ArchiveWindowLength) populate(objectMap, "assetName", l.AssetName) populateTimeRFC3339(objectMap, "created", l.Created) @@ -5420,7 +5420,7 @@ func (l *LiveOutputProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type LogSpecification. func (l LogSpecification) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "blobDuration", l.BlobDuration) populate(objectMap, "displayName", l.DisplayName) populate(objectMap, "name", l.Name) @@ -5455,7 +5455,7 @@ func (l *LogSpecification) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MediaFilterProperties. func (m MediaFilterProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "firstQuality", m.FirstQuality) populate(objectMap, "presentationTimeRange", m.PresentationTimeRange) populate(objectMap, "tracks", m.Tracks) @@ -5490,7 +5490,7 @@ func (m *MediaFilterProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MediaService. func (m MediaService) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", m.ID) populate(objectMap, "identity", m.Identity) populate(objectMap, "location", m.Location) @@ -5545,7 +5545,7 @@ func (m *MediaService) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MediaServiceCollection. func (m MediaServiceCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "@odata.nextLink", m.ODataNextLink) populate(objectMap, "value", m.Value) return json.Marshal(objectMap) @@ -5576,7 +5576,7 @@ func (m *MediaServiceCollection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MediaServiceIdentity. func (m MediaServiceIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "principalId", m.PrincipalID) populate(objectMap, "tenantId", m.TenantID) populate(objectMap, "type", m.Type) @@ -5615,7 +5615,7 @@ func (m *MediaServiceIdentity) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MediaServiceOperationStatus. func (m MediaServiceOperationStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "endTime", m.EndTime) populate(objectMap, "error", m.Error) populate(objectMap, "id", m.ID) @@ -5662,7 +5662,7 @@ func (m *MediaServiceOperationStatus) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MediaServiceProperties. func (m MediaServiceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "encryption", m.Encryption) populate(objectMap, "keyDelivery", m.KeyDelivery) populate(objectMap, "mediaServiceId", m.MediaServiceID) @@ -5717,7 +5717,7 @@ func (m *MediaServiceProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MediaServiceUpdate. func (m MediaServiceUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "identity", m.Identity) populate(objectMap, "properties", m.Properties) populate(objectMap, "tags", m.Tags) @@ -5752,7 +5752,7 @@ func (m *MediaServiceUpdate) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MetricDimension. func (m MetricDimension) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "displayName", m.DisplayName) populate(objectMap, "name", m.Name) populate(objectMap, "toBeExportedForShoebox", m.ToBeExportedForShoebox) @@ -5787,7 +5787,7 @@ func (m *MetricDimension) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MetricSpecification. func (m MetricSpecification) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "aggregationType", m.AggregationType) populate(objectMap, "dimensions", m.Dimensions) populate(objectMap, "displayDescription", m.DisplayDescription) @@ -5858,7 +5858,7 @@ func (m *MetricSpecification) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Mp4Format. func (m Mp4Format) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "filenamePattern", m.FilenamePattern) objectMap["@odata.type"] = "#Microsoft.Media.Mp4Format" populate(objectMap, "outputFiles", m.OutputFiles) @@ -5893,7 +5893,7 @@ func (m *Mp4Format) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MultiBitrateFormat. func (m MultiBitrateFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "filenamePattern", m.FilenamePattern) objectMap["@odata.type"] = "#Microsoft.Media.MultiBitrateFormat" populate(objectMap, "outputFiles", m.OutputFiles) @@ -5928,7 +5928,7 @@ func (m *MultiBitrateFormat) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type NoEncryption. func (n NoEncryption) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "enabledProtocols", n.EnabledProtocols) return json.Marshal(objectMap) } @@ -5955,7 +5955,7 @@ func (n *NoEncryption) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Operation. func (o Operation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "actionType", o.ActionType) populate(objectMap, "display", o.Display) populate(objectMap, "isDataAction", o.IsDataAction) @@ -6002,7 +6002,7 @@ func (o *Operation) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OperationCollection. func (o OperationCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", o.Value) return json.Marshal(objectMap) } @@ -6029,7 +6029,7 @@ func (o *OperationCollection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OperationDisplay. func (o OperationDisplay) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", o.Description) populate(objectMap, "operation", o.Operation) populate(objectMap, "provider", o.Provider) @@ -6068,7 +6068,7 @@ func (o *OperationDisplay) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OutputFile. func (o OutputFile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "labels", o.Labels) return json.Marshal(objectMap) } @@ -6095,7 +6095,7 @@ func (o *OutputFile) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Overlay. func (o Overlay) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "audioGainLevel", o.AudioGainLevel) populate(objectMap, "end", o.End) populate(objectMap, "fadeInDuration", o.FadeInDuration) @@ -6146,7 +6146,7 @@ func (o *Overlay) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PNGFormat. func (p PNGFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "filenamePattern", p.FilenamePattern) objectMap["@odata.type"] = "#Microsoft.Media.PngFormat" return json.Marshal(objectMap) @@ -6177,7 +6177,7 @@ func (p *PNGFormat) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PNGImage. func (p PNGImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "keyFrameInterval", p.KeyFrameInterval) populate(objectMap, "label", p.Label) populate(objectMap, "layers", p.Layers) @@ -6236,7 +6236,7 @@ func (p *PNGImage) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PNGLayer. func (p PNGLayer) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "height", p.Height) populate(objectMap, "label", p.Label) populate(objectMap, "width", p.Width) @@ -6271,7 +6271,7 @@ func (p *PNGLayer) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PresentationTimeRange. func (p PresentationTimeRange) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "endTimestamp", p.EndTimestamp) populate(objectMap, "forceEndTimestamp", p.ForceEndTimestamp) populate(objectMap, "liveBackoffDuration", p.LiveBackoffDuration) @@ -6318,7 +6318,7 @@ func (p *PresentationTimeRange) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Preset. func (p Preset) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["@odata.type"] = p.ODataType return json.Marshal(objectMap) } @@ -6345,7 +6345,7 @@ func (p *Preset) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PresetConfigurations. func (p PresetConfigurations) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "complexity", p.Complexity) populate(objectMap, "interleaveOutput", p.InterleaveOutput) populate(objectMap, "keyFrameIntervalInSeconds", p.KeyFrameIntervalInSeconds) @@ -6400,7 +6400,7 @@ func (p *PresetConfigurations) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PrivateEndpoint. func (p PrivateEndpoint) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", p.ID) return json.Marshal(objectMap) } @@ -6427,7 +6427,7 @@ func (p *PrivateEndpoint) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection. func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", p.ID) populate(objectMap, "name", p.Name) populate(objectMap, "properties", p.Properties) @@ -6466,7 +6466,7 @@ func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult. func (p PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } @@ -6493,7 +6493,7 @@ func (p *PrivateEndpointConnectionListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties. func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "privateEndpoint", p.PrivateEndpoint) populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) populate(objectMap, "provisioningState", p.ProvisioningState) @@ -6528,7 +6528,7 @@ func (p *PrivateEndpointConnectionProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource. func (p PrivateLinkResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", p.ID) populate(objectMap, "name", p.Name) populate(objectMap, "properties", p.Properties) @@ -6567,7 +6567,7 @@ func (p *PrivateLinkResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult. func (p PrivateLinkResourceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } @@ -6594,7 +6594,7 @@ func (p *PrivateLinkResourceListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties. func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "groupId", p.GroupID) populate(objectMap, "requiredMembers", p.RequiredMembers) populate(objectMap, "requiredZoneNames", p.RequiredZoneNames) @@ -6629,7 +6629,7 @@ func (p *PrivateLinkResourceProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionState. func (p PrivateLinkServiceConnectionState) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "actionsRequired", p.ActionsRequired) populate(objectMap, "description", p.Description) populate(objectMap, "status", p.Status) @@ -6664,7 +6664,7 @@ func (p *PrivateLinkServiceConnectionState) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Properties. func (p Properties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "serviceSpecification", p.ServiceSpecification) return json.Marshal(objectMap) } @@ -6691,7 +6691,7 @@ func (p *Properties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ProxyResource. func (p ProxyResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", p.ID) populate(objectMap, "name", p.Name) populate(objectMap, "type", p.Type) @@ -6726,7 +6726,7 @@ func (p *ProxyResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Rectangle. func (r Rectangle) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "height", r.Height) populate(objectMap, "left", r.Left) populate(objectMap, "top", r.Top) @@ -6765,7 +6765,7 @@ func (r *Rectangle) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Resource. func (r Resource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", r.ID) populate(objectMap, "name", r.Name) populate(objectMap, "type", r.Type) @@ -6800,7 +6800,7 @@ func (r *Resource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ResourceIdentity. func (r ResourceIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "useSystemAssignedIdentity", r.UseSystemAssignedIdentity) populate(objectMap, "userAssignedIdentity", r.UserAssignedIdentity) return json.Marshal(objectMap) @@ -6831,7 +6831,7 @@ func (r *ResourceIdentity) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SelectAudioTrackByAttribute. func (s SelectAudioTrackByAttribute) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "attribute", s.Attribute) populate(objectMap, "channelMapping", s.ChannelMapping) populate(objectMap, "filter", s.Filter) @@ -6874,7 +6874,7 @@ func (s *SelectAudioTrackByAttribute) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SelectAudioTrackByID. func (s SelectAudioTrackByID) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "channelMapping", s.ChannelMapping) objectMap["@odata.type"] = "#Microsoft.Media.SelectAudioTrackById" populate(objectMap, "trackId", s.TrackID) @@ -6909,7 +6909,7 @@ func (s *SelectAudioTrackByID) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SelectVideoTrackByAttribute. func (s SelectVideoTrackByAttribute) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "attribute", s.Attribute) populate(objectMap, "filter", s.Filter) populate(objectMap, "filterValue", s.FilterValue) @@ -6948,7 +6948,7 @@ func (s *SelectVideoTrackByAttribute) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SelectVideoTrackByID. func (s SelectVideoTrackByID) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["@odata.type"] = "#Microsoft.Media.SelectVideoTrackById" populate(objectMap, "trackId", s.TrackID) return json.Marshal(objectMap) @@ -6979,7 +6979,7 @@ func (s *SelectVideoTrackByID) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ServiceSpecification. func (s ServiceSpecification) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "logSpecifications", s.LogSpecifications) populate(objectMap, "metricSpecifications", s.MetricSpecifications) return json.Marshal(objectMap) @@ -7010,7 +7010,7 @@ func (s *ServiceSpecification) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type StandardEncoderPreset. func (s StandardEncoderPreset) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "codecs", s.Codecs) populate(objectMap, "experimentalOptions", s.ExperimentalOptions) populate(objectMap, "filters", s.Filters) @@ -7053,7 +7053,7 @@ func (s *StandardEncoderPreset) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type StorageAccount. func (s StorageAccount) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "identity", s.Identity) populate(objectMap, "status", s.Status) @@ -7092,7 +7092,7 @@ func (s *StorageAccount) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type StorageEncryptedAssetDecryptionData. func (s StorageEncryptedAssetDecryptionData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "assetFileEncryptionMetadata", s.AssetFileEncryptionMetadata) populateByteArray(objectMap, "key", s.Key, runtime.Base64StdFormat) return json.Marshal(objectMap) @@ -7123,7 +7123,7 @@ func (s *StorageEncryptedAssetDecryptionData) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type StreamingEndpoint. func (s StreamingEndpoint) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "location", s.Location) populate(objectMap, "name", s.Name) @@ -7178,7 +7178,7 @@ func (s *StreamingEndpoint) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type StreamingEndpointAccessControl. func (s StreamingEndpointAccessControl) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "akamai", s.Akamai) populate(objectMap, "ip", s.IP) return json.Marshal(objectMap) @@ -7209,7 +7209,7 @@ func (s *StreamingEndpointAccessControl) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type StreamingEndpointListResult. func (s StreamingEndpointListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "@odata.count", s.ODataCount) populate(objectMap, "@odata.nextLink", s.ODataNextLink) populate(objectMap, "value", s.Value) @@ -7244,7 +7244,7 @@ func (s *StreamingEndpointListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type StreamingEndpointProperties. func (s StreamingEndpointProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "accessControl", s.AccessControl) populate(objectMap, "availabilitySetName", s.AvailabilitySetName) populate(objectMap, "cdnEnabled", s.CdnEnabled) @@ -7331,7 +7331,7 @@ func (s *StreamingEndpointProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type StreamingEndpointSKUInfoListResult. func (s StreamingEndpointSKUInfoListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } @@ -7358,7 +7358,7 @@ func (s *StreamingEndpointSKUInfoListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type StreamingEntityScaleUnit. func (s StreamingEntityScaleUnit) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "scaleUnit", s.ScaleUnit) return json.Marshal(objectMap) } @@ -7385,7 +7385,7 @@ func (s *StreamingEntityScaleUnit) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type StreamingLocator. func (s StreamingLocator) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) @@ -7428,7 +7428,7 @@ func (s *StreamingLocator) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type StreamingLocatorCollection. func (s StreamingLocatorCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "@odata.nextLink", s.ODataNextLink) populate(objectMap, "value", s.Value) return json.Marshal(objectMap) @@ -7459,7 +7459,7 @@ func (s *StreamingLocatorCollection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type StreamingLocatorContentKey. func (s StreamingLocatorContentKey) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "labelReferenceInStreamingPolicy", s.LabelReferenceInStreamingPolicy) populate(objectMap, "policyName", s.PolicyName) @@ -7506,7 +7506,7 @@ func (s *StreamingLocatorContentKey) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type StreamingLocatorProperties. func (s StreamingLocatorProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "alternativeMediaId", s.AlternativeMediaID) populate(objectMap, "assetName", s.AssetName) populate(objectMap, "contentKeys", s.ContentKeys) @@ -7569,7 +7569,7 @@ func (s *StreamingLocatorProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type StreamingPath. func (s StreamingPath) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "encryptionScheme", s.EncryptionScheme) populate(objectMap, "paths", s.Paths) populate(objectMap, "streamingProtocol", s.StreamingProtocol) @@ -7604,7 +7604,7 @@ func (s *StreamingPath) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type StreamingPolicy. func (s StreamingPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) @@ -7647,7 +7647,7 @@ func (s *StreamingPolicy) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type StreamingPolicyCollection. func (s StreamingPolicyCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "@odata.nextLink", s.ODataNextLink) populate(objectMap, "value", s.Value) return json.Marshal(objectMap) @@ -7678,7 +7678,7 @@ func (s *StreamingPolicyCollection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type StreamingPolicyContentKey. func (s StreamingPolicyContentKey) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "label", s.Label) populate(objectMap, "policyName", s.PolicyName) populate(objectMap, "tracks", s.Tracks) @@ -7713,7 +7713,7 @@ func (s *StreamingPolicyContentKey) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type StreamingPolicyContentKeys. func (s StreamingPolicyContentKeys) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "defaultKey", s.DefaultKey) populate(objectMap, "keyToTrackMappings", s.KeyToTrackMappings) return json.Marshal(objectMap) @@ -7744,7 +7744,7 @@ func (s *StreamingPolicyContentKeys) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type StreamingPolicyFairPlayConfiguration. func (s StreamingPolicyFairPlayConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "allowPersistentLicense", s.AllowPersistentLicense) populate(objectMap, "customLicenseAcquisitionUrlTemplate", s.CustomLicenseAcquisitionURLTemplate) return json.Marshal(objectMap) @@ -7775,7 +7775,7 @@ func (s *StreamingPolicyFairPlayConfiguration) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type StreamingPolicyPlayReadyConfiguration. func (s StreamingPolicyPlayReadyConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "customLicenseAcquisitionUrlTemplate", s.CustomLicenseAcquisitionURLTemplate) populate(objectMap, "playReadyCustomAttributes", s.PlayReadyCustomAttributes) return json.Marshal(objectMap) @@ -7806,7 +7806,7 @@ func (s *StreamingPolicyPlayReadyConfiguration) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type StreamingPolicyProperties. func (s StreamingPolicyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "commonEncryptionCbcs", s.CommonEncryptionCbcs) populate(objectMap, "commonEncryptionCenc", s.CommonEncryptionCenc) populateTimeRFC3339(objectMap, "created", s.Created) @@ -7853,7 +7853,7 @@ func (s *StreamingPolicyProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type StreamingPolicyWidevineConfiguration. func (s StreamingPolicyWidevineConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "customLicenseAcquisitionUrlTemplate", s.CustomLicenseAcquisitionURLTemplate) return json.Marshal(objectMap) } @@ -7880,7 +7880,7 @@ func (s *StreamingPolicyWidevineConfiguration) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type SyncStorageKeysInput. func (s SyncStorageKeysInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", s.ID) return json.Marshal(objectMap) } @@ -7907,7 +7907,7 @@ func (s *SyncStorageKeysInput) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SystemData. func (s SystemData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) populate(objectMap, "createdBy", s.CreatedBy) populate(objectMap, "createdByType", s.CreatedByType) @@ -7954,7 +7954,7 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TextTrack. func (t TextTrack) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "displayName", t.DisplayName) populate(objectMap, "fileName", t.FileName) populate(objectMap, "hlsSettings", t.HlsSettings) @@ -8001,7 +8001,7 @@ func (t *TextTrack) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TrackBase. func (t TrackBase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["@odata.type"] = t.ODataType return json.Marshal(objectMap) } @@ -8028,7 +8028,7 @@ func (t *TrackBase) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TrackDescriptor. func (t TrackDescriptor) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["@odata.type"] = t.ODataType return json.Marshal(objectMap) } @@ -8055,7 +8055,7 @@ func (t *TrackDescriptor) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TrackPropertyCondition. func (t TrackPropertyCondition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "operation", t.Operation) populate(objectMap, "property", t.Property) populate(objectMap, "value", t.Value) @@ -8090,7 +8090,7 @@ func (t *TrackPropertyCondition) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TrackSelection. func (t TrackSelection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "trackSelections", t.TrackSelections) return json.Marshal(objectMap) } @@ -8117,7 +8117,7 @@ func (t *TrackSelection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TrackedResource. func (t TrackedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", t.ID) populate(objectMap, "location", t.Location) populate(objectMap, "name", t.Name) @@ -8160,7 +8160,7 @@ func (t *TrackedResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Transform. func (t Transform) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", t.ID) populate(objectMap, "name", t.Name) populate(objectMap, "properties", t.Properties) @@ -8203,7 +8203,7 @@ func (t *Transform) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TransformCollection. func (t TransformCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "@odata.nextLink", t.ODataNextLink) populate(objectMap, "value", t.Value) return json.Marshal(objectMap) @@ -8234,7 +8234,7 @@ func (t *TransformCollection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TransformOutput. func (t TransformOutput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "onError", t.OnError) populate(objectMap, "preset", t.Preset) populate(objectMap, "relativePriority", t.RelativePriority) @@ -8269,7 +8269,7 @@ func (t *TransformOutput) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TransformProperties. func (t TransformProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "created", t.Created) populate(objectMap, "description", t.Description) populateTimeRFC3339(objectMap, "lastModified", t.LastModified) @@ -8308,7 +8308,7 @@ func (t *TransformProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TransportStreamFormat. func (t TransportStreamFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "filenamePattern", t.FilenamePattern) objectMap["@odata.type"] = "#Microsoft.Media.TransportStreamFormat" populate(objectMap, "outputFiles", t.OutputFiles) @@ -8343,7 +8343,7 @@ func (t *TransportStreamFormat) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type UTCClipTime. func (u UTCClipTime) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["@odata.type"] = "#Microsoft.Media.UtcClipTime" populateTimeRFC3339(objectMap, "time", u.Time) return json.Marshal(objectMap) @@ -8374,7 +8374,7 @@ func (u *UTCClipTime) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type UserAssignedManagedIdentity. func (u UserAssignedManagedIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "clientId", u.ClientID) populate(objectMap, "principalId", u.PrincipalID) return json.Marshal(objectMap) @@ -8405,7 +8405,7 @@ func (u *UserAssignedManagedIdentity) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Video. func (v Video) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "keyFrameInterval", v.KeyFrameInterval) populate(objectMap, "label", v.Label) objectMap["@odata.type"] = "#Microsoft.Media.Video" @@ -8448,7 +8448,7 @@ func (v *Video) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VideoAnalyzerPreset. func (v VideoAnalyzerPreset) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "audioLanguage", v.AudioLanguage) populate(objectMap, "experimentalOptions", v.ExperimentalOptions) populate(objectMap, "insightsToExtract", v.InsightsToExtract) @@ -8491,7 +8491,7 @@ func (v *VideoAnalyzerPreset) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VideoLayer. func (v VideoLayer) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "adaptiveBFrame", v.AdaptiveBFrame) populate(objectMap, "bFrames", v.BFrames) populate(objectMap, "bitrate", v.Bitrate) @@ -8550,7 +8550,7 @@ func (v *VideoLayer) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VideoOverlay. func (v VideoOverlay) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "audioGainLevel", v.AudioGainLevel) populate(objectMap, "cropRectangle", v.CropRectangle) populate(objectMap, "end", v.End) @@ -8613,7 +8613,7 @@ func (v *VideoOverlay) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VideoTrack. func (v VideoTrack) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["@odata.type"] = "#Microsoft.Media.VideoTrack" return json.Marshal(objectMap) } @@ -8640,7 +8640,7 @@ func (v *VideoTrack) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VideoTrackDescriptor. func (v VideoTrackDescriptor) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["@odata.type"] = "#Microsoft.Media.VideoTrackDescriptor" return json.Marshal(objectMap) } @@ -8665,7 +8665,7 @@ func (v *VideoTrackDescriptor) UnmarshalJSON(data []byte) error { return nil } -func populate(m map[string]interface{}, k string, v interface{}) { +func populate(m map[string]any, k string, v any) { if v == nil { return } else if azcore.IsNullValue(v) { @@ -8675,7 +8675,7 @@ func populate(m map[string]interface{}, k string, v interface{}) { } } -func populateByteArray(m map[string]interface{}, k string, b []byte, f runtime.Base64Encoding) { +func populateByteArray(m map[string]any, k string, b []byte, f runtime.Base64Encoding) { if azcore.IsNullValue(b) { m[k] = nil } else if len(b) == 0 { @@ -8685,7 +8685,7 @@ func populateByteArray(m map[string]interface{}, k string, b []byte, f runtime.B } } -func unpopulate(data json.RawMessage, fn string, v interface{}) error { +func unpopulate(data json.RawMessage, fn string, v any) error { if data == nil { return nil } diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/operationresults_client.go b/sdk/resourcemanager/mediaservices/armmediaservices/operationresults_client.go index 1043f7a43456..d92efc870fe7 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/operationresults_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/operationresults_client.go @@ -33,9 +33,9 @@ type OperationResultsClient struct { } // NewOperationResultsClient creates a new instance of OperationResultsClient with the specified values. -// subscriptionID - The unique identifier for a Microsoft Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The unique identifier for a Microsoft Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewOperationResultsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationResultsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,10 +58,11 @@ func NewOperationResultsClient(subscriptionID string, credential azcore.TokenCre // Get - Get media service operation result. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-11-01 -// locationName - Location name. -// operationID - Operation Id. -// options - OperationResultsClientGetOptions contains the optional parameters for the OperationResultsClient.Get method. +// - locationName - Location name. +// - operationID - Operation Id. +// - options - OperationResultsClientGetOptions contains the optional parameters for the OperationResultsClient.Get method. func (client *OperationResultsClient) Get(ctx context.Context, locationName string, operationID string, options *OperationResultsClientGetOptions) (OperationResultsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, locationName, operationID, options) if err != nil { diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/operationresults_client_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/operationresults_client_example_test.go deleted file mode 100644 index 8ab00c234519..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/operationresults_client_example_test.go +++ /dev/null @@ -1,36 +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/Accounts/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/operations_client.go b/sdk/resourcemanager/mediaservices/armmediaservices/operations_client.go index cf671eab811e..1cbe2644a404 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/operations_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/operations_client.go @@ -28,8 +28,8 @@ type OperationsClient struct { } // NewOperationsClient creates a new instance of OperationsClient with the specified values. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -51,8 +51,9 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // List - Lists all the Media Services operations. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-11-01 -// options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +// - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. func (client *OperationsClient) List(ctx context.Context, options *OperationsClientListOptions) (OperationsClientListResponse, error) { req, err := client.listCreateRequest(ctx, options) if err != nil { 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 2c50a656f256..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/operations_client_example_test.go +++ /dev/null @@ -1,36 +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/Accounts/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/operationstatuses_client.go b/sdk/resourcemanager/mediaservices/armmediaservices/operationstatuses_client.go index 6ca002166d82..7e30d2a83616 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/operationstatuses_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/operationstatuses_client.go @@ -32,9 +32,9 @@ type OperationStatusesClient struct { } // NewOperationStatusesClient creates a new instance of OperationStatusesClient with the specified values. -// subscriptionID - The unique identifier for a Microsoft Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The unique identifier for a Microsoft Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewOperationStatusesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationStatusesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,10 +57,11 @@ func NewOperationStatusesClient(subscriptionID string, credential azcore.TokenCr // Get - Get media service operation status. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-11-01 -// locationName - Location name. -// operationID - Operation ID. -// options - OperationStatusesClientGetOptions contains the optional parameters for the OperationStatusesClient.Get method. +// - locationName - Location name. +// - operationID - Operation ID. +// - options - OperationStatusesClientGetOptions contains the optional parameters for the OperationStatusesClient.Get method. func (client *OperationStatusesClient) Get(ctx context.Context, locationName string, operationID string, options *OperationStatusesClientGetOptions) (OperationStatusesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, locationName, operationID, options) if err != nil { diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/operationstatuses_client_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/operationstatuses_client_example_test.go deleted file mode 100644 index 935c52436b0b..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/operationstatuses_client_example_test.go +++ /dev/null @@ -1,74 +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/Accounts/stable/2021-11-01/examples/media-service-operation-status-by-id-non-terminal-state-failed.json -func ExampleOperationStatusesClient_Get_getStatusOfAsynchronousOperationWhenItIsCompletedWithError() { - 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 -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/media-service-operation-status-by-id-terminal-state.json -func ExampleOperationStatusesClient_Get_getStatusOfAsynchronousOperationWhenItIsCompleted() { - 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 -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/media-service-operation-status-by-id-non-terminal-state.json -func ExampleOperationStatusesClient_Get_getStatusOfAsynchronousOperationWhenItIsOngoing() { - 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/polymorphic_helpers.go b/sdk/resourcemanager/mediaservices/armmediaservices/polymorphic_helpers.go index bcdcadcdf0ba..e3470ba0c25f 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/polymorphic_helpers.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/polymorphic_helpers.go @@ -15,7 +15,7 @@ func unmarshalClipTimeClassification(rawMsg json.RawMessage) (ClipTimeClassifica if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -35,7 +35,7 @@ func unmarshalCodecClassification(rawMsg json.RawMessage) (CodecClassification, if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -92,7 +92,7 @@ func unmarshalContentKeyPolicyConfigurationClassification(rawMsg json.RawMessage if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -118,7 +118,7 @@ func unmarshalContentKeyPolicyPlayReadyContentKeyLocationClassification(rawMsg j if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -138,7 +138,7 @@ func unmarshalContentKeyPolicyRestrictionClassification(rawMsg json.RawMessage) if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -160,7 +160,7 @@ func unmarshalContentKeyPolicyRestrictionTokenKeyClassification(rawMsg json.RawM if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -201,7 +201,7 @@ func unmarshalFormatClassification(rawMsg json.RawMessage) (FormatClassification if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -248,7 +248,7 @@ func unmarshalInputDefinitionClassification(rawMsg json.RawMessage) (InputDefini if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -289,7 +289,7 @@ func unmarshalJobInputClassification(rawMsg json.RawMessage) (JobInputClassifica if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -334,7 +334,7 @@ func unmarshalJobInputClipClassification(rawMsg json.RawMessage) (JobInputClipCl if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -373,7 +373,7 @@ func unmarshalJobOutputClassification(rawMsg json.RawMessage) (JobOutputClassifi if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -410,7 +410,7 @@ func unmarshalOverlayClassification(rawMsg json.RawMessage) (OverlayClassificati if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -449,7 +449,7 @@ func unmarshalPresetClassification(rawMsg json.RawMessage) (PresetClassification if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -475,7 +475,7 @@ func unmarshalTrackBaseClassification(rawMsg json.RawMessage) (TrackBaseClassifi if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -497,7 +497,7 @@ func unmarshalTrackDescriptorClassification(rawMsg json.RawMessage) (TrackDescri if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/privateendpointconnections_client.go b/sdk/resourcemanager/mediaservices/armmediaservices/privateendpointconnections_client.go index ae9b799cf989..5eaf9a2191ce 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/privateendpointconnections_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/privateendpointconnections_client.go @@ -32,9 +32,9 @@ type PrivateEndpointConnectionsClient struct { } // NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient with the specified values. -// subscriptionID - The unique identifier for a Microsoft Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The unique identifier for a Microsoft Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateEndpointConnectionsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,12 +57,13 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor // CreateOrUpdate - Update an existing private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-11-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// parameters - The request parameters -// options - PrivateEndpointConnectionsClientCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.CreateOrUpdate -// method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - parameters - The request parameters +// - options - PrivateEndpointConnectionsClientCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.CreateOrUpdate +// method. func (client *PrivateEndpointConnectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, name string, parameters PrivateEndpointConnection, options *PrivateEndpointConnectionsClientCreateOrUpdateOptions) (PrivateEndpointConnectionsClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, accountName, name, parameters, options) if err != nil { @@ -119,11 +120,12 @@ func (client *PrivateEndpointConnectionsClient) createOrUpdateHandleResponse(res // Delete - Deletes a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-11-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// options - PrivateEndpointConnectionsClientDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Delete -// method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - options - PrivateEndpointConnectionsClientDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Delete +// method. func (client *PrivateEndpointConnectionsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, name string, options *PrivateEndpointConnectionsClientDeleteOptions) (PrivateEndpointConnectionsClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, name, options) if err != nil { @@ -171,11 +173,12 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. // Get - Get the details of a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-11-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// options - PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get -// method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - options - PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get +// method. func (client *PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, accountName string, name string, options *PrivateEndpointConnectionsClientGetOptions) (PrivateEndpointConnectionsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, name, options) if err != nil { @@ -232,11 +235,12 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res // List - List all private endpoint connections. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-11-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// options - PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.List -// method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - options - PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.List +// method. func (client *PrivateEndpointConnectionsClient) List(ctx context.Context, resourceGroupName string, accountName string, options *PrivateEndpointConnectionsClientListOptions) (PrivateEndpointConnectionsClientListResponse, error) { req, err := client.listCreateRequest(ctx, resourceGroupName, accountName, options) if err != nil { 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 9d381023b814..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/privateendpointconnections_client_example_test.go +++ /dev/null @@ -1,99 +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/Accounts/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/Accounts/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/Accounts/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/Accounts/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.go b/sdk/resourcemanager/mediaservices/armmediaservices/privatelinkresources_client.go index e1d229b57a36..43e3a7ab0091 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/privatelinkresources_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/privatelinkresources_client.go @@ -32,9 +32,9 @@ type PrivateLinkResourcesClient struct { } // NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient with the specified values. -// subscriptionID - The unique identifier for a Microsoft Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The unique identifier for a Microsoft Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateLinkResourcesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,11 +57,12 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke // Get - Get details of a group ID. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-11-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// options - PrivateLinkResourcesClientGetOptions contains the optional parameters for the PrivateLinkResourcesClient.Get -// method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - options - PrivateLinkResourcesClientGetOptions contains the optional parameters for the PrivateLinkResourcesClient.Get +// method. func (client *PrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupName string, accountName string, name string, options *PrivateLinkResourcesClientGetOptions) (PrivateLinkResourcesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, name, options) if err != nil { @@ -118,11 +119,12 @@ func (client *PrivateLinkResourcesClient) getHandleResponse(resp *http.Response) // List - List supported group IDs. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-11-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// options - PrivateLinkResourcesClientListOptions contains the optional parameters for the PrivateLinkResourcesClient.List -// method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - options - PrivateLinkResourcesClientListOptions contains the optional parameters for the PrivateLinkResourcesClient.List +// method. func (client *PrivateLinkResourcesClient) List(ctx context.Context, resourceGroupName string, accountName string, options *PrivateLinkResourcesClientListOptions) (PrivateLinkResourcesClientListResponse, error) { req, err := client.listCreateRequest(ctx, resourceGroupName, accountName, options) if err != nil { 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 32a45193f436..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/privatelinkresources_client_example_test.go +++ /dev/null @@ -1,55 +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/Accounts/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/Accounts/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 273d19f7ce2a..38562b825790 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/response_types.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/response_types.go @@ -24,7 +24,7 @@ type AccountFiltersClientGetResponse struct { AccountFilter } -// AccountFiltersClientListResponse contains the response from method AccountFiltersClient.List. +// AccountFiltersClientListResponse contains the response from method AccountFiltersClient.NewListPager. type AccountFiltersClientListResponse struct { AccountFilterCollection } @@ -49,7 +49,7 @@ type AssetFiltersClientGetResponse struct { AssetFilter } -// AssetFiltersClientListResponse contains the response from method AssetFiltersClient.List. +// AssetFiltersClientListResponse contains the response from method AssetFiltersClient.NewListPager. type AssetFiltersClientListResponse struct { AssetFilterCollection } @@ -102,7 +102,7 @@ type AssetsClientListContainerSasResponse struct { AssetContainerSas } -// AssetsClientListResponse contains the response from method AssetsClient.List. +// AssetsClientListResponse contains the response from method AssetsClient.NewListPager. type AssetsClientListResponse struct { AssetCollection } @@ -117,7 +117,7 @@ type AssetsClientUpdateResponse struct { Asset } -// ClientCreateOrUpdateResponse contains the response from method Client.CreateOrUpdate. +// ClientCreateOrUpdateResponse contains the response from method Client.BeginCreateOrUpdate. type ClientCreateOrUpdateResponse struct { MediaService } @@ -132,7 +132,7 @@ type ClientGetResponse struct { MediaService } -// ClientListBySubscriptionResponse contains the response from method Client.ListBySubscription. +// ClientListBySubscriptionResponse contains the response from method Client.NewListBySubscriptionPager. type ClientListBySubscriptionResponse struct { MediaServiceCollection } @@ -142,7 +142,7 @@ type ClientListEdgePoliciesResponse struct { EdgePolicies } -// ClientListResponse contains the response from method Client.List. +// ClientListResponse contains the response from method Client.NewListPager. type ClientListResponse struct { MediaServiceCollection } @@ -152,7 +152,7 @@ type ClientSyncStorageKeysResponse struct { // placeholder for future response values } -// ClientUpdateResponse contains the response from method Client.Update. +// ClientUpdateResponse contains the response from method Client.BeginUpdate. type ClientUpdateResponse struct { MediaService } @@ -177,7 +177,7 @@ type ContentKeyPoliciesClientGetResponse struct { ContentKeyPolicy } -// ContentKeyPoliciesClientListResponse contains the response from method ContentKeyPoliciesClient.List. +// ContentKeyPoliciesClientListResponse contains the response from method ContentKeyPoliciesClient.NewListPager. type ContentKeyPoliciesClientListResponse struct { ContentKeyPolicyCollection } @@ -207,7 +207,7 @@ type JobsClientGetResponse struct { Job } -// JobsClientListResponse contains the response from method JobsClient.List. +// JobsClientListResponse contains the response from method JobsClient.NewListPager. type JobsClientListResponse struct { JobCollection } @@ -217,7 +217,7 @@ type JobsClientUpdateResponse struct { Job } -// LiveEventsClientAllocateResponse contains the response from method LiveEventsClient.Allocate. +// LiveEventsClientAllocateResponse contains the response from method LiveEventsClient.BeginAllocate. type LiveEventsClientAllocateResponse struct { // placeholder for future response values } @@ -227,12 +227,12 @@ type LiveEventsClientAsyncOperationResponse struct { AsyncOperationResult } -// LiveEventsClientCreateResponse contains the response from method LiveEventsClient.Create. +// LiveEventsClientCreateResponse contains the response from method LiveEventsClient.BeginCreate. type LiveEventsClientCreateResponse struct { LiveEvent } -// LiveEventsClientDeleteResponse contains the response from method LiveEventsClient.Delete. +// LiveEventsClientDeleteResponse contains the response from method LiveEventsClient.BeginDelete. type LiveEventsClientDeleteResponse struct { // placeholder for future response values } @@ -242,7 +242,7 @@ type LiveEventsClientGetResponse struct { LiveEvent } -// LiveEventsClientListResponse contains the response from method LiveEventsClient.List. +// LiveEventsClientListResponse contains the response from method LiveEventsClient.NewListPager. type LiveEventsClientListResponse struct { LiveEventListResult } @@ -252,22 +252,22 @@ type LiveEventsClientOperationLocationResponse struct { LiveEvent } -// LiveEventsClientResetResponse contains the response from method LiveEventsClient.Reset. +// LiveEventsClientResetResponse contains the response from method LiveEventsClient.BeginReset. type LiveEventsClientResetResponse struct { // placeholder for future response values } -// LiveEventsClientStartResponse contains the response from method LiveEventsClient.Start. +// LiveEventsClientStartResponse contains the response from method LiveEventsClient.BeginStart. type LiveEventsClientStartResponse struct { // placeholder for future response values } -// LiveEventsClientStopResponse contains the response from method LiveEventsClient.Stop. +// LiveEventsClientStopResponse contains the response from method LiveEventsClient.BeginStop. type LiveEventsClientStopResponse struct { // placeholder for future response values } -// LiveEventsClientUpdateResponse contains the response from method LiveEventsClient.Update. +// LiveEventsClientUpdateResponse contains the response from method LiveEventsClient.BeginUpdate. type LiveEventsClientUpdateResponse struct { LiveEvent } @@ -277,12 +277,12 @@ type LiveOutputsClientAsyncOperationResponse struct { AsyncOperationResult } -// LiveOutputsClientCreateResponse contains the response from method LiveOutputsClient.Create. +// LiveOutputsClientCreateResponse contains the response from method LiveOutputsClient.BeginCreate. type LiveOutputsClientCreateResponse struct { LiveOutput } -// LiveOutputsClientDeleteResponse contains the response from method LiveOutputsClient.Delete. +// LiveOutputsClientDeleteResponse contains the response from method LiveOutputsClient.BeginDelete. type LiveOutputsClientDeleteResponse struct { // placeholder for future response values } @@ -292,7 +292,7 @@ type LiveOutputsClientGetResponse struct { LiveOutput } -// LiveOutputsClientListResponse contains the response from method LiveOutputsClient.List. +// LiveOutputsClientListResponse contains the response from method LiveOutputsClient.NewListPager. type LiveOutputsClientListResponse struct { LiveOutputListResult } @@ -365,12 +365,12 @@ type StreamingEndpointsClientAsyncOperationResponse struct { AsyncOperationResult } -// StreamingEndpointsClientCreateResponse contains the response from method StreamingEndpointsClient.Create. +// StreamingEndpointsClientCreateResponse contains the response from method StreamingEndpointsClient.BeginCreate. type StreamingEndpointsClientCreateResponse struct { StreamingEndpoint } -// StreamingEndpointsClientDeleteResponse contains the response from method StreamingEndpointsClient.Delete. +// StreamingEndpointsClientDeleteResponse contains the response from method StreamingEndpointsClient.BeginDelete. type StreamingEndpointsClientDeleteResponse struct { // placeholder for future response values } @@ -380,7 +380,7 @@ type StreamingEndpointsClientGetResponse struct { StreamingEndpoint } -// StreamingEndpointsClientListResponse contains the response from method StreamingEndpointsClient.List. +// StreamingEndpointsClientListResponse contains the response from method StreamingEndpointsClient.NewListPager. type StreamingEndpointsClientListResponse struct { StreamingEndpointListResult } @@ -395,22 +395,22 @@ type StreamingEndpointsClientSKUsResponse struct { StreamingEndpointSKUInfoListResult } -// StreamingEndpointsClientScaleResponse contains the response from method StreamingEndpointsClient.Scale. +// StreamingEndpointsClientScaleResponse contains the response from method StreamingEndpointsClient.BeginScale. type StreamingEndpointsClientScaleResponse struct { // placeholder for future response values } -// StreamingEndpointsClientStartResponse contains the response from method StreamingEndpointsClient.Start. +// StreamingEndpointsClientStartResponse contains the response from method StreamingEndpointsClient.BeginStart. type StreamingEndpointsClientStartResponse struct { // placeholder for future response values } -// StreamingEndpointsClientStopResponse contains the response from method StreamingEndpointsClient.Stop. +// StreamingEndpointsClientStopResponse contains the response from method StreamingEndpointsClient.BeginStop. type StreamingEndpointsClientStopResponse struct { // placeholder for future response values } -// StreamingEndpointsClientUpdateResponse contains the response from method StreamingEndpointsClient.Update. +// StreamingEndpointsClientUpdateResponse contains the response from method StreamingEndpointsClient.BeginUpdate. type StreamingEndpointsClientUpdateResponse struct { StreamingEndpoint } @@ -440,7 +440,7 @@ type StreamingLocatorsClientListPathsResponse struct { ListPathsResponse } -// StreamingLocatorsClientListResponse contains the response from method StreamingLocatorsClient.List. +// StreamingLocatorsClientListResponse contains the response from method StreamingLocatorsClient.NewListPager. type StreamingLocatorsClientListResponse struct { StreamingLocatorCollection } @@ -460,17 +460,17 @@ type StreamingPoliciesClientGetResponse struct { StreamingPolicy } -// StreamingPoliciesClientListResponse contains the response from method StreamingPoliciesClient.List. +// StreamingPoliciesClientListResponse contains the response from method StreamingPoliciesClient.NewListPager. type StreamingPoliciesClientListResponse struct { StreamingPolicyCollection } -// TracksClientCreateOrUpdateResponse contains the response from method TracksClient.CreateOrUpdate. +// TracksClientCreateOrUpdateResponse contains the response from method TracksClient.BeginCreateOrUpdate. type TracksClientCreateOrUpdateResponse struct { AssetTrack } -// TracksClientDeleteResponse contains the response from method TracksClient.Delete. +// TracksClientDeleteResponse contains the response from method TracksClient.BeginDelete. type TracksClientDeleteResponse struct { // placeholder for future response values } @@ -480,17 +480,17 @@ type TracksClientGetResponse struct { AssetTrack } -// TracksClientListResponse contains the response from method TracksClient.List. +// TracksClientListResponse contains the response from method TracksClient.NewListPager. type TracksClientListResponse struct { AssetTrackCollection } -// TracksClientUpdateResponse contains the response from method TracksClient.Update. +// TracksClientUpdateResponse contains the response from method TracksClient.BeginUpdate. type TracksClientUpdateResponse struct { AssetTrack } -// TracksClientUpdateTrackDataResponse contains the response from method TracksClient.UpdateTrackData. +// TracksClientUpdateTrackDataResponse contains the response from method TracksClient.BeginUpdateTrackData. type TracksClientUpdateTrackDataResponse struct { // placeholder for future response values } @@ -510,7 +510,7 @@ type TransformsClientGetResponse struct { Transform } -// TransformsClientListResponse contains the response from method TransformsClient.List. +// TransformsClientListResponse contains the response from method TransformsClient.NewListPager. type TransformsClientListResponse struct { TransformCollection } diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/streamingendpoints_client.go b/sdk/resourcemanager/mediaservices/armmediaservices/streamingendpoints_client.go index 67be18e4854d..932da9a52017 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/streamingendpoints_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/streamingendpoints_client.go @@ -33,9 +33,9 @@ type StreamingEndpointsClient struct { } // NewStreamingEndpointsClient creates a new instance of StreamingEndpointsClient with the specified values. -// subscriptionID - The unique identifier for a Microsoft Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The unique identifier for a Microsoft Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewStreamingEndpointsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*StreamingEndpointsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,12 +58,13 @@ func NewStreamingEndpointsClient(subscriptionID string, credential azcore.TokenC // 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. +// - 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 { @@ -120,13 +121,14 @@ func (client *StreamingEndpointsClient) asyncOperationHandleResponse(resp *http. // BeginCreate - Creates a streaming endpoint. // 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. -// parameters - Streaming endpoint properties needed for creation. -// options - StreamingEndpointsClientBeginCreateOptions contains the optional parameters for the StreamingEndpointsClient.BeginCreate -// method. +// - 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. +// - parameters - Streaming endpoint properties needed for creation. +// - options - StreamingEndpointsClientBeginCreateOptions contains the optional parameters for the StreamingEndpointsClient.BeginCreate +// method. func (client *StreamingEndpointsClient) BeginCreate(ctx context.Context, resourceGroupName string, accountName string, streamingEndpointName string, parameters StreamingEndpoint, options *StreamingEndpointsClientBeginCreateOptions) (*runtime.Poller[StreamingEndpointsClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.create(ctx, resourceGroupName, accountName, streamingEndpointName, parameters, options) @@ -141,6 +143,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 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) @@ -192,12 +195,13 @@ 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 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. -// options - StreamingEndpointsClientBeginDeleteOptions contains the optional parameters for the StreamingEndpointsClient.BeginDelete -// method. +// - 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. +// - options - StreamingEndpointsClientBeginDeleteOptions contains the optional parameters for the StreamingEndpointsClient.BeginDelete +// method. func (client *StreamingEndpointsClient) BeginDelete(ctx context.Context, resourceGroupName string, accountName string, streamingEndpointName string, options *StreamingEndpointsClientBeginDeleteOptions) (*runtime.Poller[StreamingEndpointsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, accountName, streamingEndpointName, options) @@ -212,6 +216,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 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) @@ -260,11 +265,12 @@ 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 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. -// options - StreamingEndpointsClientGetOptions contains the optional parameters for the StreamingEndpointsClient.Get method. +// - 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. +// - options - StreamingEndpointsClientGetOptions contains the optional parameters for the StreamingEndpointsClient.Get method. func (client *StreamingEndpointsClient) Get(ctx context.Context, resourceGroupName string, accountName string, streamingEndpointName string, options *StreamingEndpointsClientGetOptions) (StreamingEndpointsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, streamingEndpointName, options) if err != nil { @@ -320,10 +326,12 @@ func (client *StreamingEndpointsClient) getHandleResponse(resp *http.Response) ( } // NewListPager - Lists the streaming endpoints in the account. +// // 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. +// - 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.NewListPager +// method. func (client *StreamingEndpointsClient) NewListPager(resourceGroupName string, accountName string, options *StreamingEndpointsClientListOptions) *runtime.Pager[StreamingEndpointsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[StreamingEndpointsClientListResponse]{ More: func(page StreamingEndpointsClientListResponse) bool { @@ -389,13 +397,14 @@ func (client *StreamingEndpointsClient) listHandleResponse(resp *http.Response) // 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. +// - 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 { @@ -456,11 +465,12 @@ func (client *StreamingEndpointsClient) operationLocationHandleResponse(resp *ht // SKUs - List streaming endpoint supported skus. // 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. -// options - StreamingEndpointsClientSKUsOptions contains the optional parameters for the StreamingEndpointsClient.SKUs method. +// - 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. +// - options - StreamingEndpointsClientSKUsOptions contains the optional parameters for the StreamingEndpointsClient.SKUs method. func (client *StreamingEndpointsClient) SKUs(ctx context.Context, resourceGroupName string, accountName string, streamingEndpointName string, options *StreamingEndpointsClientSKUsOptions) (StreamingEndpointsClientSKUsResponse, error) { req, err := client.skUsCreateRequest(ctx, resourceGroupName, accountName, streamingEndpointName, options) if err != nil { @@ -517,13 +527,14 @@ 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 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. -// parameters - Streaming endpoint scale parameters -// options - StreamingEndpointsClientBeginScaleOptions contains the optional parameters for the StreamingEndpointsClient.BeginScale -// method. +// - 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. +// - parameters - Streaming endpoint scale parameters +// - options - StreamingEndpointsClientBeginScaleOptions contains the optional parameters for the StreamingEndpointsClient.BeginScale +// method. func (client *StreamingEndpointsClient) BeginScale(ctx context.Context, resourceGroupName string, accountName string, streamingEndpointName string, parameters StreamingEntityScaleUnit, options *StreamingEndpointsClientBeginScaleOptions) (*runtime.Poller[StreamingEndpointsClientScaleResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.scale(ctx, resourceGroupName, accountName, streamingEndpointName, parameters, options) @@ -538,6 +549,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 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) @@ -586,12 +598,13 @@ 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 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. -// options - StreamingEndpointsClientBeginStartOptions contains the optional parameters for the StreamingEndpointsClient.BeginStart -// method. +// - 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. +// - options - StreamingEndpointsClientBeginStartOptions contains the optional parameters for the StreamingEndpointsClient.BeginStart +// method. func (client *StreamingEndpointsClient) BeginStart(ctx context.Context, resourceGroupName string, accountName string, streamingEndpointName string, options *StreamingEndpointsClientBeginStartOptions) (*runtime.Poller[StreamingEndpointsClientStartResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.start(ctx, resourceGroupName, accountName, streamingEndpointName, options) @@ -606,6 +619,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 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) @@ -654,12 +668,13 @@ 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 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. -// options - StreamingEndpointsClientBeginStopOptions contains the optional parameters for the StreamingEndpointsClient.BeginStop -// method. +// - 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. +// - options - StreamingEndpointsClientBeginStopOptions contains the optional parameters for the StreamingEndpointsClient.BeginStop +// method. func (client *StreamingEndpointsClient) BeginStop(ctx context.Context, resourceGroupName string, accountName string, streamingEndpointName string, options *StreamingEndpointsClientBeginStopOptions) (*runtime.Poller[StreamingEndpointsClientStopResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.stop(ctx, resourceGroupName, accountName, streamingEndpointName, options) @@ -674,6 +689,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 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) @@ -722,13 +738,14 @@ 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 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. -// parameters - Streaming endpoint properties needed for creation. -// options - StreamingEndpointsClientBeginUpdateOptions contains the optional parameters for the StreamingEndpointsClient.BeginUpdate -// method. +// - 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. +// - parameters - Streaming endpoint properties needed for creation. +// - options - StreamingEndpointsClientBeginUpdateOptions contains the optional parameters for the StreamingEndpointsClient.BeginUpdate +// method. func (client *StreamingEndpointsClient) BeginUpdate(ctx context.Context, resourceGroupName string, accountName string, streamingEndpointName string, parameters StreamingEndpoint, options *StreamingEndpointsClientBeginUpdateOptions) (*runtime.Poller[StreamingEndpointsClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, accountName, streamingEndpointName, parameters, options) @@ -743,6 +760,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 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) 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 176d84a6b0de..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/streamingendpoints_client_example_test.go +++ /dev/null @@ -1,297 +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/Streaming/stable/2022-08-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/Streaming/stable/2022-08-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/Streaming/stable/2022-08-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/Streaming/stable/2022-08-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/Streaming/stable/2022-08-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/Streaming/stable/2022-08-01/examples/streamingendpoint-list-skus.json -func ExampleStreamingEndpointsClient_SKUs() { - 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.SKUs(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/Streaming/stable/2022-08-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/Streaming/stable/2022-08-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/Streaming/stable/2022-08-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) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/async-operation-result.json -func ExampleStreamingEndpointsClient_AsyncOperation() { - 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.AsyncOperation(ctx, "mediaresources", "slitestmedia10", "62e4d893-d233-4005-988e-a428d9f77076", 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/Streaming/stable/2022-08-01/examples/streamingendpoint-operation-location.json -func ExampleStreamingEndpointsClient_OperationLocation() { - 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.OperationLocation(ctx, "mediaresources", "slitestmedia10", "myStreamingEndpoint1", "62e4d893-d233-4005-988e-a428d9f77076", 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/streaminglocators_client.go b/sdk/resourcemanager/mediaservices/armmediaservices/streaminglocators_client.go index 28451c258e26..922c71c0732c 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/streaminglocators_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/streaminglocators_client.go @@ -33,9 +33,9 @@ type StreamingLocatorsClient struct { } // NewStreamingLocatorsClient creates a new instance of StreamingLocatorsClient with the specified values. -// subscriptionID - The unique identifier for a Microsoft Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The unique identifier for a Microsoft Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewStreamingLocatorsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*StreamingLocatorsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,13 +58,14 @@ 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 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. -// parameters - The request parameters -// options - StreamingLocatorsClientCreateOptions contains the optional parameters for the StreamingLocatorsClient.Create -// method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - streamingLocatorName - The Streaming Locator name. +// - parameters - The request parameters +// - options - StreamingLocatorsClientCreateOptions contains the optional parameters for the StreamingLocatorsClient.Create +// method. func (client *StreamingLocatorsClient) Create(ctx context.Context, resourceGroupName string, accountName string, streamingLocatorName string, parameters StreamingLocator, options *StreamingLocatorsClientCreateOptions) (StreamingLocatorsClientCreateResponse, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, accountName, streamingLocatorName, parameters, options) if err != nil { @@ -121,12 +122,13 @@ 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 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. -// options - StreamingLocatorsClientDeleteOptions contains the optional parameters for the StreamingLocatorsClient.Delete -// method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - streamingLocatorName - The Streaming Locator name. +// - options - StreamingLocatorsClientDeleteOptions contains the optional parameters for the StreamingLocatorsClient.Delete +// method. func (client *StreamingLocatorsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, streamingLocatorName string, options *StreamingLocatorsClientDeleteOptions) (StreamingLocatorsClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, streamingLocatorName, options) if err != nil { @@ -174,11 +176,12 @@ 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 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. -// options - StreamingLocatorsClientGetOptions contains the optional parameters for the StreamingLocatorsClient.Get method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - streamingLocatorName - The Streaming Locator name. +// - options - StreamingLocatorsClientGetOptions contains the optional parameters for the StreamingLocatorsClient.Get method. func (client *StreamingLocatorsClient) Get(ctx context.Context, resourceGroupName string, accountName string, streamingLocatorName string, options *StreamingLocatorsClientGetOptions) (StreamingLocatorsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, streamingLocatorName, options) if err != nil { @@ -234,10 +237,12 @@ func (client *StreamingLocatorsClient) getHandleResponse(resp *http.Response) (S } // NewListPager - Lists the Streaming Locators in the account +// // 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. +// - 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.NewListPager +// method. func (client *StreamingLocatorsClient) NewListPager(resourceGroupName string, accountName string, options *StreamingLocatorsClientListOptions) *runtime.Pager[StreamingLocatorsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[StreamingLocatorsClientListResponse]{ More: func(page StreamingLocatorsClientListResponse) bool { @@ -312,12 +317,13 @@ 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 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. -// options - StreamingLocatorsClientListContentKeysOptions contains the optional parameters for the StreamingLocatorsClient.ListContentKeys -// method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - streamingLocatorName - The Streaming Locator name. +// - options - StreamingLocatorsClientListContentKeysOptions contains the optional parameters for the StreamingLocatorsClient.ListContentKeys +// method. func (client *StreamingLocatorsClient) ListContentKeys(ctx context.Context, resourceGroupName string, accountName string, streamingLocatorName string, options *StreamingLocatorsClientListContentKeysOptions) (StreamingLocatorsClientListContentKeysResponse, error) { req, err := client.listContentKeysCreateRequest(ctx, resourceGroupName, accountName, streamingLocatorName, options) if err != nil { @@ -374,12 +380,13 @@ 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 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. -// options - StreamingLocatorsClientListPathsOptions contains the optional parameters for the StreamingLocatorsClient.ListPaths -// method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - streamingLocatorName - The Streaming Locator name. +// - options - StreamingLocatorsClientListPathsOptions contains the optional parameters for the StreamingLocatorsClient.ListPaths +// method. func (client *StreamingLocatorsClient) ListPaths(ctx context.Context, resourceGroupName string, accountName string, streamingLocatorName string, options *StreamingLocatorsClientListPathsOptions) (StreamingLocatorsClientListPathsResponse, error) { req, err := client.listPathsCreateRequest(ctx, resourceGroupName, accountName, streamingLocatorName, options) if err != 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 bfb2a269368f..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/streaminglocators_client_example_test.go +++ /dev/null @@ -1,225 +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/Metadata/stable/2022-08-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/Metadata/stable/2022-08-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/Metadata/stable/2022-08-01/examples/streaming-locators-create-clear.json -func ExampleStreamingLocatorsClient_Create_createsAStreamingLocatorWithClearStreaming() { - 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/Metadata/stable/2022-08-01/examples/streaming-locators-create-secure.json -func ExampleStreamingLocatorsClient_Create_createsAStreamingLocatorWithSecureStreaming() { - 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", "UserCreatedSecureStreamingLocator", armmediaservices.StreamingLocator{ - Properties: &armmediaservices.StreamingLocatorProperties{ - AssetName: to.Ptr("ClimbingMountRainier"), - EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2028-12-31T23:59:59.9999999Z"); return t }()), - StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-01T00:00:00Z"); return t }()), - StreamingPolicyName: to.Ptr("secureStreamingPolicy"), - }, - }, 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/Metadata/stable/2022-08-01/examples/streaming-locators-create-secure-userDefinedContentKeys.json -func ExampleStreamingLocatorsClient_Create_createsAStreamingLocatorWithUserDefinedContentKeys() { - 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", "UserCreatedSecureStreamingLocatorWithUserDefinedContentKeys", armmediaservices.StreamingLocator{ - Properties: &armmediaservices.StreamingLocatorProperties{ - AssetName: to.Ptr("ClimbingMountRainier"), - ContentKeys: []*armmediaservices.StreamingLocatorContentKey{ - { - ID: to.Ptr("60000000-0000-0000-0000-000000000001"), - LabelReferenceInStreamingPolicy: to.Ptr("aesDefaultKey"), - Value: to.Ptr("1UqLohAfWsEGkULYxHjYZg=="), - }, - { - ID: to.Ptr("60000000-0000-0000-0000-000000000004"), - LabelReferenceInStreamingPolicy: to.Ptr("cencDefaultKey"), - Value: to.Ptr("4UqLohAfWsEGkULYxHjYZg=="), - }, - { - ID: to.Ptr("60000000-0000-0000-0000-000000000007"), - LabelReferenceInStreamingPolicy: to.Ptr("cbcsDefaultKey"), - Value: to.Ptr("7UqLohAfWsEGkULYxHjYZg=="), - }}, - StreamingLocatorID: to.Ptr("90000000-0000-0000-0000-00000000000A"), - StreamingPolicyName: to.Ptr("secureStreamingPolicy"), - }, - }, 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/Metadata/stable/2022-08-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/Metadata/stable/2022-08-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/Metadata/stable/2022-08-01/examples/streaming-locators-list-paths-streaming-and-download.json -func ExampleStreamingLocatorsClient_ListPaths_listPathsWhichHasStreamingPathsAndDownloadPaths() { - 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 -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-locators-list-paths-streaming-only.json -func ExampleStreamingLocatorsClient_ListPaths_listPathsWhichHasStreamingPathsOnly() { - 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", "secureStreamingLocator", 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 7ce608bd6d54..295d33f3fc5d 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/streamingpolicies_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/streamingpolicies_client.go @@ -33,9 +33,9 @@ type StreamingPoliciesClient struct { } // NewStreamingPoliciesClient creates a new instance of StreamingPoliciesClient with the specified values. -// subscriptionID - The unique identifier for a Microsoft Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The unique identifier for a Microsoft Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewStreamingPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*StreamingPoliciesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,13 +58,14 @@ 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 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. -// parameters - The request parameters -// options - StreamingPoliciesClientCreateOptions contains the optional parameters for the StreamingPoliciesClient.Create -// method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - streamingPolicyName - The Streaming Policy name. +// - parameters - The request parameters +// - options - StreamingPoliciesClientCreateOptions contains the optional parameters for the StreamingPoliciesClient.Create +// method. func (client *StreamingPoliciesClient) Create(ctx context.Context, resourceGroupName string, accountName string, streamingPolicyName string, parameters StreamingPolicy, options *StreamingPoliciesClientCreateOptions) (StreamingPoliciesClientCreateResponse, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, accountName, streamingPolicyName, parameters, options) if err != nil { @@ -121,12 +122,13 @@ 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 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. -// options - StreamingPoliciesClientDeleteOptions contains the optional parameters for the StreamingPoliciesClient.Delete -// method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - streamingPolicyName - The Streaming Policy name. +// - options - StreamingPoliciesClientDeleteOptions contains the optional parameters for the StreamingPoliciesClient.Delete +// method. func (client *StreamingPoliciesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, streamingPolicyName string, options *StreamingPoliciesClientDeleteOptions) (StreamingPoliciesClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, streamingPolicyName, options) if err != nil { @@ -174,11 +176,12 @@ 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 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. -// options - StreamingPoliciesClientGetOptions contains the optional parameters for the StreamingPoliciesClient.Get method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - streamingPolicyName - The Streaming Policy name. +// - options - StreamingPoliciesClientGetOptions contains the optional parameters for the StreamingPoliciesClient.Get method. func (client *StreamingPoliciesClient) Get(ctx context.Context, resourceGroupName string, accountName string, streamingPolicyName string, options *StreamingPoliciesClientGetOptions) (StreamingPoliciesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, streamingPolicyName, options) if err != nil { @@ -234,10 +237,12 @@ func (client *StreamingPoliciesClient) getHandleResponse(resp *http.Response) (S } // NewListPager - Lists the Streaming Policies in the account +// // 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. +// - 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.NewListPager +// method. func (client *StreamingPoliciesClient) NewListPager(resourceGroupName string, accountName string, options *StreamingPoliciesClientListOptions) *runtime.Pager[StreamingPoliciesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[StreamingPoliciesClientListResponse]{ More: func(page StreamingPoliciesClientListResponse) bool { 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 d389777e5969..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/streamingpolicies_client_example_test.go +++ /dev/null @@ -1,404 +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/Metadata/stable/2022-08-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/Metadata/stable/2022-08-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/Metadata/stable/2022-08-01/examples/streaming-policies-create-commonEncryptionCbcs-clearKeyEncryption.json -func ExampleStreamingPoliciesClient_Create_createsAStreamingPolicyWithClearKeyEncryptionInCommonEncryptionCbcs() { - 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", "UserCreatedSecureStreamingPolicyWithCommonEncryptionCbcsOnly", armmediaservices.StreamingPolicy{ - Properties: &armmediaservices.StreamingPolicyProperties{ - CommonEncryptionCbcs: &armmediaservices.CommonEncryptionCbcs{ - ClearKeyEncryptionConfiguration: &armmediaservices.ClearKeyEncryptionConfiguration{ - CustomKeysAcquisitionURLTemplate: to.Ptr("https://contoso.com/{AlternativeMediaId}/clearkey/"), - }, - ContentKeys: &armmediaservices.StreamingPolicyContentKeys{ - DefaultKey: &armmediaservices.DefaultKey{ - Label: to.Ptr("cbcsDefaultKey"), - }, - }, - EnabledProtocols: &armmediaservices.EnabledProtocols{ - Dash: to.Ptr(false), - Download: to.Ptr(false), - Hls: to.Ptr(true), - SmoothStreaming: to.Ptr(false), - }, - }, - DefaultContentKeyPolicyName: to.Ptr("PolicyWithMultipleOptions"), - }, - }, 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/Metadata/stable/2022-08-01/examples/streaming-policies-create-commonEncryptionCenc-clearKeyEncryption.json -func ExampleStreamingPoliciesClient_Create_createsAStreamingPolicyWithClearKeyEncryptionInCommonEncryptionCenc() { - 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", "UserCreatedSecureStreamingPolicyWithCommonEncryptionCencOnly", armmediaservices.StreamingPolicy{ - Properties: &armmediaservices.StreamingPolicyProperties{ - CommonEncryptionCenc: &armmediaservices.CommonEncryptionCenc{ - ClearKeyEncryptionConfiguration: &armmediaservices.ClearKeyEncryptionConfiguration{ - CustomKeysAcquisitionURLTemplate: to.Ptr("https://contoso.com/{AlternativeMediaId}/clearkey/"), - }, - ClearTracks: []*armmediaservices.TrackSelection{ - { - TrackSelections: []*armmediaservices.TrackPropertyCondition{ - { - Operation: to.Ptr(armmediaservices.TrackPropertyCompareOperationEqual), - Property: to.Ptr(armmediaservices.TrackPropertyTypeFourCC), - Value: to.Ptr("hev1"), - }}, - }}, - ContentKeys: &armmediaservices.StreamingPolicyContentKeys{ - DefaultKey: &armmediaservices.DefaultKey{ - Label: to.Ptr("cencDefaultKey"), - }, - }, - EnabledProtocols: &armmediaservices.EnabledProtocols{ - Dash: to.Ptr(true), - Download: to.Ptr(false), - Hls: to.Ptr(false), - SmoothStreaming: to.Ptr(true), - }, - }, - DefaultContentKeyPolicyName: to.Ptr("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/Metadata/stable/2022-08-01/examples/streaming-policies-create-clear.json -func ExampleStreamingPoliciesClient_Create_createsAStreamingPolicyWithClearStreaming() { - 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/Metadata/stable/2022-08-01/examples/streaming-policies-create-commonEncryptionCbcs-only.json -func ExampleStreamingPoliciesClient_Create_createsAStreamingPolicyWithCommonEncryptionCbcsOnly() { - 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", "UserCreatedSecureStreamingPolicyWithCommonEncryptionCbcsOnly", armmediaservices.StreamingPolicy{ - Properties: &armmediaservices.StreamingPolicyProperties{ - CommonEncryptionCbcs: &armmediaservices.CommonEncryptionCbcs{ - ContentKeys: &armmediaservices.StreamingPolicyContentKeys{ - DefaultKey: &armmediaservices.DefaultKey{ - Label: to.Ptr("cbcsDefaultKey"), - }, - }, - Drm: &armmediaservices.CbcsDrmConfiguration{ - FairPlay: &armmediaservices.StreamingPolicyFairPlayConfiguration{ - AllowPersistentLicense: to.Ptr(true), - CustomLicenseAcquisitionURLTemplate: to.Ptr("https://contoso.com/{AssetAlternativeId}/fairplay/{ContentKeyId}"), - }, - }, - EnabledProtocols: &armmediaservices.EnabledProtocols{ - Dash: to.Ptr(false), - Download: to.Ptr(false), - Hls: to.Ptr(true), - SmoothStreaming: to.Ptr(false), - }, - }, - DefaultContentKeyPolicyName: to.Ptr("PolicyWithMultipleOptions"), - }, - }, 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/Metadata/stable/2022-08-01/examples/streaming-policies-create-commonEncryptionCenc-only.json -func ExampleStreamingPoliciesClient_Create_createsAStreamingPolicyWithCommonEncryptionCencOnly() { - 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", "UserCreatedSecureStreamingPolicyWithCommonEncryptionCencOnly", armmediaservices.StreamingPolicy{ - Properties: &armmediaservices.StreamingPolicyProperties{ - CommonEncryptionCenc: &armmediaservices.CommonEncryptionCenc{ - ClearTracks: []*armmediaservices.TrackSelection{ - { - TrackSelections: []*armmediaservices.TrackPropertyCondition{ - { - Operation: to.Ptr(armmediaservices.TrackPropertyCompareOperationEqual), - Property: to.Ptr(armmediaservices.TrackPropertyTypeFourCC), - Value: to.Ptr("hev1"), - }}, - }}, - ContentKeys: &armmediaservices.StreamingPolicyContentKeys{ - DefaultKey: &armmediaservices.DefaultKey{ - Label: to.Ptr("cencDefaultKey"), - }, - }, - Drm: &armmediaservices.CencDrmConfiguration{ - PlayReady: &armmediaservices.StreamingPolicyPlayReadyConfiguration{ - CustomLicenseAcquisitionURLTemplate: to.Ptr("https://contoso.com/{AssetAlternativeId}/playready/{ContentKeyId}"), - PlayReadyCustomAttributes: to.Ptr("PlayReady CustomAttributes"), - }, - Widevine: &armmediaservices.StreamingPolicyWidevineConfiguration{ - CustomLicenseAcquisitionURLTemplate: to.Ptr("https://contoso.com/{AssetAlternativeId}/widevine/{ContentKeyId"), - }, - }, - EnabledProtocols: &armmediaservices.EnabledProtocols{ - Dash: to.Ptr(true), - Download: to.Ptr(false), - Hls: to.Ptr(false), - SmoothStreaming: to.Ptr(true), - }, - }, - DefaultContentKeyPolicyName: to.Ptr("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/Metadata/stable/2022-08-01/examples/streaming-policies-create-envelopeEncryption-only.json -func ExampleStreamingPoliciesClient_Create_createsAStreamingPolicyWithEnvelopeEncryptionOnly() { - 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", "UserCreatedSecureStreamingPolicyWithEnvelopeEncryptionOnly", armmediaservices.StreamingPolicy{ - Properties: &armmediaservices.StreamingPolicyProperties{ - DefaultContentKeyPolicyName: to.Ptr("PolicyWithClearKeyOptionAndTokenRestriction"), - EnvelopeEncryption: &armmediaservices.EnvelopeEncryption{ - ContentKeys: &armmediaservices.StreamingPolicyContentKeys{ - DefaultKey: &armmediaservices.DefaultKey{ - Label: to.Ptr("aesDefaultKey"), - }, - }, - CustomKeyAcquisitionURLTemplate: to.Ptr("https://contoso.com/{AssetAlternativeId}/envelope/{ContentKeyId}"), - EnabledProtocols: &armmediaservices.EnabledProtocols{ - Dash: to.Ptr(true), - Download: to.Ptr(false), - 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/Metadata/stable/2022-08-01/examples/streaming-policies-create-secure-streaming.json -func ExampleStreamingPoliciesClient_Create_createsAStreamingPolicyWithSecureStreaming() { - 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", "UserCreatedSecureStreamingPolicy", armmediaservices.StreamingPolicy{ - Properties: &armmediaservices.StreamingPolicyProperties{ - CommonEncryptionCbcs: &armmediaservices.CommonEncryptionCbcs{ - ContentKeys: &armmediaservices.StreamingPolicyContentKeys{ - DefaultKey: &armmediaservices.DefaultKey{ - Label: to.Ptr("cbcsDefaultKey"), - }, - }, - Drm: &armmediaservices.CbcsDrmConfiguration{ - FairPlay: &armmediaservices.StreamingPolicyFairPlayConfiguration{ - AllowPersistentLicense: to.Ptr(true), - CustomLicenseAcquisitionURLTemplate: to.Ptr("https://contoso.com/{AssetAlternativeId}/fairplay/{ContentKeyId}"), - }, - }, - EnabledProtocols: &armmediaservices.EnabledProtocols{ - Dash: to.Ptr(false), - Download: to.Ptr(false), - Hls: to.Ptr(true), - SmoothStreaming: to.Ptr(false), - }, - }, - CommonEncryptionCenc: &armmediaservices.CommonEncryptionCenc{ - ClearTracks: []*armmediaservices.TrackSelection{ - { - TrackSelections: []*armmediaservices.TrackPropertyCondition{ - { - Operation: to.Ptr(armmediaservices.TrackPropertyCompareOperationEqual), - Property: to.Ptr(armmediaservices.TrackPropertyTypeFourCC), - Value: to.Ptr("hev1"), - }}, - }}, - ContentKeys: &armmediaservices.StreamingPolicyContentKeys{ - DefaultKey: &armmediaservices.DefaultKey{ - Label: to.Ptr("cencDefaultKey"), - }, - }, - Drm: &armmediaservices.CencDrmConfiguration{ - PlayReady: &armmediaservices.StreamingPolicyPlayReadyConfiguration{ - CustomLicenseAcquisitionURLTemplate: to.Ptr("https://contoso.com/{AssetAlternativeId}/playready/{ContentKeyId}"), - PlayReadyCustomAttributes: to.Ptr("PlayReady CustomAttributes"), - }, - Widevine: &armmediaservices.StreamingPolicyWidevineConfiguration{ - CustomLicenseAcquisitionURLTemplate: to.Ptr("https://contoso.com/{AssetAlternativeId}/widevine/{ContentKeyId"), - }, - }, - EnabledProtocols: &armmediaservices.EnabledProtocols{ - Dash: to.Ptr(true), - Download: to.Ptr(false), - Hls: to.Ptr(false), - SmoothStreaming: to.Ptr(true), - }, - }, - DefaultContentKeyPolicyName: to.Ptr("PolicyWithMultipleOptions"), - EnvelopeEncryption: &armmediaservices.EnvelopeEncryption{ - ContentKeys: &armmediaservices.StreamingPolicyContentKeys{ - DefaultKey: &armmediaservices.DefaultKey{ - Label: to.Ptr("aesDefaultKey"), - }, - }, - CustomKeyAcquisitionURLTemplate: to.Ptr("https://contoso.com/{AssetAlternativeId}/envelope/{ContentKeyId}"), - EnabledProtocols: &armmediaservices.EnabledProtocols{ - Dash: to.Ptr(true), - Download: to.Ptr(false), - 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/Metadata/stable/2022-08-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/time_rfc3339.go b/sdk/resourcemanager/mediaservices/armmediaservices/time_rfc3339.go index 59986c46def5..4d3aabbdeda7 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/time_rfc3339.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/time_rfc3339.go @@ -62,7 +62,7 @@ func (t *timeRFC3339) Parse(layout, value string) error { return err } -func populateTimeRFC3339(m map[string]interface{}, k string, t *time.Time) { +func populateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return } else if azcore.IsNullValue(t) { diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/tracks_client.go b/sdk/resourcemanager/mediaservices/armmediaservices/tracks_client.go index 65f999315e4e..99e6433ebf75 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/tracks_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/tracks_client.go @@ -32,9 +32,9 @@ type TracksClient struct { } // NewTracksClient creates a new instance of TracksClient with the specified values. -// subscriptionID - The unique identifier for a Microsoft Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The unique identifier for a Microsoft Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewTracksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TracksClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,14 +57,15 @@ 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 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// assetName - The Asset name. -// trackName - The Asset Track name. -// parameters - The request parameters -// options - TracksClientBeginCreateOrUpdateOptions contains the optional parameters for the TracksClient.BeginCreateOrUpdate -// method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - assetName - The Asset name. +// - trackName - The Asset Track name. +// - parameters - The request parameters +// - options - TracksClientBeginCreateOrUpdateOptions contains the optional parameters for the TracksClient.BeginCreateOrUpdate +// method. func (client *TracksClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, assetName string, trackName string, parameters AssetTrack, options *TracksClientBeginCreateOrUpdateOptions) (*runtime.Poller[TracksClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, accountName, assetName, trackName, parameters, options) @@ -79,6 +80,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 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) @@ -131,12 +133,13 @@ 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 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// assetName - The Asset name. -// trackName - The Asset Track name. -// options - TracksClientBeginDeleteOptions contains the optional parameters for the TracksClient.BeginDelete method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - assetName - The Asset name. +// - trackName - The Asset Track name. +// - options - TracksClientBeginDeleteOptions contains the optional parameters for the TracksClient.BeginDelete method. func (client *TracksClient) BeginDelete(ctx context.Context, resourceGroupName string, accountName string, assetName string, trackName string, options *TracksClientBeginDeleteOptions) (*runtime.Poller[TracksClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, accountName, assetName, trackName, options) @@ -151,6 +154,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 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) @@ -203,12 +207,13 @@ 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 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// assetName - The Asset name. -// trackName - The Asset Track name. -// options - TracksClientGetOptions contains the optional parameters for the TracksClient.Get method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - assetName - The Asset name. +// - trackName - The Asset Track name. +// - options - TracksClientGetOptions contains the optional parameters for the TracksClient.Get method. func (client *TracksClient) Get(ctx context.Context, resourceGroupName string, accountName string, assetName string, trackName string, options *TracksClientGetOptions) (TracksClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, assetName, trackName, options) if err != nil { @@ -268,11 +273,12 @@ func (client *TracksClient) getHandleResponse(resp *http.Response) (TracksClient } // NewListPager - Lists the Tracks in the asset +// // 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. -// options - TracksClientListOptions contains the optional parameters for the TracksClient.List method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - assetName - The Asset name. +// - options - TracksClientListOptions contains the optional parameters for the TracksClient.NewListPager method. func (client *TracksClient) NewListPager(resourceGroupName string, accountName string, assetName string, options *TracksClientListOptions) *runtime.Pager[TracksClientListResponse] { return runtime.NewPager(runtime.PagingHandler[TracksClientListResponse]{ More: func(page TracksClientListResponse) bool { @@ -336,13 +342,14 @@ 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 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// assetName - The Asset name. -// trackName - The Asset Track name. -// parameters - The request parameters -// options - TracksClientBeginUpdateOptions contains the optional parameters for the TracksClient.BeginUpdate method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - assetName - The Asset name. +// - trackName - The Asset Track name. +// - parameters - The request parameters +// - options - TracksClientBeginUpdateOptions contains the optional parameters for the TracksClient.BeginUpdate method. func (client *TracksClient) BeginUpdate(ctx context.Context, resourceGroupName string, accountName string, assetName string, trackName string, parameters AssetTrack, options *TracksClientBeginUpdateOptions) (*runtime.Poller[TracksClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, accountName, assetName, trackName, parameters, options) @@ -357,6 +364,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 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) @@ -413,13 +421,14 @@ 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 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// assetName - The Asset name. -// trackName - The Asset Track name. -// options - TracksClientBeginUpdateTrackDataOptions contains the optional parameters for the TracksClient.BeginUpdateTrackData -// method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - assetName - The Asset name. +// - trackName - The Asset Track name. +// - options - TracksClientBeginUpdateTrackDataOptions contains the optional parameters for the TracksClient.BeginUpdateTrackData +// method. func (client *TracksClient) BeginUpdateTrackData(ctx context.Context, resourceGroupName string, accountName string, assetName string, trackName string, options *TracksClientBeginUpdateTrackDataOptions) (*runtime.Poller[TracksClientUpdateTrackDataResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.updateTrackData(ctx, resourceGroupName, accountName, assetName, trackName, options) @@ -438,6 +447,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 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) 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 9ee25489ac3b..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/tracks_client_example_test.go +++ /dev/null @@ -1,163 +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/Metadata/stable/2022-08-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/Metadata/stable/2022-08-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/Metadata/stable/2022-08-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/Metadata/stable/2022-08-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/Metadata/stable/2022-08-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/Metadata/stable/2022-08-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.go b/sdk/resourcemanager/mediaservices/armmediaservices/transforms_client.go index 40f5ad0062d6..2525304aa5a1 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/transforms_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/transforms_client.go @@ -32,9 +32,9 @@ type TransformsClient struct { } // NewTransformsClient creates a new instance of TransformsClient with the specified values. -// subscriptionID - The unique identifier for a Microsoft Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The unique identifier for a Microsoft Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewTransformsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TransformsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,13 +57,14 @@ func NewTransformsClient(subscriptionID string, credential azcore.TokenCredentia // CreateOrUpdate - Creates or updates a new Transform. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-07-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// transformName - The Transform name. -// parameters - The request parameters -// options - TransformsClientCreateOrUpdateOptions contains the optional parameters for the TransformsClient.CreateOrUpdate -// method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - transformName - The Transform name. +// - parameters - The request parameters +// - options - TransformsClientCreateOrUpdateOptions contains the optional parameters for the TransformsClient.CreateOrUpdate +// method. func (client *TransformsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, transformName string, parameters Transform, options *TransformsClientCreateOrUpdateOptions) (TransformsClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, accountName, transformName, parameters, options) if err != nil { @@ -120,11 +121,12 @@ func (client *TransformsClient) createOrUpdateHandleResponse(resp *http.Response // Delete - Deletes a Transform. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-07-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// transformName - The Transform name. -// options - TransformsClientDeleteOptions contains the optional parameters for the TransformsClient.Delete method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - transformName - The Transform name. +// - options - TransformsClientDeleteOptions contains the optional parameters for the TransformsClient.Delete method. func (client *TransformsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, transformName string, options *TransformsClientDeleteOptions) (TransformsClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, transformName, options) if err != nil { @@ -172,11 +174,12 @@ func (client *TransformsClient) deleteCreateRequest(ctx context.Context, resourc // Get - Gets a Transform. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-07-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// transformName - The Transform name. -// options - TransformsClientGetOptions contains the optional parameters for the TransformsClient.Get method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - transformName - The Transform name. +// - options - TransformsClientGetOptions contains the optional parameters for the TransformsClient.Get method. func (client *TransformsClient) Get(ctx context.Context, resourceGroupName string, accountName string, transformName string, options *TransformsClientGetOptions) (TransformsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, transformName, options) if err != nil { @@ -232,10 +235,11 @@ func (client *TransformsClient) getHandleResponse(resp *http.Response) (Transfor } // NewListPager - Lists the Transforms in the account. +// // Generated from API version 2022-07-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// options - TransformsClientListOptions contains the optional parameters for the TransformsClient.List method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - options - TransformsClientListOptions contains the optional parameters for the TransformsClient.NewListPager method. func (client *TransformsClient) NewListPager(resourceGroupName string, accountName string, options *TransformsClientListOptions) *runtime.Pager[TransformsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[TransformsClientListResponse]{ More: func(page TransformsClientListResponse) bool { @@ -307,12 +311,13 @@ func (client *TransformsClient) listHandleResponse(resp *http.Response) (Transfo // Update - Updates a Transform. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-07-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// transformName - The Transform name. -// parameters - The request parameters -// options - TransformsClientUpdateOptions contains the optional parameters for the TransformsClient.Update method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - transformName - The Transform name. +// - parameters - The request parameters +// - options - TransformsClientUpdateOptions contains the optional parameters for the TransformsClient.Update method. func (client *TransformsClient) Update(ctx context.Context, resourceGroupName string, accountName string, transformName string, parameters Transform, options *TransformsClientUpdateOptions) (TransformsClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, transformName, parameters, options) if err != nil { 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 4a286626c005..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/transforms_client_example_test.go +++ /dev/null @@ -1,219 +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/Encoding/stable/2022-07-01/examples/transforms-list-all.json -func ExampleTransformsClient_NewListPager_listsTheTransforms() { - 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/Encoding/stable/2022-07-01/examples/transforms-list-all-filter-by-created.json -func ExampleTransformsClient_NewListPager_listsTheTransformsFilterByCreated() { - 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: to.Ptr("properties/created gt 2021-06-01T00:00:00.0000000Z and properties/created le 2021-06-01T00:00:10.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/Encoding/stable/2022-07-01/examples/transforms-list-all-filter-by-lastmodified.json -func ExampleTransformsClient_NewListPager_listsTheTransformsFilterByLastmodified() { - 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: to.Ptr("properties/lastmodified gt 2021-06-01T00:00:00.0000000Z and properties/lastmodified le 2021-06-01T00:00:10.0000000Z"), - Orderby: to.Ptr("properties/lastmodified desc"), - }) - 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/Encoding/stable/2022-07-01/examples/transforms-list-all-filter-by-name.json -func ExampleTransformsClient_NewListPager_listsTheTransformsFilterByName() { - 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: to.Ptr("(name eq 'sampleEncode') or (name eq 'sampleEncodeAndVideoIndex')"), - Orderby: to.Ptr("name desc"), - }) - 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/Encoding/stable/2022-07-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/Encoding/stable/2022-07-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/Encoding/stable/2022-07-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/Encoding/stable/2022-07-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 -}