diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/CHANGELOG.md b/sdk/resourcemanager/mediaservices/armmediaservices/CHANGELOG.md index 6d6e065ae831..1576e0d09b36 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/CHANGELOG.md +++ b/sdk/resourcemanager/mediaservices/armmediaservices/CHANGELOG.md @@ -1,5 +1,20 @@ # Release History +## 3.2.0 (2023-01-11) +### Features Added + +- New value `EncoderNamedPresetDDGoodQualityAudio` added to type alias `EncoderNamedPreset` +- New value `JobErrorCategoryAccount` added to type alias `JobErrorCategory` +- New value `JobErrorCodeIdentityUnsupported` added to type alias `JobErrorCode` +- New function `*DDAudio.GetAudio() *Audio` +- New function `*DDAudio.GetCodec() *Codec` +- New struct `DDAudio` +- New struct `Fade` +- New field `FadeIn` in struct `Filters` +- New field `FadeOut` in struct `Filters` +- New field `ExperimentalOptions` in struct `StandardEncoderPreset` + + ## 3.1.0 (2022-09-02) ### Features Added diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/accountfilters_client.go b/sdk/resourcemanager/mediaservices/armmediaservices/accountfilters_client.go index 8a6d44ce08c5..ab6660e24877 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/accountfilters_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/accountfilters_client.go @@ -232,7 +232,6 @@ func (client *AccountFiltersClient) getHandleResponse(resp *http.Response) (Acco } // NewListPager - List Account Filters in the Media Services account. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. 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 365876d8727d..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/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/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/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/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/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 aa4270f2f97f..9976359f527b 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/assetfilters_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/assetfilters_client.go @@ -247,7 +247,6 @@ func (client *AssetFiltersClient) getHandleResponse(resp *http.Response) (AssetF } // NewListPager - List Asset Filters associated with the specified Asset. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. 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 29b656189117..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/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/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/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/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/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 a757ca1b0a98..2bbc116ffe11 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/assets_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/assets_client.go @@ -294,7 +294,6 @@ func (client *AssetsClient) getEncryptionKeyHandleResponse(resp *http.Response) } // NewListPager - List Assets in the Media Services account with optional filtering and ordering -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. 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 e010bdc5f7d6..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/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/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/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/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/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/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/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/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/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/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_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/assettrackoperationresults_client_example_test.go deleted file mode 100644 index a3805529b10c..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/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_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/assettrackoperationstatuses_client_example_test.go deleted file mode 100644 index 354096e2f7fb..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/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/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/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 41f33e2daf31..c199f0e35d79 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/164cda32b8baeb388264af44ad8392f68a8e200a/specification/mediaservices/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/164cda32b8baeb388264af44ad8392f68a8e200a/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.1.0 +module-version: 3.2.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/client.go b/sdk/resourcemanager/mediaservices/armmediaservices/client.go index cba1674f97a2..670ef5004345 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/client.go @@ -222,7 +222,6 @@ func (client *Client) getHandleResponse(resp *http.Response) (ClientGetResponse, } // NewListPager - List Media Services accounts in the resource group -// 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. // options - ClientListOptions contains the optional parameters for the Client.List method. @@ -286,7 +285,6 @@ func (client *Client) listHandleResponse(resp *http.Response) (ClientListRespons } // NewListBySubscriptionPager - List Media Services accounts in the subscription. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2021-11-01 // options - ClientListBySubscriptionOptions contains the optional parameters for the Client.ListBySubscription method. func (client *Client) NewListBySubscriptionPager(options *ClientListBySubscriptionOptions) *runtime.Pager[ClientListBySubscriptionResponse] { 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 09cfef8e3535..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/stable/2021-11-01/examples/accounts-list-all-accounts.json -func ExampleClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("contoso", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accounts-get-by-name.json -func ExampleClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "contoso", "contosotv", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/async-accounts-create.json -func ExampleClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, "contoso", "contososports", armmediaservices.MediaService{ - Location: to.Ptr("South Central US"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - "key2": to.Ptr("value2"), - }, - Identity: &armmediaservices.MediaServiceIdentity{ - Type: to.Ptr("UserAssigned"), - UserAssignedIdentities: map[string]*armmediaservices.UserAssignedManagedIdentity{ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {}, - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2": {}, - }, - }, - Properties: &armmediaservices.MediaServiceProperties{ - Encryption: &armmediaservices.AccountEncryption{ - Type: to.Ptr(armmediaservices.AccountEncryptionKeyTypeCustomerKey), - Identity: &armmediaservices.ResourceIdentity{ - UseSystemAssignedIdentity: to.Ptr(false), - UserAssignedIdentity: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1"), - }, - }, - KeyDelivery: &armmediaservices.KeyDelivery{ - AccessControl: &armmediaservices.AccessControl{ - DefaultAction: to.Ptr(armmediaservices.DefaultActionAllow), - }, - }, - PublicNetworkAccess: to.Ptr(armmediaservices.PublicNetworkAccessEnabled), - StorageAccounts: []*armmediaservices.StorageAccount{ - { - Type: to.Ptr(armmediaservices.StorageAccountTypePrimary), - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.Storage/storageAccounts/contososportsstore"), - Identity: &armmediaservices.ResourceIdentity{ - UseSystemAssignedIdentity: to.Ptr(false), - UserAssignedIdentity: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1"), - }, - }}, - StorageAuthentication: to.Ptr(armmediaservices.StorageAuthenticationManagedIdentity), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accounts-delete.json -func ExampleClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, "contoso", "contososports", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/async-accounts-update.json -func ExampleClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, "contoso", "contososports", armmediaservices.MediaServiceUpdate{ - Tags: map[string]*string{ - "key1": to.Ptr("value3"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accounts-sync-storage-keys.json -func ExampleClient_SyncStorageKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.SyncStorageKeys(ctx, "contoso", "contososports", armmediaservices.SyncStorageKeysInput{ - ID: to.Ptr("contososportsstore"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accounts-list-media-edge-policies.json -func ExampleClient_ListEdgePolicies() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListEdgePolicies(ctx, "contoso", "contososports", armmediaservices.ListEdgePoliciesInput{ - DeviceID: to.Ptr("contosiothubhost_contosoiotdevice"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accounts-subscription-list-all-accounts.json -func ExampleClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/constants.go b/sdk/resourcemanager/mediaservices/armmediaservices/constants.go index 17b35bb8ccb6..d06c95274a6a 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.1.0" + moduleVersion = "v3.2.0" ) // AacAudioProfile - The encoding profile to be used when encoding audio with AAC. @@ -239,7 +239,7 @@ const ( ChannelMappingFrontLeft ChannelMapping = "FrontLeft" // ChannelMappingFrontRight - The Front Right Channel. ChannelMappingFrontRight ChannelMapping = "FrontRight" - // ChannelMappingLowFrequencyEffects - Low Frequency Effects Channel. Sometimes referred to as the Subwoofer. + // ChannelMappingLowFrequencyEffects - Low Frequency Effects Channel. Sometimes referred to as the subwoofer. ChannelMappingLowFrequencyEffects ChannelMapping = "LowFrequencyEffects" // ChannelMappingStereoLeft - The Left Stereo channel. Sometimes referred to as Down Mix Left. ChannelMappingStereoLeft ChannelMapping = "StereoLeft" @@ -492,7 +492,7 @@ func PossibleDeinterlaceParityValues() []DeinterlaceParity { type EncoderNamedPreset string const ( - // EncoderNamedPresetAACGoodQualityAudio - Produces a single MP4 file containing only stereo audio encoded at 192 kbps. + // EncoderNamedPresetAACGoodQualityAudio - Produces a single MP4 file containing only AAC stereo audio encoded at 192 kbps. EncoderNamedPresetAACGoodQualityAudio EncoderNamedPreset = "AACGoodQualityAudio" // EncoderNamedPresetAdaptiveStreaming - Produces a set of GOP aligned MP4 files with H.264 video and stereo AAC audio. Auto-generates // a bitrate ladder based on the input resolution, bitrate and frame rate. The auto-generated preset will never exceed the @@ -513,6 +513,9 @@ const ( // video and audio output files. This preset can be used to clip an existing asset or convert a group of key frame (GOP) aligned // MP4 files as an asset that can be streamed. EncoderNamedPresetCopyAllBitrateNonInterleaved EncoderNamedPreset = "CopyAllBitrateNonInterleaved" + // EncoderNamedPresetDDGoodQualityAudio - Produces a single MP4 file containing only DD(Digital Dolby) stereo audio encoded + // at 192 kbps. + EncoderNamedPresetDDGoodQualityAudio EncoderNamedPreset = "DDGoodQualityAudio" // EncoderNamedPresetH264MultipleBitrate1080P - Produces a set of 8 GOP-aligned MP4 files, ranging from 6000 kbps to 400 kbps, // and stereo AAC audio. Resolution starts at 1080p and goes down to 180p. EncoderNamedPresetH264MultipleBitrate1080P EncoderNamedPreset = "H264MultipleBitrate1080p" @@ -560,6 +563,7 @@ func PossibleEncoderNamedPresetValues() []EncoderNamedPreset { EncoderNamedPresetContentAwareEncoding, EncoderNamedPresetContentAwareEncodingExperimental, EncoderNamedPresetCopyAllBitrateNonInterleaved, + EncoderNamedPresetDDGoodQualityAudio, EncoderNamedPresetH264MultipleBitrate1080P, EncoderNamedPresetH264MultipleBitrate720P, EncoderNamedPresetH264MultipleBitrateSD, @@ -863,6 +867,8 @@ func PossibleInterleaveOutputValues() []InterleaveOutput { type JobErrorCategory string const ( + // JobErrorCategoryAccount - The error is related to account information. + JobErrorCategoryAccount JobErrorCategory = "Account" // JobErrorCategoryConfiguration - The error is configuration related. JobErrorCategoryConfiguration JobErrorCategory = "Configuration" // JobErrorCategoryContent - The error is related to data in the input files. @@ -878,6 +884,7 @@ const ( // PossibleJobErrorCategoryValues returns the possible values for the JobErrorCategory const type. func PossibleJobErrorCategoryValues() []JobErrorCategory { return []JobErrorCategory{ + JobErrorCategoryAccount, JobErrorCategoryConfiguration, JobErrorCategoryContent, JobErrorCategoryDownload, @@ -905,6 +912,9 @@ const ( // JobErrorCodeDownloadTransientError - While trying to download the input files, there was an issue during transfer (storage // service, network errors), see details and check your source. JobErrorCodeDownloadTransientError JobErrorCode = "DownloadTransientError" + // JobErrorCodeIdentityUnsupported - There was an error verifying to the account identity. Check and fix the identity configurations + // and retry. If unsuccessful, please contact support. + JobErrorCodeIdentityUnsupported JobErrorCode = "IdentityUnsupported" // JobErrorCodeServiceError - Fatal service error, please contact support. JobErrorCodeServiceError JobErrorCode = "ServiceError" // JobErrorCodeServiceTransientError - Transient error, please retry, if retry is unsuccessful, please contact support. @@ -925,6 +935,7 @@ func PossibleJobErrorCodeValues() []JobErrorCode { JobErrorCodeContentUnsupported, JobErrorCodeDownloadNotAccessible, JobErrorCodeDownloadTransientError, + JobErrorCodeIdentityUnsupported, JobErrorCodeServiceError, JobErrorCodeServiceTransientError, JobErrorCodeUploadNotAccessible, diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/contentkeypolicies_client.go b/sdk/resourcemanager/mediaservices/armmediaservices/contentkeypolicies_client.go index 1380356e1c9a..397d5ff782a9 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/contentkeypolicies_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/contentkeypolicies_client.go @@ -296,7 +296,6 @@ func (client *ContentKeyPoliciesClient) getPolicyPropertiesWithSecretsHandleResp } // NewListPager - Lists the Content Key Policies in the account -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. 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 c8d11da19b24..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/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/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/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/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/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/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/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/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/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/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/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 5622f304be8f..47b810361a51 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/go.mod +++ b/sdk/resourcemanager/mediaservices/armmediaservices/go.mod @@ -2,20 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mediaservices/armme go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1 // indirect - github.com/golang-jwt/jwt v3.2.1+incompatible // indirect - github.com/google/uuid v1.1.1 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect - golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect golang.org/x/text v0.3.7 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/go.sum b/sdk/resourcemanager/mediaservices/armmediaservices/go.sum index 8828b17b1853..3afb578030a5 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/go.sum +++ b/sdk/resourcemanager/mediaservices/armmediaservices/go.sum @@ -1,33 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 h1:sVPhtT2qjO86rTUaWMr4WoES4TkjGnzcioXcnHV9s5k= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 h1:QkAcEIAKbNL4KoFr4SathZPhDhF4mVwpBMFlYjyAqy8= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0/go.mod h1:bhXu1AjYL+wutSL/kpSq6s7733q2Rb0yuot9Zgfqa/0= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1 h1:BWe8a+f/t+7KY7zH2mqygeUD0t8hNFXe08p1Pb3/jKE= -github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= -github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 h1:Tgea0cVUD0ivh5ADBX4WwuI12DUd2to3nCYe2eayMIw= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/jobs_client.go b/sdk/resourcemanager/mediaservices/armmediaservices/jobs_client.go index 607245aa17d4..012811c8199f 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/jobs_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/jobs_client.go @@ -57,7 +57,7 @@ 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 2021-11-01 +// 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. @@ -106,7 +106,7 @@ func (client *JobsClient) cancelJobCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -114,7 +114,7 @@ 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 2021-11-01 +// 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. @@ -164,7 +164,7 @@ func (client *JobsClient) createCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -181,7 +181,7 @@ 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 2021-11-01 +// 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. @@ -230,7 +230,7 @@ func (client *JobsClient) deleteCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -238,7 +238,7 @@ 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 2021-11-01 +// 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. @@ -287,7 +287,7 @@ func (client *JobsClient) getCreateRequest(ctx context.Context, resourceGroupNam return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -303,8 +303,7 @@ func (client *JobsClient) getHandleResponse(resp *http.Response) (JobsClientGetR } // NewListPager - Lists all of the Jobs for the Transform. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// 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. @@ -361,7 +360,7 @@ func (client *JobsClient) listCreateRequest(ctx context.Context, resourceGroupNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-07-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -385,7 +384,7 @@ 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 2021-11-01 +// 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. @@ -435,7 +434,7 @@ func (client *JobsClient) updateCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/jobs_client_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/jobs_client_example_test.go deleted file mode 100644 index d54cb8038952..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/stable/2021-11-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-11-01T00:00:10.0000000Z and properties/created le 2021-11-01T00:00:20.0000000Z"), - Orderby: to.Ptr("properties/created"), - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-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-11-01T00:00:10.0000000Z and properties/lastmodified le 2021-11-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/stable/2021-11-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/stable/2021-11-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/stable/2021-11-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/stable/2021-11-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/stable/2021-11-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/stable/2021-11-01/examples/jobs-get-by-name.json -func ExampleJobsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewJobsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "contosoresources", "contosomedia", "exampleTransform", "job1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-create.json -func ExampleJobsClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewJobsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Create(ctx, "contosoresources", "contosomedia", "exampleTransform", "job1", armmediaservices.Job{ - Properties: &armmediaservices.JobProperties{ - CorrelationData: map[string]*string{ - "Key 2": to.Ptr("Value 2"), - "key1": to.Ptr("value1"), - }, - Input: &armmediaservices.JobInputAsset{ - ODataType: to.Ptr("#Microsoft.Media.JobInputAsset"), - AssetName: to.Ptr("job1-InputAsset"), - }, - Outputs: []armmediaservices.JobOutputClassification{ - &armmediaservices.JobOutputAsset{ - ODataType: to.Ptr("#Microsoft.Media.JobOutputAsset"), - AssetName: to.Ptr("job1-OutputAsset"), - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-delete.json -func ExampleJobsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewJobsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, "contosoresources", "contosomedia", "exampleTransform", "jobToDelete", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-update.json -func ExampleJobsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewJobsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, "contosoresources", "contosomedia", "exampleTransform", "job1", armmediaservices.Job{ - Properties: &armmediaservices.JobProperties{ - Description: to.Ptr("Example job to illustrate update."), - Input: &armmediaservices.JobInputAsset{ - ODataType: to.Ptr("#Microsoft.Media.JobInputAsset"), - AssetName: to.Ptr("job1-InputAsset"), - }, - Outputs: []armmediaservices.JobOutputClassification{ - &armmediaservices.JobOutputAsset{ - ODataType: to.Ptr("#Microsoft.Media.JobOutputAsset"), - AssetName: to.Ptr("job1-OutputAsset"), - }}, - Priority: to.Ptr(armmediaservices.PriorityHigh), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-cancel.json -func ExampleJobsClient_CancelJob() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewJobsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.CancelJob(ctx, "contosoresources", "contosomedia", "exampleTransform", "job1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/liveevents_client.go b/sdk/resourcemanager/mediaservices/armmediaservices/liveevents_client.go index e140c0d26c5a..8cded9e37c31 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/liveevents_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/liveevents_client.go @@ -386,7 +386,6 @@ func (client *LiveEventsClient) getHandleResponse(resp *http.Response) (LiveEven } // NewListPager - Lists all the live events in the account. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. 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 fa0fa4d6101d..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/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/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/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/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/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/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/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/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/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/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/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 4817e9850dc7..62051711e29a 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/liveoutputs_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/liveoutputs_client.go @@ -329,7 +329,6 @@ func (client *LiveOutputsClient) getHandleResponse(resp *http.Response) (LiveOut } // NewListPager - Lists the live outputs of a live event. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. 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 c915a38d9427..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/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/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/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/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/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/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_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/locations_client_example_test.go deleted file mode 100644 index a161922a2159..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/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 0df7cb2c2773..0de1eb1f7514 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/models.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/models.go @@ -477,7 +477,7 @@ type AsyncOperationResult struct { // AudioClassification provides polymorphic access to related types. // Call the interface's GetAudio() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: -// - *AacAudio, *Audio +// - *AacAudio, *Audio, *DDAudio type AudioClassification interface { CodecClassification // GetAudio returns the Audio content of the underlying type. @@ -793,7 +793,7 @@ func (c *ClipTime) GetClipTime() *ClipTime { return c } // CodecClassification provides polymorphic access to related types. // Call the interface's GetCodec() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: -// - *AacAudio, *Audio, *Codec, *CopyAudio, *CopyVideo, *H264Video, *H265Video, *Image, *JpgImage, *PNGImage, *Video +// - *AacAudio, *Audio, *Codec, *CopyAudio, *CopyVideo, *DDAudio, *H264Video, *H265Video, *Image, *JpgImage, *PNGImage, *Video type CodecClassification interface { // GetCodec returns the Codec content of the underlying type. GetCodec() *Codec @@ -949,7 +949,7 @@ func (c *ContentKeyPolicyConfiguration) GetContentKeyPolicyConfiguration() *Cont // ContentKeyPolicyFairPlayConfiguration - Specifies a configuration for FairPlay licenses. type ContentKeyPolicyFairPlayConfiguration struct { - // REQUIRED; The key that must be used as FairPlay Application Secret key. + // REQUIRED; The key that must be used as FairPlay Application Secret key. This needs to be base64 encoded. Ask []byte `json:"ask,omitempty"` // REQUIRED; The Base64 representation of FairPlay certificate in PKCS 12 (pfx) format (including private key). @@ -1422,6 +1422,47 @@ type CrossSiteAccessPolicies struct { CrossDomainPolicy *string `json:"crossDomainPolicy,omitempty"` } +// DDAudio - Describes Dolby Digital Audio Codec (AC3) audio encoding settings. The current implementation for Dolby Digital +// Audio support are: Audio channel numbers at 1((mono), 2(stereo), 6(5.1side); Audio +// sampling frequency rates at: 32K/44.1K/48K Hz; Audio bitrate values as AC3 specification supports: 32000, 40000, 48000, +// 56000, 64000, 80000, 96000, 112000, 128000, 160000, 192000, 224000, 256000, +// 320000, 384000, 448000, 512000, 576000, 640000 bps. +type DDAudio struct { + // REQUIRED; The discriminator for derived types. + ODataType *string `json:"@odata.type,omitempty"` + + // The bitrate, in bits per second, of the output encoded audio. + Bitrate *int32 `json:"bitrate,omitempty"` + + // The number of channels in the audio. + Channels *int32 `json:"channels,omitempty"` + + // An optional label for the codec. The label can be used to control muxing behavior. + Label *string `json:"label,omitempty"` + + // The sampling rate to use for encoding in hertz. + SamplingRate *int32 `json:"samplingRate,omitempty"` +} + +// GetAudio implements the AudioClassification interface for type DDAudio. +func (d *DDAudio) GetAudio() *Audio { + return &Audio{ + Channels: d.Channels, + SamplingRate: d.SamplingRate, + Bitrate: d.Bitrate, + ODataType: d.ODataType, + Label: d.Label, + } +} + +// GetCodec implements the CodecClassification interface for type DDAudio. +func (d *DDAudio) GetCodec() *Codec { + return &Codec{ + ODataType: d.ODataType, + Label: d.Label, + } +} + // DashSettings - The DASH setting for a track. type DashSettings struct { // The role for the DASH setting. @@ -1593,6 +1634,23 @@ func (f *FaceDetectorPreset) GetPreset() *Preset { } } +// Fade - Describes the properties of a Fade effect applied to the input media. +type Fade struct { + // REQUIRED; The Duration of the fade effect in the video. The value can be in ISO 8601 format (For example, PT05S to fade + // In/Out a color during 5 seconds), or a frame count (For example, 10 to fade 10 frames from + // the start time), or a relative value to stream duration (For example, 10% to fade 10% of stream duration) + Duration *string `json:"duration,omitempty"` + + // REQUIRED; The Color for the fade In/Out. it can be on the CSS Level1 colors https://developer.mozilla.org/en-US/docs/Web/CSS/colorvalue/colorkeywords + // or an RGB/hex value: e.g: rgb(255,0,0), 0xFF0000 or #FF0000 + FadeColor *string `json:"fadeColor,omitempty"` + + // The position in the input video from where to start fade. The value can be in ISO 8601 format (For example, PT05S to start + // at 5 seconds), or a frame count (For example, 10 to start at the 10th frame), + // or a relative value to stream duration (For example, 10% to start at 10% of stream duration). Default is 0 + Start *string `json:"start,omitempty"` +} + // FilterTrackPropertyCondition - The class to specify one track property condition. type FilterTrackPropertyCondition struct { // REQUIRED; The track property condition operation. @@ -1621,6 +1679,12 @@ type Filters struct { // The de-interlacing settings. Deinterlace *Deinterlace `json:"deinterlace,omitempty"` + // Describes the properties of a Fade effect applied to the input media. + FadeIn *Fade `json:"fadeIn,omitempty"` + + // Describes the properties of a Fade effect applied to the input media. + FadeOut *Fade `json:"fadeOut,omitempty"` + // The properties of overlays to be applied to the input video. These could be audio, image or video overlays. Overlays []OverlayClassification `json:"overlays,omitempty"` @@ -1645,15 +1709,16 @@ type FormatClassification interface { // Format - Base class for output. type Format struct { - // REQUIRED; The pattern of the file names for the generated output files. The following macros are supported in the file + // REQUIRED; The file naming pattern used for the creation of output files. The following macros are supported in the file // name: {Basename} - An expansion macro that will use the name of the input video file. If // the base name(the file suffix is not included) of the input video file is less than 32 characters long, the base name of // input video files will be used. If the length of base name of the input video // file exceeds 32 characters, the base name is truncated to the first 32 characters in total length. {Extension} - The appropriate // extension for this format. {Label} - The label assigned to the - // codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video bitrate. - // Not applicable to thumbnails. {Codec} - The type of the audio/video codec. - // {Resolution} - The video resolution. Any unsubstituted macros will be collapsed and removed from the filename. + // codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {AudioStream} - string "Audio" plus + // audio stream number(start from 1). {Bitrate} - The audio/video bitrate in kbps. + // Not applicable to thumbnails. {Codec} - The type of the audio/video codec. {Resolution} - The video resolution. Any unsubstituted + // macros will be collapsed and removed from the filename. FilenamePattern *string `json:"filenamePattern,omitempty"` // REQUIRED; The discriminator for derived types. @@ -2109,15 +2174,16 @@ type ImageFormatClassification interface { // ImageFormat - Describes the properties for an output image file. type ImageFormat struct { - // REQUIRED; The pattern of the file names for the generated output files. The following macros are supported in the file + // REQUIRED; The file naming pattern used for the creation of output files. The following macros are supported in the file // name: {Basename} - An expansion macro that will use the name of the input video file. If // the base name(the file suffix is not included) of the input video file is less than 32 characters long, the base name of // input video files will be used. If the length of base name of the input video // file exceeds 32 characters, the base name is truncated to the first 32 characters in total length. {Extension} - The appropriate // extension for this format. {Label} - The label assigned to the - // codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video bitrate. - // Not applicable to thumbnails. {Codec} - The type of the audio/video codec. - // {Resolution} - The video resolution. Any unsubstituted macros will be collapsed and removed from the filename. + // codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {AudioStream} - string "Audio" plus + // audio stream number(start from 1). {Bitrate} - The audio/video bitrate in kbps. + // Not applicable to thumbnails. {Codec} - The type of the audio/video codec. {Resolution} - The video resolution. Any unsubstituted + // macros will be collapsed and removed from the filename. FilenamePattern *string `json:"filenamePattern,omitempty"` // REQUIRED; The discriminator for derived types. @@ -2599,15 +2665,16 @@ type JobsClientUpdateOptions struct { // JpgFormat - Describes the settings for producing JPEG thumbnails. type JpgFormat struct { - // REQUIRED; The pattern of the file names for the generated output files. The following macros are supported in the file + // REQUIRED; The file naming pattern used for the creation of output files. The following macros are supported in the file // name: {Basename} - An expansion macro that will use the name of the input video file. If // the base name(the file suffix is not included) of the input video file is less than 32 characters long, the base name of // input video files will be used. If the length of base name of the input video // file exceeds 32 characters, the base name is truncated to the first 32 characters in total length. {Extension} - The appropriate // extension for this format. {Label} - The label assigned to the - // codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video bitrate. - // Not applicable to thumbnails. {Codec} - The type of the audio/video codec. - // {Resolution} - The video resolution. Any unsubstituted macros will be collapsed and removed from the filename. + // codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {AudioStream} - string "Audio" plus + // audio stream number(start from 1). {Bitrate} - The audio/video bitrate in kbps. + // Not applicable to thumbnails. {Codec} - The type of the audio/video codec. {Resolution} - The video resolution. Any unsubstituted + // macros will be collapsed and removed from the filename. FilenamePattern *string `json:"filenamePattern,omitempty"` // REQUIRED; The discriminator for derived types. @@ -3386,15 +3453,16 @@ type MetricSpecification struct { // Mp4Format - Describes the properties for an output ISO MP4 file. type Mp4Format struct { - // REQUIRED; The pattern of the file names for the generated output files. The following macros are supported in the file + // REQUIRED; The file naming pattern used for the creation of output files. The following macros are supported in the file // name: {Basename} - An expansion macro that will use the name of the input video file. If // the base name(the file suffix is not included) of the input video file is less than 32 characters long, the base name of // input video files will be used. If the length of base name of the input video // file exceeds 32 characters, the base name is truncated to the first 32 characters in total length. {Extension} - The appropriate // extension for this format. {Label} - The label assigned to the - // codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video bitrate. - // Not applicable to thumbnails. {Codec} - The type of the audio/video codec. - // {Resolution} - The video resolution. Any unsubstituted macros will be collapsed and removed from the filename. + // codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {AudioStream} - string "Audio" plus + // audio stream number(start from 1). {Bitrate} - The audio/video bitrate in kbps. + // Not applicable to thumbnails. {Codec} - The type of the audio/video codec. {Resolution} - The video resolution. Any unsubstituted + // macros will be collapsed and removed from the filename. FilenamePattern *string `json:"filenamePattern,omitempty"` // REQUIRED; The discriminator for derived types. @@ -3436,15 +3504,16 @@ type MultiBitrateFormatClassification interface { // behavior is to produce one output file for each video layer which is muxed together with all the // audios. The exact output files produced can be controlled by specifying the outputFiles collection. type MultiBitrateFormat struct { - // REQUIRED; The pattern of the file names for the generated output files. The following macros are supported in the file + // REQUIRED; The file naming pattern used for the creation of output files. The following macros are supported in the file // name: {Basename} - An expansion macro that will use the name of the input video file. If // the base name(the file suffix is not included) of the input video file is less than 32 characters long, the base name of // input video files will be used. If the length of base name of the input video // file exceeds 32 characters, the base name is truncated to the first 32 characters in total length. {Extension} - The appropriate // extension for this format. {Label} - The label assigned to the - // codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video bitrate. - // Not applicable to thumbnails. {Codec} - The type of the audio/video codec. - // {Resolution} - The video resolution. Any unsubstituted macros will be collapsed and removed from the filename. + // codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {AudioStream} - string "Audio" plus + // audio stream number(start from 1). {Bitrate} - The audio/video bitrate in kbps. + // Not applicable to thumbnails. {Codec} - The type of the audio/video codec. {Resolution} - The video resolution. Any unsubstituted + // macros will be collapsed and removed from the filename. FilenamePattern *string `json:"filenamePattern,omitempty"` // REQUIRED; The discriminator for derived types. @@ -3587,15 +3656,16 @@ func (o *Overlay) GetOverlay() *Overlay { return o } // PNGFormat - Describes the settings for producing PNG thumbnails. type PNGFormat struct { - // REQUIRED; The pattern of the file names for the generated output files. The following macros are supported in the file + // REQUIRED; The file naming pattern used for the creation of output files. The following macros are supported in the file // name: {Basename} - An expansion macro that will use the name of the input video file. If // the base name(the file suffix is not included) of the input video file is less than 32 characters long, the base name of // input video files will be used. If the length of base name of the input video // file exceeds 32 characters, the base name is truncated to the first 32 characters in total length. {Extension} - The appropriate // extension for this format. {Label} - The label assigned to the - // codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video bitrate. - // Not applicable to thumbnails. {Codec} - The type of the audio/video codec. - // {Resolution} - The video resolution. Any unsubstituted macros will be collapsed and removed from the filename. + // codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {AudioStream} - string "Audio" plus + // audio stream number(start from 1). {Bitrate} - The audio/video bitrate in kbps. + // Not applicable to thumbnails. {Codec} - The type of the audio/video codec. {Resolution} - The video resolution. Any unsubstituted + // macros will be collapsed and removed from the filename. FilenamePattern *string `json:"filenamePattern,omitempty"` // REQUIRED; The discriminator for derived types. @@ -4104,6 +4174,9 @@ type StandardEncoderPreset struct { // REQUIRED; The discriminator for derived types. ODataType *string `json:"@odata.type,omitempty"` + // Dictionary containing key value pairs for parameters not exposed in the preset itself + ExperimentalOptions map[string]*string `json:"experimentalOptions,omitempty"` + // One or more filtering operations that are applied to the input media before encoding. Filters *Filters `json:"filters,omitempty"` } @@ -4848,15 +4921,16 @@ type TransformsClientUpdateOptions struct { // TransportStreamFormat - Describes the properties for generating an MPEG-2 Transport Stream (ISO/IEC 13818-1) output video // file(s). type TransportStreamFormat struct { - // REQUIRED; The pattern of the file names for the generated output files. The following macros are supported in the file + // REQUIRED; The file naming pattern used for the creation of output files. The following macros are supported in the file // name: {Basename} - An expansion macro that will use the name of the input video file. If // the base name(the file suffix is not included) of the input video file is less than 32 characters long, the base name of // input video files will be used. If the length of base name of the input video // file exceeds 32 characters, the base name is truncated to the first 32 characters in total length. {Extension} - The appropriate // extension for this format. {Label} - The label assigned to the - // codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video bitrate. - // Not applicable to thumbnails. {Codec} - The type of the audio/video codec. - // {Resolution} - The video resolution. Any unsubstituted macros will be collapsed and removed from the filename. + // codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {AudioStream} - string "Audio" plus + // audio stream number(start from 1). {Bitrate} - The audio/video bitrate in kbps. + // Not applicable to thumbnails. {Codec} - The type of the audio/video codec. {Resolution} - The video resolution. Any unsubstituted + // macros will be collapsed and removed from the filename. FilenamePattern *string `json:"filenamePattern,omitempty"` // REQUIRED; The discriminator for derived types. diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/models_serde.go b/sdk/resourcemanager/mediaservices/armmediaservices/models_serde.go index 77870e2f35de..d91e1a7520da 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/models_serde.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/models_serde.go @@ -2481,6 +2481,49 @@ func (c *CrossSiteAccessPolicies) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type DDAudio. +func (d DDAudio) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "bitrate", d.Bitrate) + populate(objectMap, "channels", d.Channels) + populate(objectMap, "label", d.Label) + objectMap["@odata.type"] = "#Microsoft.Media.DDAudio" + populate(objectMap, "samplingRate", d.SamplingRate) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DDAudio. +func (d *DDAudio) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "bitrate": + err = unpopulate(val, "Bitrate", &d.Bitrate) + delete(rawMsg, key) + case "channels": + err = unpopulate(val, "Channels", &d.Channels) + delete(rawMsg, key) + case "label": + err = unpopulate(val, "Label", &d.Label) + delete(rawMsg, key) + case "@odata.type": + err = unpopulate(val, "ODataType", &d.ODataType) + delete(rawMsg, key) + case "samplingRate": + err = unpopulate(val, "SamplingRate", &d.SamplingRate) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type DashSettings. func (d DashSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -2928,6 +2971,41 @@ func (f *FaceDetectorPreset) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type Fade. +func (f Fade) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "duration", f.Duration) + populate(objectMap, "fadeColor", f.FadeColor) + populate(objectMap, "start", f.Start) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Fade. +func (f *Fade) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "duration": + err = unpopulate(val, "Duration", &f.Duration) + delete(rawMsg, key) + case "fadeColor": + err = unpopulate(val, "FadeColor", &f.FadeColor) + delete(rawMsg, key) + case "start": + err = unpopulate(val, "Start", &f.Start) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type FilterTrackPropertyCondition. func (f FilterTrackPropertyCondition) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -2995,6 +3073,8 @@ func (f Filters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "crop", f.Crop) populate(objectMap, "deinterlace", f.Deinterlace) + populate(objectMap, "fadeIn", f.FadeIn) + populate(objectMap, "fadeOut", f.FadeOut) populate(objectMap, "overlays", f.Overlays) populate(objectMap, "rotation", f.Rotation) return json.Marshal(objectMap) @@ -3015,6 +3095,12 @@ func (f *Filters) UnmarshalJSON(data []byte) error { case "deinterlace": err = unpopulate(val, "Deinterlace", &f.Deinterlace) delete(rawMsg, key) + case "fadeIn": + err = unpopulate(val, "FadeIn", &f.FadeIn) + delete(rawMsg, key) + case "fadeOut": + err = unpopulate(val, "FadeOut", &f.FadeOut) + delete(rawMsg, key) case "overlays": f.Overlays, err = unmarshalOverlayClassificationArray(val) delete(rawMsg, key) @@ -6926,6 +7012,7 @@ func (s *ServiceSpecification) UnmarshalJSON(data []byte) error { func (s StandardEncoderPreset) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "codecs", s.Codecs) + populate(objectMap, "experimentalOptions", s.ExperimentalOptions) populate(objectMap, "filters", s.Filters) populate(objectMap, "formats", s.Formats) objectMap["@odata.type"] = "#Microsoft.Media.StandardEncoderPreset" @@ -6944,6 +7031,9 @@ func (s *StandardEncoderPreset) UnmarshalJSON(data []byte) error { case "codecs": s.Codecs, err = unmarshalCodecClassificationArray(val) delete(rawMsg, key) + case "experimentalOptions": + err = unpopulate(val, "ExperimentalOptions", &s.ExperimentalOptions) + delete(rawMsg, key) case "filters": err = unpopulate(val, "Filters", &s.Filters) delete(rawMsg, key) 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 eebb68bb06d2..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/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_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/operations_client_example_test.go deleted file mode 100644 index 0a1f77d3370c..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/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_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/operationstatuses_client_example_test.go deleted file mode 100644 index 012502625648..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/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/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/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 cc24ff5a42b0..bcdcadcdf0ba 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/polymorphic_helpers.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/polymorphic_helpers.go @@ -49,6 +49,8 @@ func unmarshalCodecClassification(rawMsg json.RawMessage) (CodecClassification, b = &CopyAudio{} case "#Microsoft.Media.CopyVideo": b = &CopyVideo{} + case "#Microsoft.Media.DDAudio": + b = &DDAudio{} case "#Microsoft.Media.H264Video": b = &H264Video{} case "#Microsoft.Media.H265Video": 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 c1d67f8f9643..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/stable/2021-11-01/examples/private-endpoint-connection-list.json -func ExamplePrivateEndpointConnectionsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewPrivateEndpointConnectionsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, "contoso", "contososports", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/private-endpoint-connection-get-by-name.json -func ExamplePrivateEndpointConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewPrivateEndpointConnectionsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "contoso", "contososports", "connectionName1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/private-endpoint-connection-put.json -func ExamplePrivateEndpointConnectionsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewPrivateEndpointConnectionsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, "contoso", "contososports", "connectionName1", armmediaservices.PrivateEndpointConnection{ - Properties: &armmediaservices.PrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armmediaservices.PrivateLinkServiceConnectionState{ - Description: to.Ptr("Test description."), - Status: to.Ptr(armmediaservices.PrivateEndpointServiceConnectionStatusApproved), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/private-endpoint-connection-delete.json -func ExamplePrivateEndpointConnectionsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewPrivateEndpointConnectionsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, "contoso", "contososports", "connectionName1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/privatelinkresources_client_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/privatelinkresources_client_example_test.go deleted file mode 100644 index 7f0d42049776..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/stable/2021-11-01/examples/private-link-resources-list.json -func ExamplePrivateLinkResourcesClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewPrivateLinkResourcesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, "contoso", "contososports", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/private-link-resources-get-by-name.json -func ExamplePrivateLinkResourcesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewPrivateLinkResourcesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "contoso", "contososports", "keydelivery", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/streamingendpoints_client.go b/sdk/resourcemanager/mediaservices/armmediaservices/streamingendpoints_client.go index 6da520c28283..67be18e4854d 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/streamingendpoints_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/streamingendpoints_client.go @@ -320,7 +320,6 @@ func (client *StreamingEndpointsClient) getHandleResponse(resp *http.Response) ( } // NewListPager - Lists the streaming endpoints in the account. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. 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 fbcfaac1a9e6..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/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/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/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/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/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/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/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/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/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/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/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 27705bd9fcfb..28451c258e26 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/streaminglocators_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/streaminglocators_client.go @@ -234,7 +234,6 @@ func (client *StreamingLocatorsClient) getHandleResponse(resp *http.Response) (S } // NewListPager - Lists the Streaming Locators in the account -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. 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 a883ade5bde3..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/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/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/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/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/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/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/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/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/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 7b5dabb412d4..7ce608bd6d54 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/streamingpolicies_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/streamingpolicies_client.go @@ -234,7 +234,6 @@ func (client *StreamingPoliciesClient) getHandleResponse(resp *http.Response) (S } // NewListPager - Lists the Streaming Policies in the account -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. 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 d320d0fca9f2..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/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/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/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/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/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/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/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/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/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/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/tracks_client.go b/sdk/resourcemanager/mediaservices/armmediaservices/tracks_client.go index b1b6cdc24765..65f999315e4e 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/tracks_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/tracks_client.go @@ -268,7 +268,6 @@ func (client *TracksClient) getHandleResponse(resp *http.Response) (TracksClient } // NewListPager - Lists the Tracks in the asset -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-08-01 // resourceGroupName - The name of the resource group within the Azure subscription. // accountName - The Media Services account name. 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 03ff1e84d873..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/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/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/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/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/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/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 af8af88707d6..40f5ad0062d6 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/transforms_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/transforms_client.go @@ -57,7 +57,7 @@ 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 2021-11-01 +// 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. @@ -103,7 +103,7 @@ func (client *TransformsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -120,7 +120,7 @@ func (client *TransformsClient) createOrUpdateHandleResponse(resp *http.Response // Delete - Deletes a Transform. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// 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. @@ -164,7 +164,7 @@ func (client *TransformsClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -172,7 +172,7 @@ 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 2021-11-01 +// 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. @@ -216,7 +216,7 @@ func (client *TransformsClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -232,8 +232,7 @@ func (client *TransformsClient) getHandleResponse(resp *http.Response) (Transfor } // NewListPager - Lists the Transforms in the account. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-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. @@ -285,7 +284,7 @@ func (client *TransformsClient) listCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-07-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -308,7 +307,7 @@ 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 2021-11-01 +// 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. @@ -353,7 +352,7 @@ func (client *TransformsClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/transforms_client_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/transforms_client_example_test.go deleted file mode 100644 index 6e708708dd03..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/stable/2021-11-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/stable/2021-11-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-11-01T00:00:00.0000000Z and properties/created le 2021-11-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/stable/2021-11-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-11-01T00:00:00.0000000Z and properties/lastmodified le 2021-11-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/stable/2021-11-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/stable/2021-11-01/examples/transforms-get-by-name.json -func ExampleTransformsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewTransformsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "contosoresources", "contosomedia", "sampleTransform", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/transforms-create.json -func ExampleTransformsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewTransformsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, "contosoresources", "contosomedia", "createdTransform", armmediaservices.Transform{ - Properties: &armmediaservices.TransformProperties{ - Description: to.Ptr("Example Transform to illustrate create and update."), - Outputs: []*armmediaservices.TransformOutput{ - { - Preset: &armmediaservices.BuiltInStandardEncoderPreset{ - ODataType: to.Ptr("#Microsoft.Media.BuiltInStandardEncoderPreset"), - PresetName: to.Ptr(armmediaservices.EncoderNamedPresetAdaptiveStreaming), - }, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/transforms-delete.json -func ExampleTransformsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewTransformsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, "contosoresources", "contosomedia", "sampleTransform", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/transforms-update.json -func ExampleTransformsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewTransformsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, "contosoresources", "contosomedia", "transformToUpdate", armmediaservices.Transform{ - Properties: &armmediaservices.TransformProperties{ - Description: to.Ptr("Example transform to illustrate update."), - Outputs: []*armmediaservices.TransformOutput{ - { - Preset: &armmediaservices.BuiltInStandardEncoderPreset{ - ODataType: to.Ptr("#Microsoft.Media.BuiltInStandardEncoderPreset"), - PresetName: to.Ptr(armmediaservices.EncoderNamedPresetH264MultipleBitrate720P), - }, - RelativePriority: to.Ptr(armmediaservices.PriorityHigh), - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -}