diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/CHANGELOG.md b/sdk/resourcemanager/mediaservices/armmediaservices/CHANGELOG.md index 15e00d3e9c92..38615b9de8b1 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/CHANGELOG.md +++ b/sdk/resourcemanager/mediaservices/armmediaservices/CHANGELOG.md @@ -1,5 +1,41 @@ # Release History +## 3.3.0 (2023-03-16) +### Features Added + +- New type alias `LiveEventHealthStatus` with values `LiveEventHealthStatusExcellent`, `LiveEventHealthStatusGood`, `LiveEventHealthStatusPoor` +- New type alias `LiveEventState` with values `LiveEventStateRunning`, `LiveEventStateStopped` +- New type alias `LiveEventStreamEventLevel` with values `LiveEventStreamEventLevelCritical`, `LiveEventStreamEventLevelError`, `LiveEventStreamEventLevelInformation`, `LiveEventStreamEventLevelWarning` +- New type alias `LiveEventStreamEventMaxTimeMediaType` with values `LiveEventStreamEventMaxTimeMediaTypeAudio`, `LiveEventStreamEventMaxTimeMediaTypeVideo` +- New type alias `LiveEventStreamEventMediaType` with values `LiveEventStreamEventMediaTypeAudio`, `LiveEventStreamEventMediaTypeVideo` +- New type alias `LiveEventStreamEventMinTimeMediaType` with values `LiveEventStreamEventMinTimeMediaTypeAudio`, `LiveEventStreamEventMinTimeMediaTypeVideo` +- New type alias `LiveEventStreamEventType` with values `LiveEventStreamEventTypeStreamEventBeginIngest`, `LiveEventStreamEventTypeStreamEventChunkDropped`, `LiveEventStreamEventTypeStreamEventDiscontinuity`, `LiveEventStreamEventTypeStreamEventEndIngest`, `LiveEventStreamEventTypeStreamEventFirstChunkReceived`, `LiveEventStreamEventTypeStreamEventInvalidConnection`, `LiveEventStreamEventTypeStreamEventUnalignedKeyFrames`, `LiveEventStreamEventTypeStreamEventUnalignedPresentation` +- New type alias `LiveEventTrackEventType` with values `LiveEventTrackEventTypeTrackEventIngestHeartbeat` +- New type alias `LiveEventTrackType` with values `LiveEventTrackTypeAudio`, `LiveEventTrackTypeVideo` +- New type alias `MinimumTLSVersion` with values `MinimumTLSVersionTls10`, `MinimumTLSVersionTls11`, `MinimumTLSVersionTls12`, `MinimumTLSVersionTls13` +- New function `*LiveEventsClient.BeginListGetStatus(context.Context, string, string, string, *LiveEventsClientBeginListGetStatusOptions) (*runtime.Poller[*runtime.Pager[LiveEventsClientListGetStatusResponse]], error)` +- New function `*LiveEventsClient.BeginListGetStreamEvents(context.Context, string, string, string, *LiveEventsClientBeginListGetStreamEventsOptions) (*runtime.Poller[*runtime.Pager[LiveEventsClientListGetStreamEventsResponse]], error)` +- New function `*LiveEventsClient.BeginListGetTrackIngestHeartbeats(context.Context, string, string, string, *LiveEventsClientBeginListGetTrackIngestHeartbeatsOptions) (*runtime.Poller[*runtime.Pager[LiveEventsClientListGetTrackIngestHeartbeatsResponse]], error)` +- New struct `LiveEventGetStatusResult` +- New struct `LiveEventGetStreamEventsResult` +- New struct `LiveEventGetTrackIngestHeartbeatsResult` +- New struct `LiveEventIngestInterruption` +- New struct `LiveEventIngestion` +- New struct `LiveEventStatus` +- New struct `LiveEventStreamEvent` +- New struct `LiveEventStreamEventData` +- New struct `LiveEventTimedMetadataEndpoint` +- New struct `LiveEventTrackEvent` +- New struct `LiveEventTrackEventData` +- New struct `LiveEventTrackStatus` +- New struct `LiveEventsClientListGetStatusResponse` +- New struct `LiveEventsClientListGetStreamEventsResponse` +- New struct `LiveEventsClientListGetTrackIngestHeartbeatsResponse` +- New field `EncryptionScope` in struct `AssetProperties` +- New field `TimedMetadataEndpoints` in struct `LiveEventInput` +- New field `MinimumTLSVersion` in struct `MediaServiceProperties` + + ## 3.2.0 (2023-01-13) ### Features Added diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/accountfilters_client.go b/sdk/resourcemanager/mediaservices/armmediaservices/accountfilters_client.go index ab6660e24877..a38ad4ca1a7e 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/accountfilters_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/accountfilters_client.go @@ -32,9 +32,9 @@ type AccountFiltersClient struct { } // NewAccountFiltersClient creates a new instance of AccountFiltersClient with the specified values. -// subscriptionID - The unique identifier for a Microsoft Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The unique identifier for a Microsoft Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAccountFiltersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AccountFiltersClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,13 +57,14 @@ func NewAccountFiltersClient(subscriptionID string, credential azcore.TokenCrede // CreateOrUpdate - Creates or updates an Account Filter in the Media Services account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// filterName - The Account Filter name -// parameters - The request parameters -// options - AccountFiltersClientCreateOrUpdateOptions contains the optional parameters for the AccountFiltersClient.CreateOrUpdate -// method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - filterName - The Account Filter name +// - parameters - The request parameters +// - options - AccountFiltersClientCreateOrUpdateOptions contains the optional parameters for the AccountFiltersClient.CreateOrUpdate +// method. func (client *AccountFiltersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, filterName string, parameters AccountFilter, options *AccountFiltersClientCreateOrUpdateOptions) (AccountFiltersClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, accountName, filterName, parameters, options) if err != nil { @@ -103,7 +104,7 @@ func (client *AccountFiltersClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -120,11 +121,12 @@ func (client *AccountFiltersClient) createOrUpdateHandleResponse(resp *http.Resp // Delete - Deletes an Account Filter in the Media Services account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// filterName - The Account Filter name -// options - AccountFiltersClientDeleteOptions contains the optional parameters for the AccountFiltersClient.Delete method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - filterName - The Account Filter name +// - options - AccountFiltersClientDeleteOptions contains the optional parameters for the AccountFiltersClient.Delete method. func (client *AccountFiltersClient) Delete(ctx context.Context, resourceGroupName string, accountName string, filterName string, options *AccountFiltersClientDeleteOptions) (AccountFiltersClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, filterName, options) if err != nil { @@ -164,7 +166,7 @@ func (client *AccountFiltersClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -172,11 +174,12 @@ func (client *AccountFiltersClient) deleteCreateRequest(ctx context.Context, res // Get - Get the details of an Account Filter in the Media Services account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// filterName - The Account Filter name -// options - AccountFiltersClientGetOptions contains the optional parameters for the AccountFiltersClient.Get method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - filterName - The Account Filter name +// - options - AccountFiltersClientGetOptions contains the optional parameters for the AccountFiltersClient.Get method. func (client *AccountFiltersClient) Get(ctx context.Context, resourceGroupName string, accountName string, filterName string, options *AccountFiltersClientGetOptions) (AccountFiltersClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, filterName, options) if err != nil { @@ -216,7 +219,7 @@ func (client *AccountFiltersClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -232,10 +235,11 @@ func (client *AccountFiltersClient) getHandleResponse(resp *http.Response) (Acco } // NewListPager - List Account Filters in the Media Services account. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// options - AccountFiltersClientListOptions contains the optional parameters for the AccountFiltersClient.List method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - options - AccountFiltersClientListOptions contains the optional parameters for the AccountFiltersClient.NewListPager method. func (client *AccountFiltersClient) NewListPager(resourceGroupName string, accountName string, options *AccountFiltersClientListOptions) *runtime.Pager[AccountFiltersClientListResponse] { return runtime.NewPager(runtime.PagingHandler[AccountFiltersClientListResponse]{ More: func(page AccountFiltersClientListResponse) bool { @@ -284,7 +288,7 @@ func (client *AccountFiltersClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -301,12 +305,13 @@ func (client *AccountFiltersClient) listHandleResponse(resp *http.Response) (Acc // Update - Updates an existing Account Filter in the Media Services account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// filterName - The Account Filter name -// parameters - The request parameters -// options - AccountFiltersClientUpdateOptions contains the optional parameters for the AccountFiltersClient.Update method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - filterName - The Account Filter name +// - parameters - The request parameters +// - options - AccountFiltersClientUpdateOptions contains the optional parameters for the AccountFiltersClient.Update method. func (client *AccountFiltersClient) Update(ctx context.Context, resourceGroupName string, accountName string, filterName string, parameters AccountFilter, options *AccountFiltersClientUpdateOptions) (AccountFiltersClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, filterName, parameters, options) if err != nil { @@ -346,7 +351,7 @@ func (client *AccountFiltersClient) updateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/accountfilters_client_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/accountfilters_client_example_test.go deleted file mode 100644 index 6fa9661de8eb..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/accountfilters_client_example_test.go +++ /dev/null @@ -1,176 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armmediaservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mediaservices/armmediaservices/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/accountFilters-list-all.json -func ExampleAccountFiltersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewAccountFiltersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("contoso", "contosomedia", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/accountFilters-get-by-name.json -func ExampleAccountFiltersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewAccountFiltersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "contoso", "contosomedia", "accountFilterWithTrack", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/accountFilters-create.json -func ExampleAccountFiltersClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewAccountFiltersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, "contoso", "contosomedia", "newAccountFilter", armmediaservices.AccountFilter{ - Properties: &armmediaservices.MediaFilterProperties{ - FirstQuality: &armmediaservices.FirstQuality{ - Bitrate: to.Ptr[int32](128000), - }, - PresentationTimeRange: &armmediaservices.PresentationTimeRange{ - EndTimestamp: to.Ptr[int64](170000000), - ForceEndTimestamp: to.Ptr(false), - LiveBackoffDuration: to.Ptr[int64](0), - PresentationWindowDuration: to.Ptr[int64](9223372036854775000), - StartTimestamp: to.Ptr[int64](0), - Timescale: to.Ptr[int64](10000000), - }, - Tracks: []*armmediaservices.FilterTrackSelection{ - { - TrackSelections: []*armmediaservices.FilterTrackPropertyCondition{ - { - Operation: to.Ptr(armmediaservices.FilterTrackPropertyCompareOperationEqual), - Property: to.Ptr(armmediaservices.FilterTrackPropertyTypeType), - Value: to.Ptr("Audio"), - }, - { - Operation: to.Ptr(armmediaservices.FilterTrackPropertyCompareOperationNotEqual), - Property: to.Ptr(armmediaservices.FilterTrackPropertyTypeLanguage), - Value: to.Ptr("en"), - }, - { - Operation: to.Ptr(armmediaservices.FilterTrackPropertyCompareOperationNotEqual), - Property: to.Ptr(armmediaservices.FilterTrackPropertyTypeFourCC), - Value: to.Ptr("EC-3"), - }}, - }, - { - TrackSelections: []*armmediaservices.FilterTrackPropertyCondition{ - { - Operation: to.Ptr(armmediaservices.FilterTrackPropertyCompareOperationEqual), - Property: to.Ptr(armmediaservices.FilterTrackPropertyTypeType), - Value: to.Ptr("Video"), - }, - { - Operation: to.Ptr(armmediaservices.FilterTrackPropertyCompareOperationEqual), - Property: to.Ptr(armmediaservices.FilterTrackPropertyTypeBitrate), - Value: to.Ptr("3000000-5000000"), - }}, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/accountFilters-delete.json -func ExampleAccountFiltersClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewAccountFiltersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, "contoso", "contosomedia", "accountFilterWithTimeWindowAndTrack", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/accountFilters-update.json -func ExampleAccountFiltersClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewAccountFiltersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, "contoso", "contosomedia", "accountFilterWithTimeWindowAndTrack", armmediaservices.AccountFilter{ - Properties: &armmediaservices.MediaFilterProperties{ - FirstQuality: &armmediaservices.FirstQuality{ - Bitrate: to.Ptr[int32](128000), - }, - PresentationTimeRange: &armmediaservices.PresentationTimeRange{ - EndTimestamp: to.Ptr[int64](170000000), - ForceEndTimestamp: to.Ptr(false), - LiveBackoffDuration: to.Ptr[int64](0), - PresentationWindowDuration: to.Ptr[int64](9223372036854775000), - StartTimestamp: to.Ptr[int64](10), - Timescale: to.Ptr[int64](10000000), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/assetfilters_client.go b/sdk/resourcemanager/mediaservices/armmediaservices/assetfilters_client.go index 9976359f527b..c679ae7f51c8 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/assetfilters_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/assetfilters_client.go @@ -32,9 +32,9 @@ type AssetFiltersClient struct { } // NewAssetFiltersClient creates a new instance of AssetFiltersClient with the specified values. -// subscriptionID - The unique identifier for a Microsoft Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The unique identifier for a Microsoft Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAssetFiltersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AssetFiltersClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,14 +57,15 @@ func NewAssetFiltersClient(subscriptionID string, credential azcore.TokenCredent // CreateOrUpdate - Creates or updates an Asset Filter associated with the specified Asset. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// assetName - The Asset name. -// filterName - The Asset Filter name -// parameters - The request parameters -// options - AssetFiltersClientCreateOrUpdateOptions contains the optional parameters for the AssetFiltersClient.CreateOrUpdate -// method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - assetName - The Asset name. +// - filterName - The Asset Filter name +// - parameters - The request parameters +// - options - AssetFiltersClientCreateOrUpdateOptions contains the optional parameters for the AssetFiltersClient.CreateOrUpdate +// method. func (client *AssetFiltersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, assetName string, filterName string, parameters AssetFilter, options *AssetFiltersClientCreateOrUpdateOptions) (AssetFiltersClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, accountName, assetName, filterName, parameters, options) if err != nil { @@ -108,7 +109,7 @@ func (client *AssetFiltersClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -125,12 +126,13 @@ func (client *AssetFiltersClient) createOrUpdateHandleResponse(resp *http.Respon // Delete - Deletes an Asset Filter associated with the specified Asset. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// assetName - The Asset name. -// filterName - The Asset Filter name -// options - AssetFiltersClientDeleteOptions contains the optional parameters for the AssetFiltersClient.Delete method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - assetName - The Asset name. +// - filterName - The Asset Filter name +// - options - AssetFiltersClientDeleteOptions contains the optional parameters for the AssetFiltersClient.Delete method. func (client *AssetFiltersClient) Delete(ctx context.Context, resourceGroupName string, accountName string, assetName string, filterName string, options *AssetFiltersClientDeleteOptions) (AssetFiltersClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, assetName, filterName, options) if err != nil { @@ -174,7 +176,7 @@ func (client *AssetFiltersClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -182,12 +184,13 @@ func (client *AssetFiltersClient) deleteCreateRequest(ctx context.Context, resou // Get - Get the details of an Asset Filter associated with the specified Asset. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// assetName - The Asset name. -// filterName - The Asset Filter name -// options - AssetFiltersClientGetOptions contains the optional parameters for the AssetFiltersClient.Get method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - assetName - The Asset name. +// - filterName - The Asset Filter name +// - options - AssetFiltersClientGetOptions contains the optional parameters for the AssetFiltersClient.Get method. func (client *AssetFiltersClient) Get(ctx context.Context, resourceGroupName string, accountName string, assetName string, filterName string, options *AssetFiltersClientGetOptions) (AssetFiltersClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, assetName, filterName, options) if err != nil { @@ -231,7 +234,7 @@ func (client *AssetFiltersClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -247,11 +250,12 @@ func (client *AssetFiltersClient) getHandleResponse(resp *http.Response) (AssetF } // NewListPager - List Asset Filters associated with the specified Asset. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// assetName - The Asset name. -// options - AssetFiltersClientListOptions contains the optional parameters for the AssetFiltersClient.List method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - assetName - The Asset name. +// - options - AssetFiltersClientListOptions contains the optional parameters for the AssetFiltersClient.NewListPager method. func (client *AssetFiltersClient) NewListPager(resourceGroupName string, accountName string, assetName string, options *AssetFiltersClientListOptions) *runtime.Pager[AssetFiltersClientListResponse] { return runtime.NewPager(runtime.PagingHandler[AssetFiltersClientListResponse]{ More: func(page AssetFiltersClientListResponse) bool { @@ -304,7 +308,7 @@ func (client *AssetFiltersClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -321,13 +325,14 @@ func (client *AssetFiltersClient) listHandleResponse(resp *http.Response) (Asset // Update - Updates an existing Asset Filter associated with the specified Asset. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// assetName - The Asset name. -// filterName - The Asset Filter name -// parameters - The request parameters -// options - AssetFiltersClientUpdateOptions contains the optional parameters for the AssetFiltersClient.Update method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - assetName - The Asset name. +// - filterName - The Asset Filter name +// - parameters - The request parameters +// - options - AssetFiltersClientUpdateOptions contains the optional parameters for the AssetFiltersClient.Update method. func (client *AssetFiltersClient) Update(ctx context.Context, resourceGroupName string, accountName string, assetName string, filterName string, parameters AssetFilter, options *AssetFiltersClientUpdateOptions) (AssetFiltersClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, assetName, filterName, parameters, options) if err != nil { @@ -371,7 +376,7 @@ func (client *AssetFiltersClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/assetfilters_client_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/assetfilters_client_example_test.go deleted file mode 100644 index 6112557c9a56..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/assetfilters_client_example_test.go +++ /dev/null @@ -1,176 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armmediaservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mediaservices/armmediaservices/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assetFilters-list-all.json -func ExampleAssetFiltersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewAssetFiltersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("contoso", "contosomedia", "ClimbingMountRainer", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assetFilters-get-by-name.json -func ExampleAssetFiltersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewAssetFiltersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "contoso", "contosomedia", "ClimbingMountRainer", "assetFilterWithTimeWindowAndTrack", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assetFilters-create.json -func ExampleAssetFiltersClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewAssetFiltersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, "contoso", "contosomedia", "ClimbingMountRainer", "newAssetFilter", armmediaservices.AssetFilter{ - Properties: &armmediaservices.MediaFilterProperties{ - FirstQuality: &armmediaservices.FirstQuality{ - Bitrate: to.Ptr[int32](128000), - }, - PresentationTimeRange: &armmediaservices.PresentationTimeRange{ - EndTimestamp: to.Ptr[int64](170000000), - ForceEndTimestamp: to.Ptr(false), - LiveBackoffDuration: to.Ptr[int64](0), - PresentationWindowDuration: to.Ptr[int64](9223372036854775000), - StartTimestamp: to.Ptr[int64](0), - Timescale: to.Ptr[int64](10000000), - }, - Tracks: []*armmediaservices.FilterTrackSelection{ - { - TrackSelections: []*armmediaservices.FilterTrackPropertyCondition{ - { - Operation: to.Ptr(armmediaservices.FilterTrackPropertyCompareOperationEqual), - Property: to.Ptr(armmediaservices.FilterTrackPropertyTypeType), - Value: to.Ptr("Audio"), - }, - { - Operation: to.Ptr(armmediaservices.FilterTrackPropertyCompareOperationNotEqual), - Property: to.Ptr(armmediaservices.FilterTrackPropertyTypeLanguage), - Value: to.Ptr("en"), - }, - { - Operation: to.Ptr(armmediaservices.FilterTrackPropertyCompareOperationNotEqual), - Property: to.Ptr(armmediaservices.FilterTrackPropertyTypeFourCC), - Value: to.Ptr("EC-3"), - }}, - }, - { - TrackSelections: []*armmediaservices.FilterTrackPropertyCondition{ - { - Operation: to.Ptr(armmediaservices.FilterTrackPropertyCompareOperationEqual), - Property: to.Ptr(armmediaservices.FilterTrackPropertyTypeType), - Value: to.Ptr("Video"), - }, - { - Operation: to.Ptr(armmediaservices.FilterTrackPropertyCompareOperationEqual), - Property: to.Ptr(armmediaservices.FilterTrackPropertyTypeBitrate), - Value: to.Ptr("3000000-5000000"), - }}, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assetFilters-delete.json -func ExampleAssetFiltersClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewAssetFiltersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, "contoso", "contosomedia", "ClimbingMountRainer", "assetFilterWithTimeWindowAndTrack", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assetFilters-update.json -func ExampleAssetFiltersClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewAssetFiltersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, "contoso", "contosomedia", "ClimbingMountRainer", "assetFilterWithTimeWindowAndTrack", armmediaservices.AssetFilter{ - Properties: &armmediaservices.MediaFilterProperties{ - FirstQuality: &armmediaservices.FirstQuality{ - Bitrate: to.Ptr[int32](128000), - }, - PresentationTimeRange: &armmediaservices.PresentationTimeRange{ - EndTimestamp: to.Ptr[int64](170000000), - ForceEndTimestamp: to.Ptr(false), - LiveBackoffDuration: to.Ptr[int64](0), - PresentationWindowDuration: to.Ptr[int64](9223372036854775000), - StartTimestamp: to.Ptr[int64](10), - Timescale: to.Ptr[int64](10000000), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/assets_client.go b/sdk/resourcemanager/mediaservices/armmediaservices/assets_client.go index 2bbc116ffe11..e62041c49762 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/assets_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/assets_client.go @@ -33,9 +33,9 @@ type AssetsClient struct { } // NewAssetsClient creates a new instance of AssetsClient with the specified values. -// subscriptionID - The unique identifier for a Microsoft Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The unique identifier for a Microsoft Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAssetsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AssetsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,12 +58,13 @@ func NewAssetsClient(subscriptionID string, credential azcore.TokenCredential, o // CreateOrUpdate - Creates or updates an Asset in the Media Services account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// assetName - The Asset name. -// parameters - The request parameters -// options - AssetsClientCreateOrUpdateOptions contains the optional parameters for the AssetsClient.CreateOrUpdate method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - assetName - The Asset name. +// - parameters - The request parameters +// - options - AssetsClientCreateOrUpdateOptions contains the optional parameters for the AssetsClient.CreateOrUpdate method. func (client *AssetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, assetName string, parameters Asset, options *AssetsClientCreateOrUpdateOptions) (AssetsClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, accountName, assetName, parameters, options) if err != nil { @@ -103,7 +104,7 @@ func (client *AssetsClient) createOrUpdateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -120,11 +121,12 @@ func (client *AssetsClient) createOrUpdateHandleResponse(resp *http.Response) (A // Delete - Deletes an Asset in the Media Services account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// assetName - The Asset name. -// options - AssetsClientDeleteOptions contains the optional parameters for the AssetsClient.Delete method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - assetName - The Asset name. +// - options - AssetsClientDeleteOptions contains the optional parameters for the AssetsClient.Delete method. func (client *AssetsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, assetName string, options *AssetsClientDeleteOptions) (AssetsClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, assetName, options) if err != nil { @@ -164,7 +166,7 @@ func (client *AssetsClient) deleteCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -172,11 +174,12 @@ func (client *AssetsClient) deleteCreateRequest(ctx context.Context, resourceGro // Get - Get the details of an Asset in the Media Services account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// assetName - The Asset name. -// options - AssetsClientGetOptions contains the optional parameters for the AssetsClient.Get method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - assetName - The Asset name. +// - options - AssetsClientGetOptions contains the optional parameters for the AssetsClient.Get method. func (client *AssetsClient) Get(ctx context.Context, resourceGroupName string, accountName string, assetName string, options *AssetsClientGetOptions) (AssetsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, assetName, options) if err != nil { @@ -216,7 +219,7 @@ func (client *AssetsClient) getCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -234,11 +237,12 @@ func (client *AssetsClient) getHandleResponse(resp *http.Response) (AssetsClient // GetEncryptionKey - Gets the Asset storage encryption keys used to decrypt content created by version 2 of the Media Services // API // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// assetName - The Asset name. -// options - AssetsClientGetEncryptionKeyOptions contains the optional parameters for the AssetsClient.GetEncryptionKey method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - assetName - The Asset name. +// - options - AssetsClientGetEncryptionKeyOptions contains the optional parameters for the AssetsClient.GetEncryptionKey method. func (client *AssetsClient) GetEncryptionKey(ctx context.Context, resourceGroupName string, accountName string, assetName string, options *AssetsClientGetEncryptionKeyOptions) (AssetsClientGetEncryptionKeyResponse, error) { req, err := client.getEncryptionKeyCreateRequest(ctx, resourceGroupName, accountName, assetName, options) if err != nil { @@ -278,7 +282,7 @@ func (client *AssetsClient) getEncryptionKeyCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -294,10 +298,11 @@ func (client *AssetsClient) getEncryptionKeyHandleResponse(resp *http.Response) } // NewListPager - List Assets in the Media Services account with optional filtering and ordering -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// options - AssetsClientListOptions contains the optional parameters for the AssetsClient.List method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - options - AssetsClientListOptions contains the optional parameters for the AssetsClient.NewListPager method. func (client *AssetsClient) NewListPager(resourceGroupName string, accountName string, options *AssetsClientListOptions) *runtime.Pager[AssetsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[AssetsClientListResponse]{ More: func(page AssetsClientListResponse) bool { @@ -346,7 +351,7 @@ func (client *AssetsClient) listCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2023-01-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -373,12 +378,13 @@ func (client *AssetsClient) listHandleResponse(resp *http.Response) (AssetsClien // ListContainerSas - Lists storage container URLs with shared access signatures (SAS) for uploading and downloading Asset // content. The signatures are derived from the storage account keys. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// assetName - The Asset name. -// parameters - The request parameters -// options - AssetsClientListContainerSasOptions contains the optional parameters for the AssetsClient.ListContainerSas method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - assetName - The Asset name. +// - parameters - The request parameters +// - options - AssetsClientListContainerSasOptions contains the optional parameters for the AssetsClient.ListContainerSas method. func (client *AssetsClient) ListContainerSas(ctx context.Context, resourceGroupName string, accountName string, assetName string, parameters ListContainerSasInput, options *AssetsClientListContainerSasOptions) (AssetsClientListContainerSasResponse, error) { req, err := client.listContainerSasCreateRequest(ctx, resourceGroupName, accountName, assetName, parameters, options) if err != nil { @@ -418,7 +424,7 @@ func (client *AssetsClient) listContainerSasCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -435,12 +441,13 @@ func (client *AssetsClient) listContainerSasHandleResponse(resp *http.Response) // ListStreamingLocators - Lists Streaming Locators which are associated with this asset. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// assetName - The Asset name. -// options - AssetsClientListStreamingLocatorsOptions contains the optional parameters for the AssetsClient.ListStreamingLocators -// method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - assetName - The Asset name. +// - options - AssetsClientListStreamingLocatorsOptions contains the optional parameters for the AssetsClient.ListStreamingLocators +// method. func (client *AssetsClient) ListStreamingLocators(ctx context.Context, resourceGroupName string, accountName string, assetName string, options *AssetsClientListStreamingLocatorsOptions) (AssetsClientListStreamingLocatorsResponse, error) { req, err := client.listStreamingLocatorsCreateRequest(ctx, resourceGroupName, accountName, assetName, options) if err != nil { @@ -480,7 +487,7 @@ func (client *AssetsClient) listStreamingLocatorsCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -497,12 +504,13 @@ func (client *AssetsClient) listStreamingLocatorsHandleResponse(resp *http.Respo // Update - Updates an existing Asset in the Media Services account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// assetName - The Asset name. -// parameters - The request parameters -// options - AssetsClientUpdateOptions contains the optional parameters for the AssetsClient.Update method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - assetName - The Asset name. +// - parameters - The request parameters +// - options - AssetsClientUpdateOptions contains the optional parameters for the AssetsClient.Update method. func (client *AssetsClient) Update(ctx context.Context, resourceGroupName string, accountName string, assetName string, parameters Asset, options *AssetsClientUpdateOptions) (AssetsClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, assetName, parameters, options) if err != nil { @@ -542,7 +550,7 @@ func (client *AssetsClient) updateCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/assets_client_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/assets_client_example_test.go deleted file mode 100644 index d0292b1ff69f..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/assets_client_example_test.go +++ /dev/null @@ -1,244 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armmediaservices_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mediaservices/armmediaservices/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-list-in-date-range.json -func ExampleAssetsClient_NewListPager_listAssetCreatedInADateRange() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewAssetsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("contoso", "contosomedia", &armmediaservices.AssetsClientListOptions{Filter: to.Ptr("properties/created gt 2012-06-01 and properties/created lt 2013-07-01"), - Top: nil, - Orderby: to.Ptr("properties/created"), - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-list-by-date.json -func ExampleAssetsClient_NewListPager_listAssetOrderedByDate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewAssetsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("contoso", "contosomedia", &armmediaservices.AssetsClientListOptions{Filter: nil, - Top: nil, - Orderby: to.Ptr("properties/created"), - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-list-all.json -func ExampleAssetsClient_NewListPager_listAllAssets() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewAssetsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("contoso", "contosomedia", &armmediaservices.AssetsClientListOptions{Filter: nil, - Top: nil, - Orderby: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-get-by-name.json -func ExampleAssetsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewAssetsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "contoso", "contosomedia", "ClimbingMountAdams", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-create.json -func ExampleAssetsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewAssetsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, "contoso", "contosomedia", "ClimbingMountLogan", armmediaservices.Asset{ - Properties: &armmediaservices.AssetProperties{ - Description: to.Ptr("A documentary showing the ascent of Mount Logan"), - StorageAccountName: to.Ptr("storage0"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-delete.json -func ExampleAssetsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewAssetsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, "contoso", "contosomedia", "ClimbingMountAdams", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-update.json -func ExampleAssetsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewAssetsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, "contoso", "contosomedia", "ClimbingMountBaker", armmediaservices.Asset{ - Properties: &armmediaservices.AssetProperties{ - Description: to.Ptr("A documentary showing the ascent of Mount Baker in HD"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-list-sas-urls.json -func ExampleAssetsClient_ListContainerSas() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewAssetsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListContainerSas(ctx, "contoso", "contosomedia", "ClimbingMountBaker", armmediaservices.ListContainerSasInput{ - ExpiryTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T10:00:00.007Z"); return t }()), - Permissions: to.Ptr(armmediaservices.AssetContainerPermissionReadWrite), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-get-encryption-keys.json -func ExampleAssetsClient_GetEncryptionKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewAssetsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetEncryptionKey(ctx, "contoso", "contosomedia", "ClimbingMountSaintHelens", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-list-streaming-locators.json -func ExampleAssetsClient_ListStreamingLocators() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewAssetsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListStreamingLocators(ctx, "contoso", "contosomedia", "ClimbingMountSaintHelens", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/assettrackoperationresults_client.go b/sdk/resourcemanager/mediaservices/armmediaservices/assettrackoperationresults_client.go index 5112c1fc2a74..b3453d1ad836 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/assettrackoperationresults_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/assettrackoperationresults_client.go @@ -33,9 +33,9 @@ type AssetTrackOperationResultsClient struct { } // NewAssetTrackOperationResultsClient creates a new instance of AssetTrackOperationResultsClient with the specified values. -// subscriptionID - The unique identifier for a Microsoft Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The unique identifier for a Microsoft Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAssetTrackOperationResultsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AssetTrackOperationResultsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,14 +58,15 @@ func NewAssetTrackOperationResultsClient(subscriptionID string, credential azcor // Get - Get asset track operation result. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// assetName - The Asset name. -// trackName - The Asset Track name. -// operationID - Operation Id. -// options - AssetTrackOperationResultsClientGetOptions contains the optional parameters for the AssetTrackOperationResultsClient.Get -// method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - assetName - The Asset name. +// - trackName - The Asset Track name. +// - operationID - Operation Id. +// - options - AssetTrackOperationResultsClientGetOptions contains the optional parameters for the AssetTrackOperationResultsClient.Get +// method. func (client *AssetTrackOperationResultsClient) Get(ctx context.Context, resourceGroupName string, accountName string, assetName string, trackName string, operationID string, options *AssetTrackOperationResultsClientGetOptions) (AssetTrackOperationResultsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, assetName, trackName, operationID, options) if err != nil { @@ -113,7 +114,7 @@ func (client *AssetTrackOperationResultsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/assettrackoperationresults_client_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/assettrackoperationresults_client_example_test.go deleted file mode 100644 index cf9e72c8eb3a..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/assettrackoperationresults_client_example_test.go +++ /dev/null @@ -1,36 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armmediaservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mediaservices/armmediaservices/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-operation-result-by-id.json -func ExampleAssetTrackOperationResultsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewAssetTrackOperationResultsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "contoso", "contosomedia", "ClimbingMountRainer", "text1", "e78f8d40-7aaa-4f2f-8ae6-73987e7c5a08", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/assettrackoperationstatuses_client.go b/sdk/resourcemanager/mediaservices/armmediaservices/assettrackoperationstatuses_client.go index b0b154abc42e..aed21fcac28d 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/assettrackoperationstatuses_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/assettrackoperationstatuses_client.go @@ -32,9 +32,9 @@ type AssetTrackOperationStatusesClient struct { } // NewAssetTrackOperationStatusesClient creates a new instance of AssetTrackOperationStatusesClient with the specified values. -// subscriptionID - The unique identifier for a Microsoft Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The unique identifier for a Microsoft Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAssetTrackOperationStatusesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AssetTrackOperationStatusesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,14 +57,15 @@ func NewAssetTrackOperationStatusesClient(subscriptionID string, credential azco // Get - Get asset track operation status. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// assetName - The Asset name. -// trackName - The Asset Track name. -// operationID - Operation Id. -// options - AssetTrackOperationStatusesClientGetOptions contains the optional parameters for the AssetTrackOperationStatusesClient.Get -// method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - assetName - The Asset name. +// - trackName - The Asset Track name. +// - operationID - Operation Id. +// - options - AssetTrackOperationStatusesClientGetOptions contains the optional parameters for the AssetTrackOperationStatusesClient.Get +// method. func (client *AssetTrackOperationStatusesClient) Get(ctx context.Context, resourceGroupName string, accountName string, assetName string, trackName string, operationID string, options *AssetTrackOperationStatusesClientGetOptions) (AssetTrackOperationStatusesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, assetName, trackName, operationID, options) if err != nil { @@ -112,7 +113,7 @@ func (client *AssetTrackOperationStatusesClient) getCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/assettrackoperationstatuses_client_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/assettrackoperationstatuses_client_example_test.go deleted file mode 100644 index 41137f0c8e50..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/assettrackoperationstatuses_client_example_test.go +++ /dev/null @@ -1,74 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armmediaservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mediaservices/armmediaservices/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-operation-status-by-id-terminal-state-failed.json -func ExampleAssetTrackOperationStatusesClient_Get_getStatusOfAsynchronousOperationWhenItIsCompletedWithError() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewAssetTrackOperationStatusesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "contoso", "contosomedia", "ClimbingMountRainer", "text1", "86835197-3b47-402e-b313-70b82eaba296", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-operation-status-by-id-terminal-state.json -func ExampleAssetTrackOperationStatusesClient_Get_getStatusOfAsynchronousOperationWhenItIsCompleted() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewAssetTrackOperationStatusesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "contoso", "contosomedia", "ClimbingMountRainer", "text1", "e78f8d40-7aaa-4f2f-8ae6-73987e7c5a08", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-operation-status-by-id-non-terminal-state.json -func ExampleAssetTrackOperationStatusesClient_Get_getStatusOfAsynchronousOperationWhenItIsOngoing() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewAssetTrackOperationStatusesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "contoso", "contosomedia", "ClimbingMountRainer", "text1", "5827d9a1-1fb4-4e54-ac40-8eeed9b862c8", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/autorest.md b/sdk/resourcemanager/mediaservices/armmediaservices/autorest.md index 9b1a90e57325..da33fa947f9e 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/autorest.md +++ b/sdk/resourcemanager/mediaservices/armmediaservices/autorest.md @@ -5,8 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/mediaservices/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/e7bf3adfa2d5e5cdbb804eec35279501794f461c/specification/mediaservices/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/mediaservices/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/mediaservices/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 3.2.0 +module-version: 3.3.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/client.go b/sdk/resourcemanager/mediaservices/armmediaservices/client.go index 670ef5004345..5006c01e6e6c 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/client.go @@ -32,9 +32,9 @@ type Client struct { } // NewClient creates a new instance of Client with the specified values. -// subscriptionID - The unique identifier for a Microsoft Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The unique identifier for a Microsoft Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*Client, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,11 +57,12 @@ func NewClient(subscriptionID string, credential azcore.TokenCredential, options // BeginCreateOrUpdate - Creates or updates a Media Services account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// parameters - The request parameters -// options - ClientBeginCreateOrUpdateOptions contains the optional parameters for the Client.BeginCreateOrUpdate method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - parameters - The request parameters +// - options - ClientBeginCreateOrUpdateOptions contains the optional parameters for the Client.BeginCreateOrUpdate method. func (client *Client) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, parameters MediaService, options *ClientBeginCreateOrUpdateOptions) (*runtime.Poller[ClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, accountName, parameters, options) @@ -76,7 +77,8 @@ func (client *Client) BeginCreateOrUpdate(ctx context.Context, resourceGroupName // CreateOrUpdate - Creates or updates a Media Services account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// +// Generated from API version 2023-01-01 func (client *Client) createOrUpdate(ctx context.Context, resourceGroupName string, accountName string, parameters MediaService, options *ClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, accountName, parameters, options) if err != nil { @@ -112,7 +114,7 @@ func (client *Client) createOrUpdateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -120,10 +122,11 @@ func (client *Client) createOrUpdateCreateRequest(ctx context.Context, resourceG // Delete - Deletes a Media Services account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// options - ClientDeleteOptions contains the optional parameters for the Client.Delete method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - options - ClientDeleteOptions contains the optional parameters for the Client.Delete method. func (client *Client) Delete(ctx context.Context, resourceGroupName string, accountName string, options *ClientDeleteOptions) (ClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, options) if err != nil { @@ -159,7 +162,7 @@ func (client *Client) deleteCreateRequest(ctx context.Context, resourceGroupName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -167,10 +170,11 @@ func (client *Client) deleteCreateRequest(ctx context.Context, resourceGroupName // Get - Get the details of a Media Services account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// options - ClientGetOptions contains the optional parameters for the Client.Get method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - options - ClientGetOptions contains the optional parameters for the Client.Get method. func (client *Client) Get(ctx context.Context, resourceGroupName string, accountName string, options *ClientGetOptions) (ClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, options) if err != nil { @@ -206,7 +210,7 @@ func (client *Client) getCreateRequest(ctx context.Context, resourceGroupName st return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -222,9 +226,10 @@ func (client *Client) getHandleResponse(resp *http.Response) (ClientGetResponse, } // NewListPager - List Media Services accounts in the resource group -// Generated from API version 2021-11-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// options - ClientListOptions contains the optional parameters for the Client.List method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - options - ClientListOptions contains the optional parameters for the Client.NewListPager method. func (client *Client) NewListPager(resourceGroupName string, options *ClientListOptions) *runtime.Pager[ClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ClientListResponse]{ More: func(page ClientListResponse) bool { @@ -269,7 +274,7 @@ func (client *Client) listCreateRequest(ctx context.Context, resourceGroupName s return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -285,8 +290,9 @@ func (client *Client) listHandleResponse(resp *http.Response) (ClientListRespons } // NewListBySubscriptionPager - List Media Services accounts in the subscription. -// Generated from API version 2021-11-01 -// options - ClientListBySubscriptionOptions contains the optional parameters for the Client.ListBySubscription method. +// +// Generated from API version 2023-01-01 +// - options - ClientListBySubscriptionOptions contains the optional parameters for the Client.NewListBySubscriptionPager method. func (client *Client) NewListBySubscriptionPager(options *ClientListBySubscriptionOptions) *runtime.Pager[ClientListBySubscriptionResponse] { return runtime.NewPager(runtime.PagingHandler[ClientListBySubscriptionResponse]{ More: func(page ClientListBySubscriptionResponse) bool { @@ -327,7 +333,7 @@ func (client *Client) listBySubscriptionCreateRequest(ctx context.Context, optio return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -344,11 +350,12 @@ func (client *Client) listBySubscriptionHandleResponse(resp *http.Response) (Cli // ListEdgePolicies - List all the media edge policies associated with the Media Services account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// parameters - The request parameters -// options - ClientListEdgePoliciesOptions contains the optional parameters for the Client.ListEdgePolicies method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - parameters - The request parameters +// - options - ClientListEdgePoliciesOptions contains the optional parameters for the Client.ListEdgePolicies method. func (client *Client) ListEdgePolicies(ctx context.Context, resourceGroupName string, accountName string, parameters ListEdgePoliciesInput, options *ClientListEdgePoliciesOptions) (ClientListEdgePoliciesResponse, error) { req, err := client.listEdgePoliciesCreateRequest(ctx, resourceGroupName, accountName, parameters, options) if err != nil { @@ -384,7 +391,7 @@ func (client *Client) listEdgePoliciesCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -401,11 +408,12 @@ func (client *Client) listEdgePoliciesHandleResponse(resp *http.Response) (Clien // SyncStorageKeys - Synchronizes storage account keys for a storage account associated with the Media Service account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// parameters - The request parameters -// options - ClientSyncStorageKeysOptions contains the optional parameters for the Client.SyncStorageKeys method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - parameters - The request parameters +// - options - ClientSyncStorageKeysOptions contains the optional parameters for the Client.SyncStorageKeys method. func (client *Client) SyncStorageKeys(ctx context.Context, resourceGroupName string, accountName string, parameters SyncStorageKeysInput, options *ClientSyncStorageKeysOptions) (ClientSyncStorageKeysResponse, error) { req, err := client.syncStorageKeysCreateRequest(ctx, resourceGroupName, accountName, parameters, options) if err != nil { @@ -441,7 +449,7 @@ func (client *Client) syncStorageKeysCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -449,11 +457,12 @@ func (client *Client) syncStorageKeysCreateRequest(ctx context.Context, resource // BeginUpdate - Updates an existing Media Services account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// parameters - The request parameters -// options - ClientBeginUpdateOptions contains the optional parameters for the Client.BeginUpdate method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - parameters - The request parameters +// - options - ClientBeginUpdateOptions contains the optional parameters for the Client.BeginUpdate method. func (client *Client) BeginUpdate(ctx context.Context, resourceGroupName string, accountName string, parameters MediaServiceUpdate, options *ClientBeginUpdateOptions) (*runtime.Poller[ClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, accountName, parameters, options) @@ -468,7 +477,8 @@ func (client *Client) BeginUpdate(ctx context.Context, resourceGroupName string, // Update - Updates an existing Media Services account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// +// Generated from API version 2023-01-01 func (client *Client) update(ctx context.Context, resourceGroupName string, accountName string, parameters MediaServiceUpdate, options *ClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, parameters, options) if err != nil { @@ -504,7 +514,7 @@ func (client *Client) updateCreateRequest(ctx context.Context, resourceGroupName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-01-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/client_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/client_example_test.go deleted file mode 100644 index eaedef2ccdfb..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/client_example_test.go +++ /dev/null @@ -1,228 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armmediaservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mediaservices/armmediaservices/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/accounts-list-all-accounts.json -func ExampleClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("contoso", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/accounts-get-by-name.json -func ExampleClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "contoso", "contosotv", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/async-accounts-create.json -func ExampleClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, "contoso", "contososports", armmediaservices.MediaService{ - Location: to.Ptr("South Central US"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - "key2": to.Ptr("value2"), - }, - Identity: &armmediaservices.MediaServiceIdentity{ - Type: to.Ptr("UserAssigned"), - UserAssignedIdentities: map[string]*armmediaservices.UserAssignedManagedIdentity{ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {}, - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2": {}, - }, - }, - Properties: &armmediaservices.MediaServiceProperties{ - Encryption: &armmediaservices.AccountEncryption{ - Type: to.Ptr(armmediaservices.AccountEncryptionKeyTypeCustomerKey), - Identity: &armmediaservices.ResourceIdentity{ - UseSystemAssignedIdentity: to.Ptr(false), - UserAssignedIdentity: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1"), - }, - }, - KeyDelivery: &armmediaservices.KeyDelivery{ - AccessControl: &armmediaservices.AccessControl{ - DefaultAction: to.Ptr(armmediaservices.DefaultActionAllow), - }, - }, - PublicNetworkAccess: to.Ptr(armmediaservices.PublicNetworkAccessEnabled), - StorageAccounts: []*armmediaservices.StorageAccount{ - { - Type: to.Ptr(armmediaservices.StorageAccountTypePrimary), - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.Storage/storageAccounts/contososportsstore"), - Identity: &armmediaservices.ResourceIdentity{ - UseSystemAssignedIdentity: to.Ptr(false), - UserAssignedIdentity: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1"), - }, - }}, - StorageAuthentication: to.Ptr(armmediaservices.StorageAuthenticationManagedIdentity), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/accounts-delete.json -func ExampleClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, "contoso", "contososports", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/async-accounts-update.json -func ExampleClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, "contoso", "contososports", armmediaservices.MediaServiceUpdate{ - Tags: map[string]*string{ - "key1": to.Ptr("value3"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/accounts-sync-storage-keys.json -func ExampleClient_SyncStorageKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.SyncStorageKeys(ctx, "contoso", "contososports", armmediaservices.SyncStorageKeysInput{ - ID: to.Ptr("contososportsstore"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/accounts-list-media-edge-policies.json -func ExampleClient_ListEdgePolicies() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListEdgePolicies(ctx, "contoso", "contososports", armmediaservices.ListEdgePoliciesInput{ - DeviceID: to.Ptr("contosiothubhost_contosoiotdevice"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/accounts-subscription-list-all-accounts.json -func ExampleClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/constants.go b/sdk/resourcemanager/mediaservices/armmediaservices/constants.go index d06c95274a6a..1835b63da7ab 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/constants.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/constants.go @@ -11,7 +11,7 @@ package armmediaservices const ( moduleName = "armmediaservices" - moduleVersion = "v3.2.0" + moduleVersion = "v3.3.0" ) // AacAudioProfile - The encoding profile to be used when encoding audio with AAC. @@ -1035,6 +1035,29 @@ func PossibleLiveEventEncodingTypeValues() []LiveEventEncodingType { } } +// LiveEventHealthStatus - Health status of last 20 seconds. +type LiveEventHealthStatus string + +const ( + // LiveEventHealthStatusExcellent - Incoming bitrate >= 75% of target bitrate AND no Ingest warning and error AND ABS(IngestDrift) + // is equal to 0. + LiveEventHealthStatusExcellent LiveEventHealthStatus = "Excellent" + // LiveEventHealthStatusGood - Incoming bitrate >= 20% AND no Ingest Error or warning exception discontinuities which gap + // < 10 seconds. + LiveEventHealthStatusGood LiveEventHealthStatus = "Good" + // LiveEventHealthStatusPoor - Otherwise. + LiveEventHealthStatusPoor LiveEventHealthStatus = "Poor" +) + +// PossibleLiveEventHealthStatusValues returns the possible values for the LiveEventHealthStatus const type. +func PossibleLiveEventHealthStatusValues() []LiveEventHealthStatus { + return []LiveEventHealthStatus{ + LiveEventHealthStatusExcellent, + LiveEventHealthStatusGood, + LiveEventHealthStatusPoor, + } +} + // LiveEventInputProtocol - The input protocol for the live event. This is specified at creation time and cannot be updated. type LiveEventInputProtocol string @@ -1096,6 +1119,163 @@ func PossibleLiveEventResourceStateValues() []LiveEventResourceState { } } +// LiveEventState - Current state of the live event. See https://go.microsoft.com/fwlink/?linkid=2139012 for more information. +type LiveEventState string + +const ( + // LiveEventStateRunning - The live event resources have been allocated, ingest and preview URLs have been generated, and + // it is capable of receiving live streams. At this point, billing is active. You must explicitly call Stop on the live event + // resource to halt further billing. + LiveEventStateRunning LiveEventState = "Running" + // LiveEventStateStopped - This is the initial state of the live event after creation (unless autostart was set to true.) + // No billing occurs in this state. In this state, the live event properties can be updated but streaming is not allowed. + LiveEventStateStopped LiveEventState = "Stopped" +) + +// PossibleLiveEventStateValues returns the possible values for the LiveEventState const type. +func PossibleLiveEventStateValues() []LiveEventState { + return []LiveEventState{ + LiveEventStateRunning, + LiveEventStateStopped, + } +} + +// LiveEventStreamEventLevel - Event level. +type LiveEventStreamEventLevel string + +const ( + LiveEventStreamEventLevelCritical LiveEventStreamEventLevel = "Critical" + LiveEventStreamEventLevelError LiveEventStreamEventLevel = "Error" + LiveEventStreamEventLevelInformation LiveEventStreamEventLevel = "Information" + LiveEventStreamEventLevelWarning LiveEventStreamEventLevel = "Warning" +) + +// PossibleLiveEventStreamEventLevelValues returns the possible values for the LiveEventStreamEventLevel const type. +func PossibleLiveEventStreamEventLevelValues() []LiveEventStreamEventLevel { + return []LiveEventStreamEventLevel{ + LiveEventStreamEventLevelCritical, + LiveEventStreamEventLevelError, + LiveEventStreamEventLevelInformation, + LiveEventStreamEventLevelWarning, + } +} + +// LiveEventStreamEventMaxTimeMediaType - The media type of the larger timestamp of two fragments compared. +type LiveEventStreamEventMaxTimeMediaType string + +const ( + LiveEventStreamEventMaxTimeMediaTypeAudio LiveEventStreamEventMaxTimeMediaType = "Audio" + LiveEventStreamEventMaxTimeMediaTypeVideo LiveEventStreamEventMaxTimeMediaType = "Video" +) + +// PossibleLiveEventStreamEventMaxTimeMediaTypeValues returns the possible values for the LiveEventStreamEventMaxTimeMediaType const type. +func PossibleLiveEventStreamEventMaxTimeMediaTypeValues() []LiveEventStreamEventMaxTimeMediaType { + return []LiveEventStreamEventMaxTimeMediaType{ + LiveEventStreamEventMaxTimeMediaTypeAudio, + LiveEventStreamEventMaxTimeMediaTypeVideo, + } +} + +// LiveEventStreamEventMediaType - Type of the track. +type LiveEventStreamEventMediaType string + +const ( + LiveEventStreamEventMediaTypeAudio LiveEventStreamEventMediaType = "audio" + LiveEventStreamEventMediaTypeVideo LiveEventStreamEventMediaType = "video" +) + +// PossibleLiveEventStreamEventMediaTypeValues returns the possible values for the LiveEventStreamEventMediaType const type. +func PossibleLiveEventStreamEventMediaTypeValues() []LiveEventStreamEventMediaType { + return []LiveEventStreamEventMediaType{ + LiveEventStreamEventMediaTypeAudio, + LiveEventStreamEventMediaTypeVideo, + } +} + +// LiveEventStreamEventMinTimeMediaType - The media type of the smaller timestamp of two fragments compared. +type LiveEventStreamEventMinTimeMediaType string + +const ( + LiveEventStreamEventMinTimeMediaTypeAudio LiveEventStreamEventMinTimeMediaType = "Audio" + LiveEventStreamEventMinTimeMediaTypeVideo LiveEventStreamEventMinTimeMediaType = "Video" +) + +// PossibleLiveEventStreamEventMinTimeMediaTypeValues returns the possible values for the LiveEventStreamEventMinTimeMediaType const type. +func PossibleLiveEventStreamEventMinTimeMediaTypeValues() []LiveEventStreamEventMinTimeMediaType { + return []LiveEventStreamEventMinTimeMediaType{ + LiveEventStreamEventMinTimeMediaTypeAudio, + LiveEventStreamEventMinTimeMediaTypeVideo, + } +} + +// LiveEventStreamEventType - The type of the stream event. Format: StreamEvent/{eventType} +type LiveEventStreamEventType string + +const ( + // LiveEventStreamEventTypeStreamEventBeginIngest - Ingest session begins. + LiveEventStreamEventTypeStreamEventBeginIngest LiveEventStreamEventType = "StreamEvent/BeginIngest" + // LiveEventStreamEventTypeStreamEventChunkDropped - Fragment dropped. + LiveEventStreamEventTypeStreamEventChunkDropped LiveEventStreamEventType = "StreamEvent/ChunkDropped" + // LiveEventStreamEventTypeStreamEventDiscontinuity - Timestamp discontinuity detected. + LiveEventStreamEventTypeStreamEventDiscontinuity LiveEventStreamEventType = "StreamEvent/Discontinuity" + // LiveEventStreamEventTypeStreamEventEndIngest - Ingest session ends. + LiveEventStreamEventTypeStreamEventEndIngest LiveEventStreamEventType = "StreamEvent/EndIngest" + // LiveEventStreamEventTypeStreamEventFirstChunkReceived - First fragment received on ingest media track. + LiveEventStreamEventTypeStreamEventFirstChunkReceived LiveEventStreamEventType = "StreamEvent/FirstChunkReceived" + // LiveEventStreamEventTypeStreamEventInvalidConnection - Ingest session denied. + LiveEventStreamEventTypeStreamEventInvalidConnection LiveEventStreamEventType = "StreamEvent/InvalidConnection" + // LiveEventStreamEventTypeStreamEventUnalignedKeyFrames - Unaligned video keyframes detected. + LiveEventStreamEventTypeStreamEventUnalignedKeyFrames LiveEventStreamEventType = "StreamEvent/UnalignedKeyFrames" + // LiveEventStreamEventTypeStreamEventUnalignedPresentation - Unaligned presentation detected, meaning two fragments across + // two quality levels are not time aligned. + LiveEventStreamEventTypeStreamEventUnalignedPresentation LiveEventStreamEventType = "StreamEvent/UnalignedPresentation" +) + +// PossibleLiveEventStreamEventTypeValues returns the possible values for the LiveEventStreamEventType const type. +func PossibleLiveEventStreamEventTypeValues() []LiveEventStreamEventType { + return []LiveEventStreamEventType{ + LiveEventStreamEventTypeStreamEventBeginIngest, + LiveEventStreamEventTypeStreamEventChunkDropped, + LiveEventStreamEventTypeStreamEventDiscontinuity, + LiveEventStreamEventTypeStreamEventEndIngest, + LiveEventStreamEventTypeStreamEventFirstChunkReceived, + LiveEventStreamEventTypeStreamEventInvalidConnection, + LiveEventStreamEventTypeStreamEventUnalignedKeyFrames, + LiveEventStreamEventTypeStreamEventUnalignedPresentation, + } +} + +// LiveEventTrackEventType - The type of the track event. +type LiveEventTrackEventType string + +const ( + // LiveEventTrackEventTypeTrackEventIngestHeartbeat - Track heartbeat received. + LiveEventTrackEventTypeTrackEventIngestHeartbeat LiveEventTrackEventType = "TrackEvent/IngestHeartbeat" +) + +// PossibleLiveEventTrackEventTypeValues returns the possible values for the LiveEventTrackEventType const type. +func PossibleLiveEventTrackEventTypeValues() []LiveEventTrackEventType { + return []LiveEventTrackEventType{ + LiveEventTrackEventTypeTrackEventIngestHeartbeat, + } +} + +// LiveEventTrackType - Type of the track. +type LiveEventTrackType string + +const ( + LiveEventTrackTypeAudio LiveEventTrackType = "audio" + LiveEventTrackTypeVideo LiveEventTrackType = "video" +) + +// PossibleLiveEventTrackTypeValues returns the possible values for the LiveEventTrackType const type. +func PossibleLiveEventTrackTypeValues() []LiveEventTrackType { + return []LiveEventTrackType{ + LiveEventTrackTypeAudio, + LiveEventTrackTypeVideo, + } +} + // LiveOutputResourceState - The resource state of the live output. type LiveOutputResourceState string @@ -1162,6 +1342,31 @@ func PossibleMetricUnitValues() []MetricUnit { } } +// MinimumTLSVersion - The minimum TLS version allowed for this account's requests. This is an optional property. If unspecified, +// a secure default value will be used. +type MinimumTLSVersion string + +const ( + // MinimumTLSVersionTls10 - Minimum TLS version is TLS 1.0. + MinimumTLSVersionTls10 MinimumTLSVersion = "Tls10" + // MinimumTLSVersionTls11 - Minimum TLS version is TLS 1.1. + MinimumTLSVersionTls11 MinimumTLSVersion = "Tls11" + // MinimumTLSVersionTls12 - Minimum TLS version is TLS 1.2. + MinimumTLSVersionTls12 MinimumTLSVersion = "Tls12" + // MinimumTLSVersionTls13 - Minimum TLS version is TLS 1.3. + MinimumTLSVersionTls13 MinimumTLSVersion = "Tls13" +) + +// PossibleMinimumTLSVersionValues returns the possible values for the MinimumTLSVersion const type. +func PossibleMinimumTLSVersionValues() []MinimumTLSVersion { + return []MinimumTLSVersion{ + MinimumTLSVersionTls10, + MinimumTLSVersionTls11, + MinimumTLSVersionTls12, + MinimumTLSVersionTls13, + } +} + // OnErrorType - A Transform can define more than one outputs. This property defines what the service should do when one output // fails - either continue to produce other outputs, or, stop the other outputs. The overall // Job state will not reflect failures of outputs that are specified with 'ContinueJob'. The default is 'StopProcessingJob'. diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/contentkeypolicies_client.go b/sdk/resourcemanager/mediaservices/armmediaservices/contentkeypolicies_client.go index 397d5ff782a9..43d092a82344 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/contentkeypolicies_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/contentkeypolicies_client.go @@ -33,9 +33,9 @@ type ContentKeyPoliciesClient struct { } // NewContentKeyPoliciesClient creates a new instance of ContentKeyPoliciesClient with the specified values. -// subscriptionID - The unique identifier for a Microsoft Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The unique identifier for a Microsoft Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewContentKeyPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ContentKeyPoliciesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,13 +58,14 @@ func NewContentKeyPoliciesClient(subscriptionID string, credential azcore.TokenC // CreateOrUpdate - Create or update a Content Key Policy in the Media Services account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// contentKeyPolicyName - The Content Key Policy name. -// parameters - The request parameters -// options - ContentKeyPoliciesClientCreateOrUpdateOptions contains the optional parameters for the ContentKeyPoliciesClient.CreateOrUpdate -// method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - contentKeyPolicyName - The Content Key Policy name. +// - parameters - The request parameters +// - options - ContentKeyPoliciesClientCreateOrUpdateOptions contains the optional parameters for the ContentKeyPoliciesClient.CreateOrUpdate +// method. func (client *ContentKeyPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, contentKeyPolicyName string, parameters ContentKeyPolicy, options *ContentKeyPoliciesClientCreateOrUpdateOptions) (ContentKeyPoliciesClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, accountName, contentKeyPolicyName, parameters, options) if err != nil { @@ -104,7 +105,7 @@ func (client *ContentKeyPoliciesClient) createOrUpdateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -121,12 +122,13 @@ func (client *ContentKeyPoliciesClient) createOrUpdateHandleResponse(resp *http. // Delete - Deletes a Content Key Policy in the Media Services account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// contentKeyPolicyName - The Content Key Policy name. -// options - ContentKeyPoliciesClientDeleteOptions contains the optional parameters for the ContentKeyPoliciesClient.Delete -// method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - contentKeyPolicyName - The Content Key Policy name. +// - options - ContentKeyPoliciesClientDeleteOptions contains the optional parameters for the ContentKeyPoliciesClient.Delete +// method. func (client *ContentKeyPoliciesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, contentKeyPolicyName string, options *ContentKeyPoliciesClientDeleteOptions) (ContentKeyPoliciesClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, contentKeyPolicyName, options) if err != nil { @@ -166,7 +168,7 @@ func (client *ContentKeyPoliciesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -174,11 +176,12 @@ func (client *ContentKeyPoliciesClient) deleteCreateRequest(ctx context.Context, // Get - Get the details of a Content Key Policy in the Media Services account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// contentKeyPolicyName - The Content Key Policy name. -// options - ContentKeyPoliciesClientGetOptions contains the optional parameters for the ContentKeyPoliciesClient.Get method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - contentKeyPolicyName - The Content Key Policy name. +// - options - ContentKeyPoliciesClientGetOptions contains the optional parameters for the ContentKeyPoliciesClient.Get method. func (client *ContentKeyPoliciesClient) Get(ctx context.Context, resourceGroupName string, accountName string, contentKeyPolicyName string, options *ContentKeyPoliciesClientGetOptions) (ContentKeyPoliciesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, contentKeyPolicyName, options) if err != nil { @@ -218,7 +221,7 @@ func (client *ContentKeyPoliciesClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -235,12 +238,13 @@ func (client *ContentKeyPoliciesClient) getHandleResponse(resp *http.Response) ( // GetPolicyPropertiesWithSecrets - Get a Content Key Policy including secret values // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// contentKeyPolicyName - The Content Key Policy name. -// options - ContentKeyPoliciesClientGetPolicyPropertiesWithSecretsOptions contains the optional parameters for the ContentKeyPoliciesClient.GetPolicyPropertiesWithSecrets -// method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - contentKeyPolicyName - The Content Key Policy name. +// - options - ContentKeyPoliciesClientGetPolicyPropertiesWithSecretsOptions contains the optional parameters for the ContentKeyPoliciesClient.GetPolicyPropertiesWithSecrets +// method. func (client *ContentKeyPoliciesClient) GetPolicyPropertiesWithSecrets(ctx context.Context, resourceGroupName string, accountName string, contentKeyPolicyName string, options *ContentKeyPoliciesClientGetPolicyPropertiesWithSecretsOptions) (ContentKeyPoliciesClientGetPolicyPropertiesWithSecretsResponse, error) { req, err := client.getPolicyPropertiesWithSecretsCreateRequest(ctx, resourceGroupName, accountName, contentKeyPolicyName, options) if err != nil { @@ -280,7 +284,7 @@ func (client *ContentKeyPoliciesClient) getPolicyPropertiesWithSecretsCreateRequ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -296,10 +300,12 @@ func (client *ContentKeyPoliciesClient) getPolicyPropertiesWithSecretsHandleResp } // NewListPager - Lists the Content Key Policies in the account -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// options - ContentKeyPoliciesClientListOptions contains the optional parameters for the ContentKeyPoliciesClient.List method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - options - ContentKeyPoliciesClientListOptions contains the optional parameters for the ContentKeyPoliciesClient.NewListPager +// method. func (client *ContentKeyPoliciesClient) NewListPager(resourceGroupName string, accountName string, options *ContentKeyPoliciesClientListOptions) *runtime.Pager[ContentKeyPoliciesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ContentKeyPoliciesClientListResponse]{ More: func(page ContentKeyPoliciesClientListResponse) bool { @@ -348,7 +354,7 @@ func (client *ContentKeyPoliciesClient) listCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2023-01-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -374,13 +380,14 @@ func (client *ContentKeyPoliciesClient) listHandleResponse(resp *http.Response) // Update - Updates an existing Content Key Policy in the Media Services account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// contentKeyPolicyName - The Content Key Policy name. -// parameters - The request parameters -// options - ContentKeyPoliciesClientUpdateOptions contains the optional parameters for the ContentKeyPoliciesClient.Update -// method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - contentKeyPolicyName - The Content Key Policy name. +// - parameters - The request parameters +// - options - ContentKeyPoliciesClientUpdateOptions contains the optional parameters for the ContentKeyPoliciesClient.Update +// method. func (client *ContentKeyPoliciesClient) Update(ctx context.Context, resourceGroupName string, accountName string, contentKeyPolicyName string, parameters ContentKeyPolicy, options *ContentKeyPoliciesClientUpdateOptions) (ContentKeyPoliciesClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, contentKeyPolicyName, parameters, options) if err != nil { @@ -420,7 +427,7 @@ func (client *ContentKeyPoliciesClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/contentkeypolicies_client_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/contentkeypolicies_client_example_test.go deleted file mode 100644 index cf50db3b8cf7..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/contentkeypolicies_client_example_test.go +++ /dev/null @@ -1,377 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armmediaservices_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mediaservices/armmediaservices/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-list-by-lastModified.json -func ExampleContentKeyPoliciesClient_NewListPager_listsContentKeyPoliciesOrderedByLastModified() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewContentKeyPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("contoso", "contosomedia", &armmediaservices.ContentKeyPoliciesClientListOptions{Filter: nil, - Top: nil, - Orderby: to.Ptr("properties/lastModified"), - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-list-in-date-range.json -func ExampleContentKeyPoliciesClient_NewListPager_listsContentKeyPoliciesWithCreatedAndLastModifiedFilters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewContentKeyPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("contoso", "contosomedia", &armmediaservices.ContentKeyPoliciesClientListOptions{Filter: to.Ptr("properties/lastModified gt 2016-06-01 and properties/created lt 2013-07-01"), - Top: nil, - Orderby: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-list-all.json -func ExampleContentKeyPoliciesClient_NewListPager_listsAllContentKeyPolicies() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewContentKeyPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("contoso", "contosomedia", &armmediaservices.ContentKeyPoliciesClientListOptions{Filter: nil, - Top: nil, - Orderby: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-get-by-name.json -func ExampleContentKeyPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewContentKeyPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "contoso", "contosomedia", "PolicyWithMultipleOptions", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-create-nodrm-token.json -func ExampleContentKeyPoliciesClient_CreateOrUpdate_createsAContentKeyPolicyWithClearKeyOptionAndTokenRestriction() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewContentKeyPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, "contoso", "contosomedia", "PolicyWithClearKeyOptionAndSwtTokenRestriction", armmediaservices.ContentKeyPolicy{ - Properties: &armmediaservices.ContentKeyPolicyProperties{ - Description: to.Ptr("ArmPolicyDescription"), - Options: []*armmediaservices.ContentKeyPolicyOption{ - { - Name: to.Ptr("ClearKeyOption"), - Configuration: &armmediaservices.ContentKeyPolicyClearKeyConfiguration{ - ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicyClearKeyConfiguration"), - }, - Restriction: &armmediaservices.ContentKeyPolicyTokenRestriction{ - ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicyTokenRestriction"), - Audience: to.Ptr("urn:audience"), - Issuer: to.Ptr("urn:issuer"), - PrimaryVerificationKey: &armmediaservices.ContentKeyPolicySymmetricTokenKey{ - ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicySymmetricTokenKey"), - KeyValue: []byte("AAAAAAAAAAAAAAAAAAAAAA=="), - }, - RestrictionTokenType: to.Ptr(armmediaservices.ContentKeyPolicyRestrictionTokenTypeSwt), - }, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-create-playready-open.json -func ExampleContentKeyPoliciesClient_CreateOrUpdate_createsAContentKeyPolicyWithPlayReadyOptionAndOpenRestriction() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewContentKeyPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, "contoso", "contosomedia", "PolicyWithPlayReadyOptionAndOpenRestriction", armmediaservices.ContentKeyPolicy{ - Properties: &armmediaservices.ContentKeyPolicyProperties{ - Description: to.Ptr("ArmPolicyDescription"), - Options: []*armmediaservices.ContentKeyPolicyOption{ - { - Name: to.Ptr("ArmPolicyOptionName"), - Configuration: &armmediaservices.ContentKeyPolicyPlayReadyConfiguration{ - ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicyPlayReadyConfiguration"), - Licenses: []*armmediaservices.ContentKeyPolicyPlayReadyLicense{ - { - AllowTestDevices: to.Ptr(true), - BeginDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-10-16T18:22:53.46Z"); return t }()), - ContentKeyLocation: &armmediaservices.ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader{ - ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader"), - }, - ContentType: to.Ptr(armmediaservices.ContentKeyPolicyPlayReadyContentTypeUltraVioletDownload), - LicenseType: to.Ptr(armmediaservices.ContentKeyPolicyPlayReadyLicenseTypePersistent), - PlayRight: &armmediaservices.ContentKeyPolicyPlayReadyPlayRight{ - AllowPassingVideoContentToUnknownOutput: to.Ptr(armmediaservices.ContentKeyPolicyPlayReadyUnknownOutputPassingOptionNotAllowed), - DigitalVideoOnlyContentRestriction: to.Ptr(false), - ImageConstraintForAnalogComponentVideoRestriction: to.Ptr(true), - ImageConstraintForAnalogComputerMonitorRestriction: to.Ptr(false), - ScmsRestriction: to.Ptr[int32](2), - }, - SecurityLevel: to.Ptr(armmediaservices.SecurityLevelSL150), - }}, - }, - Restriction: &armmediaservices.ContentKeyPolicyOpenRestriction{ - ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicyOpenRestriction"), - }, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-create-widevine-token.json -func ExampleContentKeyPoliciesClient_CreateOrUpdate_createsAContentKeyPolicyWithWidevineOptionAndTokenRestriction() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewContentKeyPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, "contoso", "contosomedia", "PolicyWithWidevineOptionAndJwtTokenRestriction", armmediaservices.ContentKeyPolicy{ - Properties: &armmediaservices.ContentKeyPolicyProperties{ - Description: to.Ptr("ArmPolicyDescription"), - Options: []*armmediaservices.ContentKeyPolicyOption{ - { - Name: to.Ptr("widevineoption"), - Configuration: &armmediaservices.ContentKeyPolicyWidevineConfiguration{ - ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicyWidevineConfiguration"), - WidevineTemplate: to.Ptr("{\"allowed_track_types\":\"SD_HD\",\"content_key_specs\":[{\"track_type\":\"SD\",\"security_level\":1,\"required_output_protection\":{\"hdcp\":\"HDCP_V2\"}}],\"policy_overrides\":{\"can_play\":true,\"can_persist\":true,\"can_renew\":false}}"), - }, - Restriction: &armmediaservices.ContentKeyPolicyTokenRestriction{ - ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicyTokenRestriction"), - AlternateVerificationKeys: []armmediaservices.ContentKeyPolicyRestrictionTokenKeyClassification{ - &armmediaservices.ContentKeyPolicySymmetricTokenKey{ - ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicySymmetricTokenKey"), - KeyValue: []byte("AAAAAAAAAAAAAAAAAAAAAA=="), - }}, - Audience: to.Ptr("urn:audience"), - Issuer: to.Ptr("urn:issuer"), - PrimaryVerificationKey: &armmediaservices.ContentKeyPolicyRsaTokenKey{ - ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicyRsaTokenKey"), - Exponent: []byte("AQAB"), - Modulus: []byte("AQAD"), - }, - RestrictionTokenType: to.Ptr(armmediaservices.ContentKeyPolicyRestrictionTokenTypeJwt), - }, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-create-multiple-options.json -func ExampleContentKeyPoliciesClient_CreateOrUpdate_createsAContentKeyPolicyWithMultipleOptions() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewContentKeyPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, "contoso", "contosomedia", "PolicyCreatedWithMultipleOptions", armmediaservices.ContentKeyPolicy{ - Properties: &armmediaservices.ContentKeyPolicyProperties{ - Description: to.Ptr("ArmPolicyDescription"), - Options: []*armmediaservices.ContentKeyPolicyOption{ - { - Name: to.Ptr("ClearKeyOption"), - Configuration: &armmediaservices.ContentKeyPolicyClearKeyConfiguration{ - ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicyClearKeyConfiguration"), - }, - Restriction: &armmediaservices.ContentKeyPolicyTokenRestriction{ - ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicyTokenRestriction"), - Audience: to.Ptr("urn:audience"), - Issuer: to.Ptr("urn:issuer"), - PrimaryVerificationKey: &armmediaservices.ContentKeyPolicySymmetricTokenKey{ - ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicySymmetricTokenKey"), - KeyValue: []byte("AAAAAAAAAAAAAAAAAAAAAA=="), - }, - RestrictionTokenType: to.Ptr(armmediaservices.ContentKeyPolicyRestrictionTokenTypeSwt), - }, - }, - { - Name: to.Ptr("widevineoption"), - Configuration: &armmediaservices.ContentKeyPolicyWidevineConfiguration{ - ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicyWidevineConfiguration"), - WidevineTemplate: to.Ptr("{\"allowed_track_types\":\"SD_HD\",\"content_key_specs\":[{\"track_type\":\"SD\",\"security_level\":1,\"required_output_protection\":{\"hdcp\":\"HDCP_V2\"}}],\"policy_overrides\":{\"can_play\":true,\"can_persist\":true,\"can_renew\":false}}"), - }, - Restriction: &armmediaservices.ContentKeyPolicyOpenRestriction{ - ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicyOpenRestriction"), - }, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-delete.json -func ExampleContentKeyPoliciesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewContentKeyPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, "contoso", "contosomedia", "PolicyWithPlayReadyOptionAndOpenRestriction", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-update.json -func ExampleContentKeyPoliciesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewContentKeyPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, "contoso", "contosomedia", "PolicyWithClearKeyOptionAndTokenRestriction", armmediaservices.ContentKeyPolicy{ - Properties: &armmediaservices.ContentKeyPolicyProperties{ - Description: to.Ptr("Updated Policy"), - Options: []*armmediaservices.ContentKeyPolicyOption{ - { - Name: to.Ptr("ClearKeyOption"), - Configuration: &armmediaservices.ContentKeyPolicyClearKeyConfiguration{ - ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicyClearKeyConfiguration"), - }, - Restriction: &armmediaservices.ContentKeyPolicyOpenRestriction{ - ODataType: to.Ptr("#Microsoft.Media.ContentKeyPolicyOpenRestriction"), - }, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-get-with-secrets.json -func ExampleContentKeyPoliciesClient_GetPolicyPropertiesWithSecrets() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewContentKeyPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetPolicyPropertiesWithSecrets(ctx, "contoso", "contosomedia", "PolicyWithMultipleOptions", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/go.mod b/sdk/resourcemanager/mediaservices/armmediaservices/go.mod index 7782fef3f2a2..47b810361a51 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/go.mod +++ b/sdk/resourcemanager/mediaservices/armmediaservices/go.mod @@ -2,20 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mediaservices/armme go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.7.0 // indirect - github.com/golang-jwt/jwt/v4 v4.4.2 // indirect - github.com/google/uuid v1.1.1 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect - golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect golang.org/x/text v0.3.7 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/go.sum b/sdk/resourcemanager/mediaservices/armmediaservices/go.sum index 8c0539b73123..3afb578030a5 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/go.sum +++ b/sdk/resourcemanager/mediaservices/armmediaservices/go.sum @@ -1,30 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 h1:sVPhtT2qjO86rTUaWMr4WoES4TkjGnzcioXcnHV9s5k= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0 h1:t/W5MYAuQy81cvM8VUNfRLzhtKpXhVUAN7Cd7KVbTyc= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0/go.mod h1:NBanQUfSWiWn3QEpWDTCU0IjBECKOYvl2R8xdRtMtiM= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.7.0 h1:VgSJlZH5u0k2qxSpqyghcFQKmvYckj46uymKK5XzkBM= -github.com/AzureAD/microsoft-authentication-library-for-go v0.7.0/go.mod h1:BDJ5qMFKx9DugEg3+uQSDCdbYPr5s9vBTrL9P8TpqOU= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt/v4 v4.4.2 h1:rcc4lwaZgFMCZ5jxF9ABolDcIHdBytAFgqFPbSJQAYs= -github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 h1:Tgea0cVUD0ivh5ADBX4WwuI12DUd2to3nCYe2eayMIw= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/jobs_client.go b/sdk/resourcemanager/mediaservices/armmediaservices/jobs_client.go index 012811c8199f..bbbb22eca391 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/jobs_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/jobs_client.go @@ -32,9 +32,9 @@ type JobsClient struct { } // NewJobsClient creates a new instance of JobsClient with the specified values. -// subscriptionID - The unique identifier for a Microsoft Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The unique identifier for a Microsoft Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewJobsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*JobsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,12 +57,13 @@ func NewJobsClient(subscriptionID string, credential azcore.TokenCredential, opt // CancelJob - Cancel a Job. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-07-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// transformName - The Transform name. -// jobName - The Job name. -// options - JobsClientCancelJobOptions contains the optional parameters for the JobsClient.CancelJob method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - transformName - The Transform name. +// - jobName - The Job name. +// - options - JobsClientCancelJobOptions contains the optional parameters for the JobsClient.CancelJob method. func (client *JobsClient) CancelJob(ctx context.Context, resourceGroupName string, accountName string, transformName string, jobName string, options *JobsClientCancelJobOptions) (JobsClientCancelJobResponse, error) { req, err := client.cancelJobCreateRequest(ctx, resourceGroupName, accountName, transformName, jobName, options) if err != nil { @@ -114,13 +115,14 @@ func (client *JobsClient) cancelJobCreateRequest(ctx context.Context, resourceGr // Create - Creates a Job. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-07-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// transformName - The Transform name. -// jobName - The Job name. -// parameters - The request parameters -// options - JobsClientCreateOptions contains the optional parameters for the JobsClient.Create method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - transformName - The Transform name. +// - jobName - The Job name. +// - parameters - The request parameters +// - options - JobsClientCreateOptions contains the optional parameters for the JobsClient.Create method. func (client *JobsClient) Create(ctx context.Context, resourceGroupName string, accountName string, transformName string, jobName string, parameters Job, options *JobsClientCreateOptions) (JobsClientCreateResponse, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, accountName, transformName, jobName, parameters, options) if err != nil { @@ -181,12 +183,13 @@ func (client *JobsClient) createHandleResponse(resp *http.Response) (JobsClientC // Delete - Deletes a Job. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-07-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// transformName - The Transform name. -// jobName - The Job name. -// options - JobsClientDeleteOptions contains the optional parameters for the JobsClient.Delete method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - transformName - The Transform name. +// - jobName - The Job name. +// - options - JobsClientDeleteOptions contains the optional parameters for the JobsClient.Delete method. func (client *JobsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, transformName string, jobName string, options *JobsClientDeleteOptions) (JobsClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, transformName, jobName, options) if err != nil { @@ -238,12 +241,13 @@ func (client *JobsClient) deleteCreateRequest(ctx context.Context, resourceGroup // Get - Gets a Job. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-07-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// transformName - The Transform name. -// jobName - The Job name. -// options - JobsClientGetOptions contains the optional parameters for the JobsClient.Get method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - transformName - The Transform name. +// - jobName - The Job name. +// - options - JobsClientGetOptions contains the optional parameters for the JobsClient.Get method. func (client *JobsClient) Get(ctx context.Context, resourceGroupName string, accountName string, transformName string, jobName string, options *JobsClientGetOptions) (JobsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, transformName, jobName, options) if err != nil { @@ -303,11 +307,12 @@ func (client *JobsClient) getHandleResponse(resp *http.Response) (JobsClientGetR } // NewListPager - Lists all of the Jobs for the Transform. +// // Generated from API version 2022-07-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// transformName - The Transform name. -// options - JobsClientListOptions contains the optional parameters for the JobsClient.List method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - transformName - The Transform name. +// - options - JobsClientListOptions contains the optional parameters for the JobsClient.NewListPager method. func (client *JobsClient) NewListPager(resourceGroupName string, accountName string, transformName string, options *JobsClientListOptions) *runtime.Pager[JobsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[JobsClientListResponse]{ More: func(page JobsClientListResponse) bool { @@ -384,13 +389,14 @@ func (client *JobsClient) listHandleResponse(resp *http.Response) (JobsClientLis // Update - Update is only supported for description and priority. Updating Priority will take effect when the Job state is // Queued or Scheduled and depending on the timing the priority update may be ignored. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-07-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// transformName - The Transform name. -// jobName - The Job name. -// parameters - The request parameters -// options - JobsClientUpdateOptions contains the optional parameters for the JobsClient.Update method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - transformName - The Transform name. +// - jobName - The Job name. +// - parameters - The request parameters +// - options - JobsClientUpdateOptions contains the optional parameters for the JobsClient.Update method. func (client *JobsClient) Update(ctx context.Context, resourceGroupName string, accountName string, transformName string, jobName string, parameters Job, options *JobsClientUpdateOptions) (JobsClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, transformName, jobName, parameters, options) if err != nil { diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/jobs_client_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/jobs_client_example_test.go deleted file mode 100644 index 31c77113a5a2..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/jobs_client_example_test.go +++ /dev/null @@ -1,319 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armmediaservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mediaservices/armmediaservices/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-list-all-filter-by-created.json -func ExampleJobsClient_NewListPager_listsJobsForTheTransformFilterByCreated() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewJobsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("contosoresources", "contosomedia", "exampleTransform", &armmediaservices.JobsClientListOptions{Filter: to.Ptr("properties/created ge 2021-06-01T00:00:10.0000000Z and properties/created le 2021-06-01T00:00:20.0000000Z"), - Orderby: to.Ptr("properties/created"), - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-list-all-filter-by-lastmodified.json -func ExampleJobsClient_NewListPager_listsJobsForTheTransformFilterByLastmodified() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewJobsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("contosoresources", "contosomedia", "exampleTransform", &armmediaservices.JobsClientListOptions{Filter: to.Ptr("properties/lastmodified ge 2021-06-01T00:00:10.0000000Z and properties/lastmodified le 2021-06-01T00:00:20.0000000Z"), - Orderby: to.Ptr("properties/lastmodified desc"), - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-list-all-filter-by-name-and-state.json -func ExampleJobsClient_NewListPager_listsJobsForTheTransformFilterByNameAndState() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewJobsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("contosoresources", "contosomedia", "exampleTransform", &armmediaservices.JobsClientListOptions{Filter: to.Ptr("name eq 'job3' and properties/state eq Microsoft.Media.JobState'finished'"), - Orderby: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-list-all-filter-by-name.json -func ExampleJobsClient_NewListPager_listsJobsForTheTransformFilterByName() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewJobsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("contosoresources", "contosomedia", "exampleTransform", &armmediaservices.JobsClientListOptions{Filter: to.Ptr("name eq 'job1' or name eq 'job2'"), - Orderby: to.Ptr("name"), - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-list-all-filter-by-state-eq.json -func ExampleJobsClient_NewListPager_listsJobsForTheTransformFilterByStateEqual() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewJobsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("contosoresources", "contosomedia", "exampleTransform", &armmediaservices.JobsClientListOptions{Filter: to.Ptr("properties/state eq Microsoft.Media.JobState'Processing'"), - Orderby: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-list-all-filter-by-state-ne.json -func ExampleJobsClient_NewListPager_listsJobsForTheTransformFilterByStateNotEqual() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewJobsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("contosoresources", "contosomedia", "exampleTransform", &armmediaservices.JobsClientListOptions{Filter: to.Ptr("properties/state ne Microsoft.Media.JobState'processing'"), - Orderby: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-list-all.json -func ExampleJobsClient_NewListPager_listsAllOfTheJobsForTheTransform() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewJobsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("contosoresources", "contosomedia", "exampleTransform", &armmediaservices.JobsClientListOptions{Filter: nil, - Orderby: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-get-by-name.json -func ExampleJobsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewJobsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "contosoresources", "contosomedia", "exampleTransform", "job1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-create.json -func ExampleJobsClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewJobsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Create(ctx, "contosoresources", "contosomedia", "exampleTransform", "job1", armmediaservices.Job{ - Properties: &armmediaservices.JobProperties{ - CorrelationData: map[string]*string{ - "Key 2": to.Ptr("Value 2"), - "key1": to.Ptr("value1"), - }, - Input: &armmediaservices.JobInputAsset{ - ODataType: to.Ptr("#Microsoft.Media.JobInputAsset"), - AssetName: to.Ptr("job1-InputAsset"), - }, - Outputs: []armmediaservices.JobOutputClassification{ - &armmediaservices.JobOutputAsset{ - ODataType: to.Ptr("#Microsoft.Media.JobOutputAsset"), - AssetName: to.Ptr("job1-OutputAsset"), - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-delete.json -func ExampleJobsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewJobsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, "contosoresources", "contosomedia", "exampleTransform", "jobToDelete", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-update.json -func ExampleJobsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewJobsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, "contosoresources", "contosomedia", "exampleTransform", "job1", armmediaservices.Job{ - Properties: &armmediaservices.JobProperties{ - Description: to.Ptr("Example job to illustrate update."), - Input: &armmediaservices.JobInputAsset{ - ODataType: to.Ptr("#Microsoft.Media.JobInputAsset"), - AssetName: to.Ptr("job1-InputAsset"), - }, - Outputs: []armmediaservices.JobOutputClassification{ - &armmediaservices.JobOutputAsset{ - ODataType: to.Ptr("#Microsoft.Media.JobOutputAsset"), - AssetName: to.Ptr("job1-OutputAsset"), - }}, - Priority: to.Ptr(armmediaservices.PriorityHigh), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-cancel.json -func ExampleJobsClient_CancelJob() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewJobsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.CancelJob(ctx, "contosoresources", "contosomedia", "exampleTransform", "job1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/liveevents_client.go b/sdk/resourcemanager/mediaservices/armmediaservices/liveevents_client.go index 8cded9e37c31..6e1db56f05f9 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/liveevents_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/liveevents_client.go @@ -33,9 +33,9 @@ type LiveEventsClient struct { } // NewLiveEventsClient creates a new instance of LiveEventsClient with the specified values. -// subscriptionID - The unique identifier for a Microsoft Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The unique identifier for a Microsoft Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewLiveEventsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LiveEventsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,12 +58,13 @@ func NewLiveEventsClient(subscriptionID string, credential azcore.TokenCredentia // BeginAllocate - A live event is in StandBy state after allocation completes, and is ready to start. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// liveEventName - The name of the live event, maximum length is 32. -// options - LiveEventsClientBeginAllocateOptions contains the optional parameters for the LiveEventsClient.BeginAllocate -// method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - liveEventName - The name of the live event, maximum length is 32. +// - options - LiveEventsClientBeginAllocateOptions contains the optional parameters for the LiveEventsClient.BeginAllocate +// method. func (client *LiveEventsClient) BeginAllocate(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, options *LiveEventsClientBeginAllocateOptions) (*runtime.Poller[LiveEventsClientAllocateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.allocate(ctx, resourceGroupName, accountName, liveEventName, options) @@ -78,7 +79,8 @@ func (client *LiveEventsClient) BeginAllocate(ctx context.Context, resourceGroup // Allocate - A live event is in StandBy state after allocation completes, and is ready to start. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 +// +// Generated from API version 2022-11-01 func (client *LiveEventsClient) allocate(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, options *LiveEventsClientBeginAllocateOptions) (*http.Response, error) { req, err := client.allocateCreateRequest(ctx, resourceGroupName, accountName, liveEventName, options) if err != nil { @@ -118,7 +120,7 @@ func (client *LiveEventsClient) allocateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -126,12 +128,13 @@ func (client *LiveEventsClient) allocateCreateRequest(ctx context.Context, resou // AsyncOperation - Get a live event operation status. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// operationID - The ID of an ongoing async operation. -// options - LiveEventsClientAsyncOperationOptions contains the optional parameters for the LiveEventsClient.AsyncOperation -// method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - operationID - The ID of an ongoing async operation. +// - options - LiveEventsClientAsyncOperationOptions contains the optional parameters for the LiveEventsClient.AsyncOperation +// method. func (client *LiveEventsClient) AsyncOperation(ctx context.Context, resourceGroupName string, accountName string, operationID string, options *LiveEventsClientAsyncOperationOptions) (LiveEventsClientAsyncOperationResponse, error) { req, err := client.asyncOperationCreateRequest(ctx, resourceGroupName, accountName, operationID, options) if err != nil { @@ -171,7 +174,7 @@ func (client *LiveEventsClient) asyncOperationCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -188,12 +191,13 @@ func (client *LiveEventsClient) asyncOperationHandleResponse(resp *http.Response // BeginCreate - Creates a new live event. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// liveEventName - The name of the live event, maximum length is 32. -// parameters - Live event properties needed for creation. -// options - LiveEventsClientBeginCreateOptions contains the optional parameters for the LiveEventsClient.BeginCreate method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - liveEventName - The name of the live event, maximum length is 32. +// - parameters - Live event properties needed for creation. +// - options - LiveEventsClientBeginCreateOptions contains the optional parameters for the LiveEventsClient.BeginCreate method. func (client *LiveEventsClient) BeginCreate(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, parameters LiveEvent, options *LiveEventsClientBeginCreateOptions) (*runtime.Poller[LiveEventsClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.create(ctx, resourceGroupName, accountName, liveEventName, parameters, options) @@ -208,7 +212,8 @@ func (client *LiveEventsClient) BeginCreate(ctx context.Context, resourceGroupNa // Create - Creates a new live event. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 +// +// Generated from API version 2022-11-01 func (client *LiveEventsClient) create(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, parameters LiveEvent, options *LiveEventsClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, accountName, liveEventName, parameters, options) if err != nil { @@ -248,7 +253,7 @@ func (client *LiveEventsClient) createCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2022-11-01") if options != nil && options.AutoStart != nil { reqQP.Set("autoStart", strconv.FormatBool(*options.AutoStart)) } @@ -259,11 +264,12 @@ func (client *LiveEventsClient) createCreateRequest(ctx context.Context, resourc // BeginDelete - Deletes a live event. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// liveEventName - The name of the live event, maximum length is 32. -// options - LiveEventsClientBeginDeleteOptions contains the optional parameters for the LiveEventsClient.BeginDelete method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - liveEventName - The name of the live event, maximum length is 32. +// - options - LiveEventsClientBeginDeleteOptions contains the optional parameters for the LiveEventsClient.BeginDelete method. func (client *LiveEventsClient) BeginDelete(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, options *LiveEventsClientBeginDeleteOptions) (*runtime.Poller[LiveEventsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, accountName, liveEventName, options) @@ -278,7 +284,8 @@ func (client *LiveEventsClient) BeginDelete(ctx context.Context, resourceGroupNa // Delete - Deletes a live event. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 +// +// Generated from API version 2022-11-01 func (client *LiveEventsClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, options *LiveEventsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, liveEventName, options) if err != nil { @@ -318,7 +325,7 @@ func (client *LiveEventsClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -326,11 +333,12 @@ func (client *LiveEventsClient) deleteCreateRequest(ctx context.Context, resourc // Get - Gets properties of a live event. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// liveEventName - The name of the live event, maximum length is 32. -// options - LiveEventsClientGetOptions contains the optional parameters for the LiveEventsClient.Get method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - liveEventName - The name of the live event, maximum length is 32. +// - options - LiveEventsClientGetOptions contains the optional parameters for the LiveEventsClient.Get method. func (client *LiveEventsClient) Get(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, options *LiveEventsClientGetOptions) (LiveEventsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, liveEventName, options) if err != nil { @@ -370,7 +378,7 @@ func (client *LiveEventsClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -386,10 +394,11 @@ func (client *LiveEventsClient) getHandleResponse(resp *http.Response) (LiveEven } // NewListPager - Lists all the live events in the account. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// options - LiveEventsClientListOptions contains the optional parameters for the LiveEventsClient.List method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - options - LiveEventsClientListOptions contains the optional parameters for the LiveEventsClient.NewListPager method. func (client *LiveEventsClient) NewListPager(resourceGroupName string, accountName string, options *LiveEventsClientListOptions) *runtime.Pager[LiveEventsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[LiveEventsClientListResponse]{ More: func(page LiveEventsClientListResponse) bool { @@ -438,7 +447,7 @@ func (client *LiveEventsClient) listCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -453,15 +462,319 @@ func (client *LiveEventsClient) listHandleResponse(resp *http.Response) (LiveEve return result, nil } +// BeginListGetStatus - Gets status telemetry of a live event. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - liveEventName - The name of the live event, maximum length is 32. +// - options - LiveEventsClientBeginListGetStatusOptions contains the optional parameters for the LiveEventsClient.BeginListGetStatus +// method. +func (client *LiveEventsClient) BeginListGetStatus(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, options *LiveEventsClientBeginListGetStatusOptions) (*runtime.Poller[*runtime.Pager[LiveEventsClientListGetStatusResponse]], error) { + pager := runtime.NewPager(runtime.PagingHandler[LiveEventsClientListGetStatusResponse]{ + More: func(page LiveEventsClientListGetStatusResponse) bool { + return false + }, + Fetcher: func(ctx context.Context, page *LiveEventsClientListGetStatusResponse) (LiveEventsClientListGetStatusResponse, error) { + req, err := client.listGetStatusCreateRequest(ctx, resourceGroupName, accountName, liveEventName, options) + if err != nil { + return LiveEventsClientListGetStatusResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return LiveEventsClientListGetStatusResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return LiveEventsClientListGetStatusResponse{}, runtime.NewResponseError(resp) + } + return client.listGetStatusHandleResponse(resp) + }, + }) + if options == nil || options.ResumeToken == "" { + resp, err := client.listGetStatus(ctx, resourceGroupName, accountName, liveEventName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[*runtime.Pager[LiveEventsClientListGetStatusResponse]]{ + FinalStateVia: runtime.FinalStateViaLocation, + Response: &pager, + }) + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.pl, &runtime.NewPollerFromResumeTokenOptions[*runtime.Pager[LiveEventsClientListGetStatusResponse]]{ + Response: &pager, + }) + } +} + +// ListGetStatus - Gets status telemetry of a live event. +// +// Generated from API version 2022-11-01 +func (client *LiveEventsClient) listGetStatus(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, options *LiveEventsClientBeginListGetStatusOptions) (*http.Response, error) { + req, err := client.listGetStatusCreateRequest(ctx, resourceGroupName, accountName, liveEventName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNotModified) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// listGetStatusCreateRequest creates the ListGetStatus request. +func (client *LiveEventsClient) listGetStatusCreateRequest(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, options *LiveEventsClientBeginListGetStatusOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/getStatus" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if liveEventName == "" { + return nil, errors.New("parameter liveEventName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{liveEventName}", url.PathEscape(liveEventName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listGetStatusHandleResponse handles the ListGetStatus response. +func (client *LiveEventsClient) listGetStatusHandleResponse(resp *http.Response) (LiveEventsClientListGetStatusResponse, error) { + result := LiveEventsClientListGetStatusResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LiveEventGetStatusResult); err != nil { + return LiveEventsClientListGetStatusResponse{}, err + } + return result, nil +} + +// BeginListGetStreamEvents - Get stream events telemetry of a live event. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - liveEventName - The name of the live event, maximum length is 32. +// - options - LiveEventsClientBeginListGetStreamEventsOptions contains the optional parameters for the LiveEventsClient.BeginListGetStreamEvents +// method. +func (client *LiveEventsClient) BeginListGetStreamEvents(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, options *LiveEventsClientBeginListGetStreamEventsOptions) (*runtime.Poller[*runtime.Pager[LiveEventsClientListGetStreamEventsResponse]], error) { + pager := runtime.NewPager(runtime.PagingHandler[LiveEventsClientListGetStreamEventsResponse]{ + More: func(page LiveEventsClientListGetStreamEventsResponse) bool { + return false + }, + Fetcher: func(ctx context.Context, page *LiveEventsClientListGetStreamEventsResponse) (LiveEventsClientListGetStreamEventsResponse, error) { + req, err := client.listGetStreamEventsCreateRequest(ctx, resourceGroupName, accountName, liveEventName, options) + if err != nil { + return LiveEventsClientListGetStreamEventsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return LiveEventsClientListGetStreamEventsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return LiveEventsClientListGetStreamEventsResponse{}, runtime.NewResponseError(resp) + } + return client.listGetStreamEventsHandleResponse(resp) + }, + }) + if options == nil || options.ResumeToken == "" { + resp, err := client.listGetStreamEvents(ctx, resourceGroupName, accountName, liveEventName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[*runtime.Pager[LiveEventsClientListGetStreamEventsResponse]]{ + FinalStateVia: runtime.FinalStateViaLocation, + Response: &pager, + }) + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.pl, &runtime.NewPollerFromResumeTokenOptions[*runtime.Pager[LiveEventsClientListGetStreamEventsResponse]]{ + Response: &pager, + }) + } +} + +// ListGetStreamEvents - Get stream events telemetry of a live event. +// +// Generated from API version 2022-11-01 +func (client *LiveEventsClient) listGetStreamEvents(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, options *LiveEventsClientBeginListGetStreamEventsOptions) (*http.Response, error) { + req, err := client.listGetStreamEventsCreateRequest(ctx, resourceGroupName, accountName, liveEventName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNotModified) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// listGetStreamEventsCreateRequest creates the ListGetStreamEvents request. +func (client *LiveEventsClient) listGetStreamEventsCreateRequest(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, options *LiveEventsClientBeginListGetStreamEventsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/getStreamEvents" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if liveEventName == "" { + return nil, errors.New("parameter liveEventName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{liveEventName}", url.PathEscape(liveEventName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listGetStreamEventsHandleResponse handles the ListGetStreamEvents response. +func (client *LiveEventsClient) listGetStreamEventsHandleResponse(resp *http.Response) (LiveEventsClientListGetStreamEventsResponse, error) { + result := LiveEventsClientListGetStreamEventsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LiveEventGetStreamEventsResult); err != nil { + return LiveEventsClientListGetStreamEventsResponse{}, err + } + return result, nil +} + +// BeginListGetTrackIngestHeartbeats - Get track ingest heartbeat events telemetry of a live event. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - liveEventName - The name of the live event, maximum length is 32. +// - options - LiveEventsClientBeginListGetTrackIngestHeartbeatsOptions contains the optional parameters for the LiveEventsClient.BeginListGetTrackIngestHeartbeats +// method. +func (client *LiveEventsClient) BeginListGetTrackIngestHeartbeats(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, options *LiveEventsClientBeginListGetTrackIngestHeartbeatsOptions) (*runtime.Poller[*runtime.Pager[LiveEventsClientListGetTrackIngestHeartbeatsResponse]], error) { + pager := runtime.NewPager(runtime.PagingHandler[LiveEventsClientListGetTrackIngestHeartbeatsResponse]{ + More: func(page LiveEventsClientListGetTrackIngestHeartbeatsResponse) bool { + return false + }, + Fetcher: func(ctx context.Context, page *LiveEventsClientListGetTrackIngestHeartbeatsResponse) (LiveEventsClientListGetTrackIngestHeartbeatsResponse, error) { + req, err := client.listGetTrackIngestHeartbeatsCreateRequest(ctx, resourceGroupName, accountName, liveEventName, options) + if err != nil { + return LiveEventsClientListGetTrackIngestHeartbeatsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return LiveEventsClientListGetTrackIngestHeartbeatsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return LiveEventsClientListGetTrackIngestHeartbeatsResponse{}, runtime.NewResponseError(resp) + } + return client.listGetTrackIngestHeartbeatsHandleResponse(resp) + }, + }) + if options == nil || options.ResumeToken == "" { + resp, err := client.listGetTrackIngestHeartbeats(ctx, resourceGroupName, accountName, liveEventName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[*runtime.Pager[LiveEventsClientListGetTrackIngestHeartbeatsResponse]]{ + FinalStateVia: runtime.FinalStateViaLocation, + Response: &pager, + }) + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.pl, &runtime.NewPollerFromResumeTokenOptions[*runtime.Pager[LiveEventsClientListGetTrackIngestHeartbeatsResponse]]{ + Response: &pager, + }) + } +} + +// ListGetTrackIngestHeartbeats - Get track ingest heartbeat events telemetry of a live event. +// +// Generated from API version 2022-11-01 +func (client *LiveEventsClient) listGetTrackIngestHeartbeats(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, options *LiveEventsClientBeginListGetTrackIngestHeartbeatsOptions) (*http.Response, error) { + req, err := client.listGetTrackIngestHeartbeatsCreateRequest(ctx, resourceGroupName, accountName, liveEventName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNotModified) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// listGetTrackIngestHeartbeatsCreateRequest creates the ListGetTrackIngestHeartbeats request. +func (client *LiveEventsClient) listGetTrackIngestHeartbeatsCreateRequest(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, options *LiveEventsClientBeginListGetTrackIngestHeartbeatsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaservices/{accountName}/liveEvents/{liveEventName}/getTrackIngestHeartbeats" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if liveEventName == "" { + return nil, errors.New("parameter liveEventName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{liveEventName}", url.PathEscape(liveEventName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listGetTrackIngestHeartbeatsHandleResponse handles the ListGetTrackIngestHeartbeats response. +func (client *LiveEventsClient) listGetTrackIngestHeartbeatsHandleResponse(resp *http.Response) (LiveEventsClientListGetTrackIngestHeartbeatsResponse, error) { + result := LiveEventsClientListGetTrackIngestHeartbeatsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LiveEventGetTrackIngestHeartbeatsResult); err != nil { + return LiveEventsClientListGetTrackIngestHeartbeatsResponse{}, err + } + return result, nil +} + // OperationLocation - Get a live event operation status. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// liveEventName - The name of the live event, maximum length is 32. -// operationID - The ID of an ongoing async operation. -// options - LiveEventsClientOperationLocationOptions contains the optional parameters for the LiveEventsClient.OperationLocation -// method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - liveEventName - The name of the live event, maximum length is 32. +// - operationID - The ID of an ongoing async operation. +// - options - LiveEventsClientOperationLocationOptions contains the optional parameters for the LiveEventsClient.OperationLocation +// method. func (client *LiveEventsClient) OperationLocation(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, operationID string, options *LiveEventsClientOperationLocationOptions) (LiveEventsClientOperationLocationResponse, error) { req, err := client.operationLocationCreateRequest(ctx, resourceGroupName, accountName, liveEventName, operationID, options) if err != nil { @@ -505,7 +818,7 @@ func (client *LiveEventsClient) operationLocationCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -524,11 +837,12 @@ func (client *LiveEventsClient) operationLocationHandleResponse(resp *http.Respo // and will be started again. All assets used by the live outputs and streaming locators // created on these assets are unaffected. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// liveEventName - The name of the live event, maximum length is 32. -// options - LiveEventsClientBeginResetOptions contains the optional parameters for the LiveEventsClient.BeginReset method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - liveEventName - The name of the live event, maximum length is 32. +// - options - LiveEventsClientBeginResetOptions contains the optional parameters for the LiveEventsClient.BeginReset method. func (client *LiveEventsClient) BeginReset(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, options *LiveEventsClientBeginResetOptions) (*runtime.Poller[LiveEventsClientResetResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.reset(ctx, resourceGroupName, accountName, liveEventName, options) @@ -545,7 +859,8 @@ func (client *LiveEventsClient) BeginReset(ctx context.Context, resourceGroupNam // will be started again. All assets used by the live outputs and streaming locators // created on these assets are unaffected. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 +// +// Generated from API version 2022-11-01 func (client *LiveEventsClient) reset(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, options *LiveEventsClientBeginResetOptions) (*http.Response, error) { req, err := client.resetCreateRequest(ctx, resourceGroupName, accountName, liveEventName, options) if err != nil { @@ -585,7 +900,7 @@ func (client *LiveEventsClient) resetCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -593,11 +908,12 @@ func (client *LiveEventsClient) resetCreateRequest(ctx context.Context, resource // BeginStart - A live event in Stopped or StandBy state will be in Running state after the start operation completes. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// liveEventName - The name of the live event, maximum length is 32. -// options - LiveEventsClientBeginStartOptions contains the optional parameters for the LiveEventsClient.BeginStart method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - liveEventName - The name of the live event, maximum length is 32. +// - options - LiveEventsClientBeginStartOptions contains the optional parameters for the LiveEventsClient.BeginStart method. func (client *LiveEventsClient) BeginStart(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, options *LiveEventsClientBeginStartOptions) (*runtime.Poller[LiveEventsClientStartResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.start(ctx, resourceGroupName, accountName, liveEventName, options) @@ -612,7 +928,8 @@ func (client *LiveEventsClient) BeginStart(ctx context.Context, resourceGroupNam // Start - A live event in Stopped or StandBy state will be in Running state after the start operation completes. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 +// +// Generated from API version 2022-11-01 func (client *LiveEventsClient) start(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, options *LiveEventsClientBeginStartOptions) (*http.Response, error) { req, err := client.startCreateRequest(ctx, resourceGroupName, accountName, liveEventName, options) if err != nil { @@ -652,7 +969,7 @@ func (client *LiveEventsClient) startCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -660,12 +977,13 @@ func (client *LiveEventsClient) startCreateRequest(ctx context.Context, resource // BeginStop - Stops a running live event. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// liveEventName - The name of the live event, maximum length is 32. -// parameters - LiveEvent stop parameters -// options - LiveEventsClientBeginStopOptions contains the optional parameters for the LiveEventsClient.BeginStop method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - liveEventName - The name of the live event, maximum length is 32. +// - parameters - LiveEvent stop parameters +// - options - LiveEventsClientBeginStopOptions contains the optional parameters for the LiveEventsClient.BeginStop method. func (client *LiveEventsClient) BeginStop(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, parameters LiveEventActionInput, options *LiveEventsClientBeginStopOptions) (*runtime.Poller[LiveEventsClientStopResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.stop(ctx, resourceGroupName, accountName, liveEventName, parameters, options) @@ -680,7 +998,8 @@ func (client *LiveEventsClient) BeginStop(ctx context.Context, resourceGroupName // Stop - Stops a running live event. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 +// +// Generated from API version 2022-11-01 func (client *LiveEventsClient) stop(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, parameters LiveEventActionInput, options *LiveEventsClientBeginStopOptions) (*http.Response, error) { req, err := client.stopCreateRequest(ctx, resourceGroupName, accountName, liveEventName, parameters, options) if err != nil { @@ -720,7 +1039,7 @@ func (client *LiveEventsClient) stopCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -728,12 +1047,13 @@ func (client *LiveEventsClient) stopCreateRequest(ctx context.Context, resourceG // BeginUpdate - Updates settings on an existing live event. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// liveEventName - The name of the live event, maximum length is 32. -// parameters - Live event properties needed for patch. -// options - LiveEventsClientBeginUpdateOptions contains the optional parameters for the LiveEventsClient.BeginUpdate method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - liveEventName - The name of the live event, maximum length is 32. +// - parameters - Live event properties needed for patch. +// - options - LiveEventsClientBeginUpdateOptions contains the optional parameters for the LiveEventsClient.BeginUpdate method. func (client *LiveEventsClient) BeginUpdate(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, parameters LiveEvent, options *LiveEventsClientBeginUpdateOptions) (*runtime.Poller[LiveEventsClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, accountName, liveEventName, parameters, options) @@ -748,7 +1068,8 @@ func (client *LiveEventsClient) BeginUpdate(ctx context.Context, resourceGroupNa // Update - Updates settings on an existing live event. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 +// +// Generated from API version 2022-11-01 func (client *LiveEventsClient) update(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, parameters LiveEvent, options *LiveEventsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, liveEventName, parameters, options) if err != nil { @@ -788,7 +1109,7 @@ func (client *LiveEventsClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/liveevents_client_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/liveevents_client_example_test.go deleted file mode 100644 index 1f5474643f7a..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/liveevents_client_example_test.go +++ /dev/null @@ -1,321 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armmediaservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mediaservices/armmediaservices/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-list-all.json -func ExampleLiveEventsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewLiveEventsClient("0a6ec948-5a62-437d-b9df-934dc7c1b722", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("mediaresources", "slitestmedia10", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-list-by-name.json -func ExampleLiveEventsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewLiveEventsClient("0a6ec948-5a62-437d-b9df-934dc7c1b722", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "mediaresources", "slitestmedia10", "myLiveEvent1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-create.json -func ExampleLiveEventsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewLiveEventsClient("0a6ec948-5a62-437d-b9df-934dc7c1b722", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "mediaresources", "slitestmedia10", "myLiveEvent1", armmediaservices.LiveEvent{ - Location: to.Ptr("West US"), - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - Properties: &armmediaservices.LiveEventProperties{ - Description: to.Ptr("test event 1"), - Input: &armmediaservices.LiveEventInput{ - AccessControl: &armmediaservices.LiveEventInputAccessControl{ - IP: &armmediaservices.IPAccessControl{ - Allow: []*armmediaservices.IPRange{ - { - Name: to.Ptr("AllowAll"), - Address: to.Ptr("0.0.0.0"), - SubnetPrefixLength: to.Ptr[int32](0), - }}, - }, - }, - KeyFrameIntervalDuration: to.Ptr("PT6S"), - StreamingProtocol: to.Ptr(armmediaservices.LiveEventInputProtocolRTMP), - }, - Preview: &armmediaservices.LiveEventPreview{ - AccessControl: &armmediaservices.LiveEventPreviewAccessControl{ - IP: &armmediaservices.IPAccessControl{ - Allow: []*armmediaservices.IPRange{ - { - Name: to.Ptr("AllowAll"), - Address: to.Ptr("0.0.0.0"), - SubnetPrefixLength: to.Ptr[int32](0), - }}, - }, - }, - }, - }, - }, &armmediaservices.LiveEventsClientBeginCreateOptions{AutoStart: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-update.json -func ExampleLiveEventsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewLiveEventsClient("0a6ec948-5a62-437d-b9df-934dc7c1b722", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, "mediaresources", "slitestmedia10", "myLiveEvent1", armmediaservices.LiveEvent{ - Location: to.Ptr("West US"), - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - "tag3": to.Ptr("value3"), - }, - Properties: &armmediaservices.LiveEventProperties{ - Description: to.Ptr("test event updated"), - Input: &armmediaservices.LiveEventInput{ - AccessControl: &armmediaservices.LiveEventInputAccessControl{ - IP: &armmediaservices.IPAccessControl{ - Allow: []*armmediaservices.IPRange{ - { - Name: to.Ptr("AllowOne"), - Address: to.Ptr("192.1.1.0"), - }}, - }, - }, - KeyFrameIntervalDuration: to.Ptr("PT6S"), - StreamingProtocol: to.Ptr(armmediaservices.LiveEventInputProtocolFragmentedMP4), - }, - Preview: &armmediaservices.LiveEventPreview{ - AccessControl: &armmediaservices.LiveEventPreviewAccessControl{ - IP: &armmediaservices.IPAccessControl{ - Allow: []*armmediaservices.IPRange{ - { - Name: to.Ptr("AllowOne"), - Address: to.Ptr("192.1.1.0"), - }}, - }, - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-delete.json -func ExampleLiveEventsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewLiveEventsClient("0a6ec948-5a62-437d-b9df-934dc7c1b722", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, "mediaresources", "slitestmedia10", "myLiveEvent1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-allocate.json -func ExampleLiveEventsClient_BeginAllocate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewLiveEventsClient("0a6ec948-5a62-437d-b9df-934dc7c1b722", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginAllocate(ctx, "mediaresources", "slitestmedia10", "myLiveEvent1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-start.json -func ExampleLiveEventsClient_BeginStart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewLiveEventsClient("0a6ec948-5a62-437d-b9df-934dc7c1b722", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginStart(ctx, "mediaresources", "slitestmedia10", "myLiveEvent1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-stop.json -func ExampleLiveEventsClient_BeginStop() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewLiveEventsClient("0a6ec948-5a62-437d-b9df-934dc7c1b722", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginStop(ctx, "mediaresources", "slitestmedia10", "myLiveEvent1", armmediaservices.LiveEventActionInput{ - RemoveOutputsOnStop: to.Ptr(false), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-reset.json -func ExampleLiveEventsClient_BeginReset() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewLiveEventsClient("0a6ec948-5a62-437d-b9df-934dc7c1b722", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginReset(ctx, "mediaresources", "slitestmedia10", "myLiveEvent1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/async-operation-result.json -func ExampleLiveEventsClient_AsyncOperation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewLiveEventsClient("0a6ec948-5a62-437d-b9df-934dc7c1b722", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.AsyncOperation(ctx, "mediaresources", "slitestmedia10", "62e4d893-d233-4005-988e-a428d9f77076", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-operation-location.json -func ExampleLiveEventsClient_OperationLocation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewLiveEventsClient("0a6ec948-5a62-437d-b9df-934dc7c1b722", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.OperationLocation(ctx, "mediaresources", "slitestmedia10", "myLiveEvent1", "62e4d893-d233-4005-988e-a428d9f77076", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/liveoutputs_client.go b/sdk/resourcemanager/mediaservices/armmediaservices/liveoutputs_client.go index 62051711e29a..02eaa20cdbd5 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/liveoutputs_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/liveoutputs_client.go @@ -32,9 +32,9 @@ type LiveOutputsClient struct { } // NewLiveOutputsClient creates a new instance of LiveOutputsClient with the specified values. -// subscriptionID - The unique identifier for a Microsoft Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The unique identifier for a Microsoft Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewLiveOutputsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LiveOutputsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,12 +57,13 @@ func NewLiveOutputsClient(subscriptionID string, credential azcore.TokenCredenti // AsyncOperation - Get a Live Output operation status. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// operationID - The ID of an ongoing async operation. -// options - LiveOutputsClientAsyncOperationOptions contains the optional parameters for the LiveOutputsClient.AsyncOperation -// method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - operationID - The ID of an ongoing async operation. +// - options - LiveOutputsClientAsyncOperationOptions contains the optional parameters for the LiveOutputsClient.AsyncOperation +// method. func (client *LiveOutputsClient) AsyncOperation(ctx context.Context, resourceGroupName string, accountName string, operationID string, options *LiveOutputsClientAsyncOperationOptions) (LiveOutputsClientAsyncOperationResponse, error) { req, err := client.asyncOperationCreateRequest(ctx, resourceGroupName, accountName, operationID, options) if err != nil { @@ -102,7 +103,7 @@ func (client *LiveOutputsClient) asyncOperationCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -119,13 +120,14 @@ func (client *LiveOutputsClient) asyncOperationHandleResponse(resp *http.Respons // BeginCreate - Creates a new live output. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// liveEventName - The name of the live event, maximum length is 32. -// liveOutputName - The name of the live output. -// parameters - Live Output properties needed for creation. -// options - LiveOutputsClientBeginCreateOptions contains the optional parameters for the LiveOutputsClient.BeginCreate method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - liveEventName - The name of the live event, maximum length is 32. +// - liveOutputName - The name of the live output. +// - parameters - Live Output properties needed for creation. +// - options - LiveOutputsClientBeginCreateOptions contains the optional parameters for the LiveOutputsClient.BeginCreate method. func (client *LiveOutputsClient) BeginCreate(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, liveOutputName string, parameters LiveOutput, options *LiveOutputsClientBeginCreateOptions) (*runtime.Poller[LiveOutputsClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.create(ctx, resourceGroupName, accountName, liveEventName, liveOutputName, parameters, options) @@ -140,7 +142,8 @@ func (client *LiveOutputsClient) BeginCreate(ctx context.Context, resourceGroupN // Create - Creates a new live output. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 +// +// Generated from API version 2022-11-01 func (client *LiveOutputsClient) create(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, liveOutputName string, parameters LiveOutput, options *LiveOutputsClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, accountName, liveEventName, liveOutputName, parameters, options) if err != nil { @@ -184,7 +187,7 @@ func (client *LiveOutputsClient) createCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -192,12 +195,13 @@ func (client *LiveOutputsClient) createCreateRequest(ctx context.Context, resour // BeginDelete - Deletes a live output. Deleting a live output does not delete the asset the live output is writing to. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// liveEventName - The name of the live event, maximum length is 32. -// liveOutputName - The name of the live output. -// options - LiveOutputsClientBeginDeleteOptions contains the optional parameters for the LiveOutputsClient.BeginDelete method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - liveEventName - The name of the live event, maximum length is 32. +// - liveOutputName - The name of the live output. +// - options - LiveOutputsClientBeginDeleteOptions contains the optional parameters for the LiveOutputsClient.BeginDelete method. func (client *LiveOutputsClient) BeginDelete(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, liveOutputName string, options *LiveOutputsClientBeginDeleteOptions) (*runtime.Poller[LiveOutputsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, accountName, liveEventName, liveOutputName, options) @@ -212,7 +216,8 @@ func (client *LiveOutputsClient) BeginDelete(ctx context.Context, resourceGroupN // Delete - Deletes a live output. Deleting a live output does not delete the asset the live output is writing to. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 +// +// Generated from API version 2022-11-01 func (client *LiveOutputsClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, liveOutputName string, options *LiveOutputsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, liveEventName, liveOutputName, options) if err != nil { @@ -256,7 +261,7 @@ func (client *LiveOutputsClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -264,12 +269,13 @@ func (client *LiveOutputsClient) deleteCreateRequest(ctx context.Context, resour // Get - Gets a live output. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// liveEventName - The name of the live event, maximum length is 32. -// liveOutputName - The name of the live output. -// options - LiveOutputsClientGetOptions contains the optional parameters for the LiveOutputsClient.Get method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - liveEventName - The name of the live event, maximum length is 32. +// - liveOutputName - The name of the live output. +// - options - LiveOutputsClientGetOptions contains the optional parameters for the LiveOutputsClient.Get method. func (client *LiveOutputsClient) Get(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, liveOutputName string, options *LiveOutputsClientGetOptions) (LiveOutputsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, liveEventName, liveOutputName, options) if err != nil { @@ -313,7 +319,7 @@ func (client *LiveOutputsClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -329,11 +335,12 @@ func (client *LiveOutputsClient) getHandleResponse(resp *http.Response) (LiveOut } // NewListPager - Lists the live outputs of a live event. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// liveEventName - The name of the live event, maximum length is 32. -// options - LiveOutputsClientListOptions contains the optional parameters for the LiveOutputsClient.List method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - liveEventName - The name of the live event, maximum length is 32. +// - options - LiveOutputsClientListOptions contains the optional parameters for the LiveOutputsClient.NewListPager method. func (client *LiveOutputsClient) NewListPager(resourceGroupName string, accountName string, liveEventName string, options *LiveOutputsClientListOptions) *runtime.Pager[LiveOutputsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[LiveOutputsClientListResponse]{ More: func(page LiveOutputsClientListResponse) bool { @@ -386,7 +393,7 @@ func (client *LiveOutputsClient) listCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -403,14 +410,15 @@ func (client *LiveOutputsClient) listHandleResponse(resp *http.Response) (LiveOu // OperationLocation - Get a Live Output operation status. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// liveEventName - The name of the live event, maximum length is 32. -// liveOutputName - The name of the live output. -// operationID - The ID of an ongoing async operation. -// options - LiveOutputsClientOperationLocationOptions contains the optional parameters for the LiveOutputsClient.OperationLocation -// method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - liveEventName - The name of the live event, maximum length is 32. +// - liveOutputName - The name of the live output. +// - operationID - The ID of an ongoing async operation. +// - options - LiveOutputsClientOperationLocationOptions contains the optional parameters for the LiveOutputsClient.OperationLocation +// method. func (client *LiveOutputsClient) OperationLocation(ctx context.Context, resourceGroupName string, accountName string, liveEventName string, liveOutputName string, operationID string, options *LiveOutputsClientOperationLocationOptions) (LiveOutputsClientOperationLocationResponse, error) { req, err := client.operationLocationCreateRequest(ctx, resourceGroupName, accountName, liveEventName, liveOutputName, operationID, options) if err != nil { @@ -458,7 +466,7 @@ func (client *LiveOutputsClient) operationLocationCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/liveoutputs_client_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/liveoutputs_client_example_test.go deleted file mode 100644 index 752dcffdfc95..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/liveoutputs_client_example_test.go +++ /dev/null @@ -1,154 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armmediaservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mediaservices/armmediaservices/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveoutput-list-all.json -func ExampleLiveOutputsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewLiveOutputsClient("0a6ec948-5a62-437d-b9df-934dc7c1b722", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("mediaresources", "slitestmedia10", "myLiveEvent1", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveoutput-list-by-name.json -func ExampleLiveOutputsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewLiveOutputsClient("0a6ec948-5a62-437d-b9df-934dc7c1b722", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "mediaresources", "slitestmedia10", "myLiveEvent1", "myLiveOutput1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveoutput-create.json -func ExampleLiveOutputsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewLiveOutputsClient("0a6ec948-5a62-437d-b9df-934dc7c1b722", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "mediaresources", "slitestmedia10", "myLiveEvent1", "myLiveOutput1", armmediaservices.LiveOutput{ - Properties: &armmediaservices.LiveOutputProperties{ - Description: to.Ptr("test live output 1"), - ArchiveWindowLength: to.Ptr("PT5M"), - AssetName: to.Ptr("6f3264f5-a189-48b4-a29a-a40f22575212"), - Hls: &armmediaservices.Hls{ - FragmentsPerTsSegment: to.Ptr[int32](5), - }, - ManifestName: to.Ptr("testmanifest"), - RewindWindowLength: to.Ptr("PT4M"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveoutput-delete.json -func ExampleLiveOutputsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewLiveOutputsClient("0a6ec948-5a62-437d-b9df-934dc7c1b722", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, "mediaresources", "slitestmedia10", "myLiveEvent1", "myLiveOutput1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/async-operation-result.json -func ExampleLiveOutputsClient_AsyncOperation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewLiveOutputsClient("0a6ec948-5a62-437d-b9df-934dc7c1b722", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.AsyncOperation(ctx, "mediaresources", "slitestmedia10", "62e4d893-d233-4005-988e-a428d9f77076", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveoutput-operation-location.json -func ExampleLiveOutputsClient_OperationLocation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewLiveOutputsClient("0a6ec948-5a62-437d-b9df-934dc7c1b722", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.OperationLocation(ctx, "mediaresources", "slitestmedia10", "myLiveEvent1", "myLiveOutput1", "62e4d893-d233-4005-988e-a428d9f77076", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/locations_client.go b/sdk/resourcemanager/mediaservices/armmediaservices/locations_client.go index 01c0240c09fc..2e48cb8ff6d1 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/locations_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/locations_client.go @@ -32,9 +32,9 @@ type LocationsClient struct { } // NewLocationsClient creates a new instance of LocationsClient with the specified values. -// subscriptionID - The unique identifier for a Microsoft Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The unique identifier for a Microsoft Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewLocationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LocationsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,11 +57,12 @@ func NewLocationsClient(subscriptionID string, credential azcore.TokenCredential // CheckNameAvailability - Checks whether the Media Service resource name is available. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 -// locationName - Location name. -// parameters - The request parameters -// options - LocationsClientCheckNameAvailabilityOptions contains the optional parameters for the LocationsClient.CheckNameAvailability -// method. +// +// Generated from API version 2023-01-01 +// - locationName - Location name. +// - parameters - The request parameters +// - options - LocationsClientCheckNameAvailabilityOptions contains the optional parameters for the LocationsClient.CheckNameAvailability +// method. func (client *LocationsClient) CheckNameAvailability(ctx context.Context, locationName string, parameters CheckNameAvailabilityInput, options *LocationsClientCheckNameAvailabilityOptions) (LocationsClientCheckNameAvailabilityResponse, error) { req, err := client.checkNameAvailabilityCreateRequest(ctx, locationName, parameters, options) if err != nil { @@ -93,7 +94,7 @@ func (client *LocationsClient) checkNameAvailabilityCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-01-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/locations_client_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/locations_client_example_test.go deleted file mode 100644 index eabf3acd5e40..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/locations_client_example_test.go +++ /dev/null @@ -1,40 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armmediaservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mediaservices/armmediaservices/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/accounts-check-name-availability.json -func ExampleLocationsClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewLocationsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CheckNameAvailability(ctx, "japanwest", armmediaservices.CheckNameAvailabilityInput{ - Name: to.Ptr("contosotv"), - Type: to.Ptr("videoAnalyzers"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/models.go b/sdk/resourcemanager/mediaservices/armmediaservices/models.go index 0de1eb1f7514..babf7abda378 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/models.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/models.go @@ -135,7 +135,7 @@ type AccountFiltersClientGetOptions struct { // placeholder for future optional parameters } -// AccountFiltersClientListOptions contains the optional parameters for the AccountFiltersClient.List method. +// AccountFiltersClientListOptions contains the optional parameters for the AccountFiltersClient.NewListPager method. type AccountFiltersClientListOptions struct { // placeholder for future optional parameters } @@ -289,7 +289,7 @@ type AssetFiltersClientGetOptions struct { // placeholder for future optional parameters } -// AssetFiltersClientListOptions contains the optional parameters for the AssetFiltersClient.List method. +// AssetFiltersClientListOptions contains the optional parameters for the AssetFiltersClient.NewListPager method. type AssetFiltersClientListOptions struct { // placeholder for future optional parameters } @@ -310,6 +310,9 @@ type AssetProperties struct { // The Asset description. Description *string `json:"description,omitempty"` + // The Asset container encryption scope in the storage account. + EncryptionScope *string `json:"encryptionScope,omitempty"` + // The name of the storage account. StorageAccountName *string `json:"storageAccountName,omitempty"` @@ -441,7 +444,7 @@ type AssetsClientListContainerSasOptions struct { // placeholder for future optional parameters } -// AssetsClientListOptions contains the optional parameters for the AssetsClient.List method. +// AssetsClientListOptions contains the optional parameters for the AssetsClient.NewListPager method. type AssetsClientListOptions struct { // Restricts the set of items returned. Filter *string @@ -752,7 +755,7 @@ type ClientGetOptions struct { // placeholder for future optional parameters } -// ClientListBySubscriptionOptions contains the optional parameters for the Client.ListBySubscription method. +// ClientListBySubscriptionOptions contains the optional parameters for the Client.NewListBySubscriptionPager method. type ClientListBySubscriptionOptions struct { // placeholder for future optional parameters } @@ -762,7 +765,7 @@ type ClientListEdgePoliciesOptions struct { // placeholder for future optional parameters } -// ClientListOptions contains the optional parameters for the Client.List method. +// ClientListOptions contains the optional parameters for the Client.NewListPager method. type ClientListOptions struct { // placeholder for future optional parameters } @@ -869,7 +872,7 @@ type ContentKeyPoliciesClientGetPolicyPropertiesWithSecretsOptions struct { // placeholder for future optional parameters } -// ContentKeyPoliciesClientListOptions contains the optional parameters for the ContentKeyPoliciesClient.List method. +// ContentKeyPoliciesClientListOptions contains the optional parameters for the ContentKeyPoliciesClient.NewListPager method. type ContentKeyPoliciesClientListOptions struct { // Restricts the set of items returned. Filter *string @@ -1565,7 +1568,7 @@ type EnvelopeEncryption struct { // ErrorAdditionalInfo - The resource management error additional info. type ErrorAdditionalInfo struct { // READ-ONLY; The additional info. - Info interface{} `json:"info,omitempty" azure:"ro"` + Info any `json:"info,omitempty" azure:"ro"` // READ-ONLY; The additional info type. Type *string `json:"type,omitempty" azure:"ro"` @@ -2650,7 +2653,7 @@ type JobsClientGetOptions struct { // placeholder for future optional parameters } -// JobsClientListOptions contains the optional parameters for the JobsClient.List method. +// JobsClientListOptions contains the optional parameters for the JobsClient.NewListPager method. type JobsClientListOptions struct { // Restricts the set of items returned. Filter *string @@ -2936,6 +2939,57 @@ type LiveEventEndpoint struct { URL *string `json:"url,omitempty"` } +// LiveEventGetStatusResult - Get live event status result. +type LiveEventGetStatusResult struct { + // The result of the get live event status. + Value []*LiveEventStatus `json:"value,omitempty"` +} + +// LiveEventGetStreamEventsResult - Get live event stream events result. +type LiveEventGetStreamEventsResult struct { + // The result of the get live event stream events. + Value []*LiveEventStreamEvent `json:"value,omitempty"` +} + +// LiveEventGetTrackIngestHeartbeatsResult - Get live event track ingest heart beats result. +type LiveEventGetTrackIngestHeartbeatsResult struct { + // The result of the get live event track events. + Value []*LiveEventTrackEvent `json:"value,omitempty"` +} + +// LiveEventIngestInterruption - The live event ingest interruption data. +type LiveEventIngestInterruption struct { + // UTC time of interruption start, encoder disconnected. + Begin *time.Time `json:"begin,omitempty"` + + // Duration of interruption in ISO 8601 time. For example, use PT1H30M to indicate 1 hour and 30 minutes. + Duration *string `json:"duration,omitempty"` + + // UTC time of interruption end, encoder re-connected. + End *time.Time `json:"end,omitempty"` + + // Interruption reason. + Reason *string `json:"reason,omitempty"` +} + +// LiveEventIngestion - The live event ingestion telemetry data. +type LiveEventIngestion struct { + // Ingestion begin time in UTC. + Begin *time.Time `json:"begin,omitempty"` + + // Ingestion end time in UTC. Empty if it's not stopped yet. + End *time.Time `json:"end,omitempty"` + + // Reason why ingestion stops. Empty if it's not stopped yet. E.g) Service Stopped. No Ingestion. + EndReason *string `json:"endReason,omitempty"` + + // IngestInterruption entry list. + IngestInterruptions []*LiveEventIngestInterruption `json:"ingestInterruptions,omitempty"` + + // Ingestion stream name. + StreamName *string `json:"streamName,omitempty"` +} + // LiveEventInput - The live event input. type LiveEventInput struct { // REQUIRED; The input protocol for the live event. This is specified at creation time and cannot be updated. @@ -2955,6 +3009,9 @@ type LiveEventInput struct { // in the HLS output. For example, use PT2S to indicate 2 seconds. Leave the // value empty for encoding live events. KeyFrameIntervalDuration *string `json:"keyFrameIntervalDuration,omitempty"` + + // The metadata endpoints for the live event. + TimedMetadataEndpoints []*LiveEventTimedMetadataEndpoint `json:"timedMetadataEndpoints,omitempty"` } // LiveEventInputAccessControl - The IP access control for live event input. @@ -3073,6 +3130,235 @@ type LiveEventProperties struct { ResourceState *LiveEventResourceState `json:"resourceState,omitempty" azure:"ro"` } +// LiveEventStatus - The live event status. +type LiveEventStatus struct { + // List of strings justifying the health status. + HealthDescriptions []*string `json:"healthDescriptions,omitempty"` + + // Health status of last 20 seconds. + HealthStatus *LiveEventHealthStatus `json:"healthStatus,omitempty"` + + // Live event ingestion entry. + Ingestion *LiveEventIngestion `json:"ingestion,omitempty"` + + // Last updated UTC time of this status. + LastUpdatedTime *time.Time `json:"lastUpdatedTime,omitempty"` + + // Current state of the live event. See https://go.microsoft.com/fwlink/?linkid=2139012 for more information. + State *LiveEventState `json:"state,omitempty"` + + // Track entry list. + TrackStatus []*LiveEventTrackStatus `json:"trackStatus,omitempty"` +} + +// LiveEventStreamEvent - The live event stream event. +type LiveEventStreamEvent struct { + // Event data based on event type. + Data *LiveEventStreamEventData `json:"data,omitempty"` + + // Event level. + EventLevel *LiveEventStreamEventLevel `json:"eventLevel,omitempty"` + + // The time event raised. + EventTime *time.Time `json:"eventTime,omitempty"` + + // The type of the stream event. Format: StreamEvent/{eventType} + EventType *LiveEventStreamEventType `json:"eventType,omitempty"` +} + +// LiveEventStreamEventData - The live event stream event data. +type LiveEventStreamEventData struct { + // Bitrate of the track. + Bitrate *int64 `json:"bitrate,omitempty"` + + // Current fragment timestamp in timescale. + CurrentFragmentTimestamp *string `json:"currentFragmentTimestamp,omitempty"` + + // Length of the discontinuity gap in timescale. + DiscontinuityGap *int64 `json:"discontinuityGap,omitempty"` + + // Fragment duration. + Duration *string `json:"duration,omitempty"` + + // Reason the fragment was dropped. + FragmentDropReason *string `json:"fragmentDropReason,omitempty"` + + // Duration of first fragment used to make a comparison, in timescale. + FragmentOneDuration *string `json:"fragmentOneDuration,omitempty"` + + // Timestamp of first fragment used to make a comparison, in timescale. + FragmentOneTimestamp *string `json:"fragmentOneTimestamp,omitempty"` + + // Duration of second fragment used to make a comparison, in timescale. + FragmentTwoDuration *string `json:"fragmentTwoDuration,omitempty"` + + // Timestamp of second fragment used to make a comparison, in timescale. + FragmentTwoTimestamp *string `json:"fragmentTwoTimestamp,omitempty"` + + // The larger timestamp of the two fragments compared. + MaxTime *string `json:"maxTime,omitempty"` + + // The media type of the larger timestamp of two fragments compared. + MaxTimeMediaType *LiveEventStreamEventMaxTimeMediaType `json:"maxTimeMediaType,omitempty"` + + // Fragment timestamp in timescale. + MediaTimestamp *string `json:"mediaTimestamp,omitempty"` + + // Type of the track. + MediaType *LiveEventStreamEventMediaType `json:"mediaType,omitempty"` + + // The smaller timestamp of the two fragments compared. + MinTime *string `json:"minTime,omitempty"` + + // The media type of the smaller timestamp of two fragments compared. + MinTimeMediaType *LiveEventStreamEventMinTimeMediaType `json:"minTimeMediaType,omitempty"` + + // Previous fragment duration in timescale. + PreviousFragmentDuration *string `json:"previousFragmentDuration,omitempty"` + + // Previous fragment timestamp in timescale. + PreviousFragmentTimestamp *string `json:"previousFragmentTimestamp,omitempty"` + + // Truncated IP of the encoder. + RemoteIP *string `json:"remoteIp,omitempty"` + + // Port of the encoder. + RemotePort *string `json:"remotePort,omitempty"` + + // Width x Height for video, null otherwise. + Resolution *string `json:"resolution,omitempty"` + + // Result code. + ResultCode *string `json:"resultCode,omitempty"` + + // Result message. + ResultMessage *string `json:"resultMessage,omitempty"` + + // Stream ID in the format "trackName_bitrate" + StreamID *string `json:"streamId,omitempty"` + + // Identifier of the stream or connection. Encoder or customer is responsible to add this ID in the ingest URL. + StreamName *string `json:"streamName,omitempty"` + + // Timescale in which timestamps are expressed. + Timescale *string `json:"timescale,omitempty"` + + // Timescale of the fragment with the larger timestamp. + TimescaleOfMaxTime *string `json:"timescaleOfMaxTime,omitempty"` + + // Timescale of the fragment with the smaller timestamp. + TimescaleOfMinTime *string `json:"timescaleOfMinTime,omitempty"` + + // Track index. + TrackID *int32 `json:"trackId,omitempty"` + + // Name of the track. + TrackName *string `json:"trackName,omitempty"` +} + +// LiveEventTimedMetadataEndpoint - The live event metadata insertion endpoint. +type LiveEventTimedMetadataEndpoint struct { + // The metadata endpoint URL. + URL *string `json:"url,omitempty"` +} + +// LiveEventTrackEvent - The live event track event. +type LiveEventTrackEvent struct { + // Event data. + Data *LiveEventTrackEventData `json:"data,omitempty"` + + // The time event raised. + EventTime *time.Time `json:"eventTime,omitempty"` + + // The type of the track event. + EventType *LiveEventTrackEventType `json:"eventType,omitempty"` +} + +// LiveEventTrackEventData - The live event track ingest heart beat event data. +type LiveEventTrackEventData struct { + // Bitrate of the track. + Bitrate *int64 `json:"bitrate,omitempty"` + + // Number of discontinuities detected in the last 20 seconds. + DiscontinuityCount *int64 `json:"discontinuityCount,omitempty"` + + // Indicates whether ingest is healthy. + Healthy *bool `json:"healthy,omitempty"` + + // Calculated bitrate based on data chunks coming from encoder. + IncomingBitrate *int64 `json:"incomingBitrate,omitempty"` + + // Indicates the speed of delay, in seconds-per-minute, of the incoming audio or video data during the last minute. The value + // is greater than zero if data is arriving to the live event slower than + // expected in the last minute; zero if data arrived with no delay; and "n/a" if no audio or video data was received. For + // example, if you have a contribution encoder sending in live content, and it is + // slowing down due to processing issues, or network latency, it may be only able to deliver a total of 58 seconds of audio + // or video in a one-minute period. This would be reported as two + // seconds-per-minute of drift. If the encoder is able to catch up and send all 60 seconds or more of data every minute, you + // will see this value reported as 0. If there was a disconnection or + // discontinuity from the encoder, this value may still display as 0, as it does not account for breaks in the data - only + // data that is delayed in timestamps. + IngestDriftValue *string `json:"ingestDriftValue,omitempty"` + + // The last timestamp in UTC that a fragment arrived at the ingest endpoint. + LastFragmentArrivalTime *time.Time `json:"lastFragmentArrivalTime,omitempty"` + + // Latest timestamp received for a track in last 20 seconds. + LastTimestamp *string `json:"lastTimestamp,omitempty"` + + // Number of data chunks with timestamps in the past that were received in last 20 seconds. + NonincreasingCount *int64 `json:"nonincreasingCount,omitempty"` + + // Number of data chunks that had overlapped timestamps in last 20 seconds. + OverlapCount *int64 `json:"overlapCount,omitempty"` + + // State of the live event. + State *string `json:"state,omitempty"` + + // Timescale in which timestamps are expressed. + Timescale *string `json:"timescale,omitempty"` + + // Name of the track. + TrackName *string `json:"trackName,omitempty"` + + // Type of the track. + TrackType *LiveEventTrackType `json:"trackType,omitempty"` + + // The language code (in BCP-47 format) of the transcription language. For example, "de-de" indicates German (Germany). The + // value is empty for the video track heartbeats, or when live transcription is + // turned off. + TranscriptionLanguage *string `json:"transcriptionLanguage,omitempty"` + + // This value is "On" for audio track heartbeats if live transcription is turned on, otherwise you will see an empty string. + // This state is only applicable to track type of "audio" for Live transcription. + // All other tracks will have an empty value. + TranscriptionState *string `json:"transcriptionState,omitempty"` + + // If expected and actual bitrates differ by more than allowed limit in last 20 seconds. + UnexpectedBitrate *bool `json:"unexpectedBitrate,omitempty"` +} + +// LiveEventTrackStatus - The live event track status. +type LiveEventTrackStatus struct { + // Expected bitrate for this track. + ExpectedBitrate *int64 `json:"expectedBitrate,omitempty"` + + // Average incoming bitrate for last 20 seconds when live event is running. + IncomingBitrate *int64 `json:"incomingBitrate,omitempty"` + + // Current ingest drift value in seconds for last 1 minute. + IngestDrift *string `json:"ingestDrift,omitempty"` + + // Total number of timed metadata request received. + RequestReceived *int64 `json:"requestReceived,omitempty"` + + // Total number of successful timed metadata request received. + RequestSucceeded *int64 `json:"requestSucceeded,omitempty"` + + // Track Id. + TrackID *string `json:"trackId,omitempty"` +} + // LiveEventTranscription - Describes the transcription tracks in the output of a live event, generated using speech-to-text // transcription. This property is reserved for future use, any value set on this property will be // ignored. @@ -3118,6 +3404,27 @@ type LiveEventsClientBeginDeleteOptions struct { ResumeToken string } +// LiveEventsClientBeginListGetStatusOptions contains the optional parameters for the LiveEventsClient.BeginListGetStatus +// method. +type LiveEventsClientBeginListGetStatusOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// LiveEventsClientBeginListGetStreamEventsOptions contains the optional parameters for the LiveEventsClient.BeginListGetStreamEvents +// method. +type LiveEventsClientBeginListGetStreamEventsOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// LiveEventsClientBeginListGetTrackIngestHeartbeatsOptions contains the optional parameters for the LiveEventsClient.BeginListGetTrackIngestHeartbeats +// method. +type LiveEventsClientBeginListGetTrackIngestHeartbeatsOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // LiveEventsClientBeginResetOptions contains the optional parameters for the LiveEventsClient.BeginReset method. type LiveEventsClientBeginResetOptions struct { // Resumes the LRO from the provided token. @@ -3147,7 +3454,7 @@ type LiveEventsClientGetOptions struct { // placeholder for future optional parameters } -// LiveEventsClientListOptions contains the optional parameters for the LiveEventsClient.List method. +// LiveEventsClientListOptions contains the optional parameters for the LiveEventsClient.NewListPager method. type LiveEventsClientListOptions struct { // placeholder for future optional parameters } @@ -3251,7 +3558,7 @@ type LiveOutputsClientGetOptions struct { // placeholder for future optional parameters } -// LiveOutputsClientListOptions contains the optional parameters for the LiveOutputsClient.List method. +// LiveOutputsClientListOptions contains the optional parameters for the LiveOutputsClient.NewListPager method. type LiveOutputsClientListOptions struct { // placeholder for future optional parameters } @@ -3371,6 +3678,10 @@ type MediaServiceProperties struct { // The Key Delivery properties for Media Services account. KeyDelivery *KeyDelivery `json:"keyDelivery,omitempty"` + // The minimum TLS version allowed for this account's requests. This is an optional property. If unspecified, a secure default + // value will be used. + MinimumTLSVersion *MinimumTLSVersion `json:"minimumTlsVersion,omitempty"` + // Whether or not public network access is allowed for resources under the Media Services account. PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` @@ -4372,7 +4683,7 @@ type StreamingEndpointsClientGetOptions struct { // placeholder for future optional parameters } -// StreamingEndpointsClientListOptions contains the optional parameters for the StreamingEndpointsClient.List method. +// StreamingEndpointsClientListOptions contains the optional parameters for the StreamingEndpointsClient.NewListPager method. type StreamingEndpointsClientListOptions struct { // placeholder for future optional parameters } @@ -4500,7 +4811,7 @@ type StreamingLocatorsClientListContentKeysOptions struct { // placeholder for future optional parameters } -// StreamingLocatorsClientListOptions contains the optional parameters for the StreamingLocatorsClient.List method. +// StreamingLocatorsClientListOptions contains the optional parameters for the StreamingLocatorsClient.NewListPager method. type StreamingLocatorsClientListOptions struct { // Restricts the set of items returned. Filter *string @@ -4543,7 +4854,7 @@ type StreamingPoliciesClientGetOptions struct { // placeholder for future optional parameters } -// StreamingPoliciesClientListOptions contains the optional parameters for the StreamingPoliciesClient.List method. +// StreamingPoliciesClientListOptions contains the optional parameters for the StreamingPoliciesClient.NewListPager method. type StreamingPoliciesClientListOptions struct { // Restricts the set of items returned. Filter *string @@ -4824,7 +5135,7 @@ type TracksClientGetOptions struct { // placeholder for future optional parameters } -// TracksClientListOptions contains the optional parameters for the TracksClient.List method. +// TracksClientListOptions contains the optional parameters for the TracksClient.NewListPager method. type TracksClientListOptions struct { // placeholder for future optional parameters } @@ -4905,7 +5216,7 @@ type TransformsClientGetOptions struct { // placeholder for future optional parameters } -// TransformsClientListOptions contains the optional parameters for the TransformsClient.List method. +// TransformsClientListOptions contains the optional parameters for the TransformsClient.NewListPager method. type TransformsClientListOptions struct { // Restricts the set of items returned. Filter *string diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/models_serde.go b/sdk/resourcemanager/mediaservices/armmediaservices/models_serde.go index d91e1a7520da..fc0a45c09786 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/models_serde.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/models_serde.go @@ -19,7 +19,7 @@ import ( // MarshalJSON implements the json.Marshaller interface for type AacAudio. func (a AacAudio) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "bitrate", a.Bitrate) populate(objectMap, "channels", a.Channels) populate(objectMap, "label", a.Label) @@ -66,7 +66,7 @@ func (a *AacAudio) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AbsoluteClipTime. func (a AbsoluteClipTime) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["@odata.type"] = "#Microsoft.Media.AbsoluteClipTime" populate(objectMap, "time", a.Time) return json.Marshal(objectMap) @@ -97,7 +97,7 @@ func (a *AbsoluteClipTime) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AccessControl. func (a AccessControl) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "defaultAction", a.DefaultAction) populate(objectMap, "ipAllowList", a.IPAllowList) return json.Marshal(objectMap) @@ -128,7 +128,7 @@ func (a *AccessControl) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AccountEncryption. func (a AccountEncryption) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "identity", a.Identity) populate(objectMap, "keyVaultProperties", a.KeyVaultProperties) populate(objectMap, "status", a.Status) @@ -167,7 +167,7 @@ func (a *AccountEncryption) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AccountFilter. func (a AccountFilter) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", a.ID) populate(objectMap, "name", a.Name) populate(objectMap, "properties", a.Properties) @@ -210,7 +210,7 @@ func (a *AccountFilter) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AccountFilterCollection. func (a AccountFilterCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "@odata.nextLink", a.ODataNextLink) populate(objectMap, "value", a.Value) return json.Marshal(objectMap) @@ -241,7 +241,7 @@ func (a *AccountFilterCollection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AkamaiAccessControl. func (a AkamaiAccessControl) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "akamaiSignatureHeaderAuthenticationKeyList", a.AkamaiSignatureHeaderAuthenticationKeyList) return json.Marshal(objectMap) } @@ -268,7 +268,7 @@ func (a *AkamaiAccessControl) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AkamaiSignatureHeaderAuthenticationKey. func (a AkamaiSignatureHeaderAuthenticationKey) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "base64Key", a.Base64Key) populateTimeRFC3339(objectMap, "expiration", a.Expiration) populate(objectMap, "identifier", a.Identifier) @@ -303,7 +303,7 @@ func (a *AkamaiSignatureHeaderAuthenticationKey) UnmarshalJSON(data []byte) erro // MarshalJSON implements the json.Marshaller interface for type ArmStreamingEndpointCapacity. func (a ArmStreamingEndpointCapacity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "default", a.Default) populate(objectMap, "maximum", a.Maximum) populate(objectMap, "minimum", a.Minimum) @@ -342,7 +342,7 @@ func (a *ArmStreamingEndpointCapacity) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ArmStreamingEndpointCurrentSKU. func (a ArmStreamingEndpointCurrentSKU) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "capacity", a.Capacity) populate(objectMap, "name", a.Name) return json.Marshal(objectMap) @@ -373,7 +373,7 @@ func (a *ArmStreamingEndpointCurrentSKU) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ArmStreamingEndpointSKU. func (a ArmStreamingEndpointSKU) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "name", a.Name) return json.Marshal(objectMap) } @@ -400,7 +400,7 @@ func (a *ArmStreamingEndpointSKU) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ArmStreamingEndpointSKUInfo. func (a ArmStreamingEndpointSKUInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "capacity", a.Capacity) populate(objectMap, "resourceType", a.ResourceType) populate(objectMap, "sku", a.SKU) @@ -435,7 +435,7 @@ func (a *ArmStreamingEndpointSKUInfo) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Asset. func (a Asset) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", a.ID) populate(objectMap, "name", a.Name) populate(objectMap, "properties", a.Properties) @@ -478,7 +478,7 @@ func (a *Asset) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AssetCollection. func (a AssetCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "@odata.nextLink", a.ODataNextLink) populate(objectMap, "value", a.Value) return json.Marshal(objectMap) @@ -509,7 +509,7 @@ func (a *AssetCollection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AssetContainerSas. func (a AssetContainerSas) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "assetContainerSasUrls", a.AssetContainerSasUrls) return json.Marshal(objectMap) } @@ -536,7 +536,7 @@ func (a *AssetContainerSas) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AssetFileEncryptionMetadata. func (a AssetFileEncryptionMetadata) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "assetFileId", a.AssetFileID) populate(objectMap, "assetFileName", a.AssetFileName) populate(objectMap, "initializationVector", a.InitializationVector) @@ -571,7 +571,7 @@ func (a *AssetFileEncryptionMetadata) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AssetFilter. func (a AssetFilter) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", a.ID) populate(objectMap, "name", a.Name) populate(objectMap, "properties", a.Properties) @@ -614,7 +614,7 @@ func (a *AssetFilter) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AssetFilterCollection. func (a AssetFilterCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "@odata.nextLink", a.ODataNextLink) populate(objectMap, "value", a.Value) return json.Marshal(objectMap) @@ -645,12 +645,13 @@ func (a *AssetFilterCollection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AssetProperties. func (a AssetProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "alternateId", a.AlternateID) populate(objectMap, "assetId", a.AssetID) populate(objectMap, "container", a.Container) populateTimeRFC3339(objectMap, "created", a.Created) populate(objectMap, "description", a.Description) + populate(objectMap, "encryptionScope", a.EncryptionScope) populateTimeRFC3339(objectMap, "lastModified", a.LastModified) populate(objectMap, "storageAccountName", a.StorageAccountName) populate(objectMap, "storageEncryptionFormat", a.StorageEncryptionFormat) @@ -681,6 +682,9 @@ func (a *AssetProperties) UnmarshalJSON(data []byte) error { case "description": err = unpopulate(val, "Description", &a.Description) delete(rawMsg, key) + case "encryptionScope": + err = unpopulate(val, "EncryptionScope", &a.EncryptionScope) + delete(rawMsg, key) case "lastModified": err = unpopulateTimeRFC3339(val, "LastModified", &a.LastModified) delete(rawMsg, key) @@ -700,7 +704,7 @@ func (a *AssetProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AssetStreamingLocator. func (a AssetStreamingLocator) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "assetName", a.AssetName) populateTimeRFC3339(objectMap, "created", a.Created) populate(objectMap, "defaultContentKeyPolicyName", a.DefaultContentKeyPolicyName) @@ -755,7 +759,7 @@ func (a *AssetStreamingLocator) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AssetTrack. func (a AssetTrack) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", a.ID) populate(objectMap, "name", a.Name) populate(objectMap, "properties", a.Properties) @@ -794,7 +798,7 @@ func (a *AssetTrack) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AssetTrackCollection. func (a AssetTrackCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", a.Value) return json.Marshal(objectMap) } @@ -821,7 +825,7 @@ func (a *AssetTrackCollection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AssetTrackOperationStatus. func (a AssetTrackOperationStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "endTime", a.EndTime) populate(objectMap, "error", a.Error) populate(objectMap, "id", a.ID) @@ -868,7 +872,7 @@ func (a *AssetTrackOperationStatus) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AssetTrackProperties. func (a AssetTrackProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "provisioningState", a.ProvisioningState) populate(objectMap, "track", a.Track) return json.Marshal(objectMap) @@ -899,7 +903,7 @@ func (a *AssetTrackProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AsyncOperationResult. func (a AsyncOperationResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "error", a.Error) populate(objectMap, "name", a.Name) populate(objectMap, "status", a.Status) @@ -934,7 +938,7 @@ func (a *AsyncOperationResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Audio. func (a Audio) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "bitrate", a.Bitrate) populate(objectMap, "channels", a.Channels) populate(objectMap, "label", a.Label) @@ -977,7 +981,7 @@ func (a *Audio) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AudioAnalyzerPreset. func (a AudioAnalyzerPreset) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "audioLanguage", a.AudioLanguage) populate(objectMap, "experimentalOptions", a.ExperimentalOptions) populate(objectMap, "mode", a.Mode) @@ -1016,7 +1020,7 @@ func (a *AudioAnalyzerPreset) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AudioOverlay. func (a AudioOverlay) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "audioGainLevel", a.AudioGainLevel) populate(objectMap, "end", a.End) populate(objectMap, "fadeInDuration", a.FadeInDuration) @@ -1067,7 +1071,7 @@ func (a *AudioOverlay) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AudioTrack. func (a AudioTrack) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "bitRate", a.BitRate) populate(objectMap, "dashSettings", a.DashSettings) populate(objectMap, "displayName", a.DisplayName) @@ -1122,7 +1126,7 @@ func (a *AudioTrack) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AudioTrackDescriptor. func (a AudioTrackDescriptor) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "channelMapping", a.ChannelMapping) objectMap["@odata.type"] = "#Microsoft.Media.AudioTrackDescriptor" return json.Marshal(objectMap) @@ -1153,7 +1157,7 @@ func (a *AudioTrackDescriptor) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type BuiltInStandardEncoderPreset. func (b BuiltInStandardEncoderPreset) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "configurations", b.Configurations) objectMap["@odata.type"] = "#Microsoft.Media.BuiltInStandardEncoderPreset" populate(objectMap, "presetName", b.PresetName) @@ -1188,7 +1192,7 @@ func (b *BuiltInStandardEncoderPreset) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CbcsDrmConfiguration. func (c CbcsDrmConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "fairPlay", c.FairPlay) populate(objectMap, "playReady", c.PlayReady) populate(objectMap, "widevine", c.Widevine) @@ -1223,7 +1227,7 @@ func (c *CbcsDrmConfiguration) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CencDrmConfiguration. func (c CencDrmConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "playReady", c.PlayReady) populate(objectMap, "widevine", c.Widevine) return json.Marshal(objectMap) @@ -1254,7 +1258,7 @@ func (c *CencDrmConfiguration) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityInput. func (c CheckNameAvailabilityInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "name", c.Name) populate(objectMap, "type", c.Type) return json.Marshal(objectMap) @@ -1285,7 +1289,7 @@ func (c *CheckNameAvailabilityInput) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ClearKeyEncryptionConfiguration. func (c ClearKeyEncryptionConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "customKeysAcquisitionUrlTemplate", c.CustomKeysAcquisitionURLTemplate) return json.Marshal(objectMap) } @@ -1312,7 +1316,7 @@ func (c *ClearKeyEncryptionConfiguration) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ClipTime. func (c ClipTime) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["@odata.type"] = c.ODataType return json.Marshal(objectMap) } @@ -1339,7 +1343,7 @@ func (c *ClipTime) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Codec. func (c Codec) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "label", c.Label) objectMap["@odata.type"] = c.ODataType return json.Marshal(objectMap) @@ -1370,7 +1374,7 @@ func (c *Codec) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CommonEncryptionCbcs. func (c CommonEncryptionCbcs) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "clearKeyEncryptionConfiguration", c.ClearKeyEncryptionConfiguration) populate(objectMap, "clearTracks", c.ClearTracks) populate(objectMap, "contentKeys", c.ContentKeys) @@ -1413,7 +1417,7 @@ func (c *CommonEncryptionCbcs) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CommonEncryptionCenc. func (c CommonEncryptionCenc) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "clearKeyEncryptionConfiguration", c.ClearKeyEncryptionConfiguration) populate(objectMap, "clearTracks", c.ClearTracks) populate(objectMap, "contentKeys", c.ContentKeys) @@ -1456,7 +1460,7 @@ func (c *CommonEncryptionCenc) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicy. func (c ContentKeyPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", c.ID) populate(objectMap, "name", c.Name) populate(objectMap, "properties", c.Properties) @@ -1499,7 +1503,7 @@ func (c *ContentKeyPolicy) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicyClearKeyConfiguration. func (c ContentKeyPolicyClearKeyConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["@odata.type"] = "#Microsoft.Media.ContentKeyPolicyClearKeyConfiguration" return json.Marshal(objectMap) } @@ -1526,7 +1530,7 @@ func (c *ContentKeyPolicyClearKeyConfiguration) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicyCollection. func (c ContentKeyPolicyCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "@odata.nextLink", c.ODataNextLink) populate(objectMap, "value", c.Value) return json.Marshal(objectMap) @@ -1557,7 +1561,7 @@ func (c *ContentKeyPolicyCollection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicyConfiguration. func (c ContentKeyPolicyConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["@odata.type"] = c.ODataType return json.Marshal(objectMap) } @@ -1584,7 +1588,7 @@ func (c *ContentKeyPolicyConfiguration) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicyFairPlayConfiguration. func (c ContentKeyPolicyFairPlayConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateByteArray(objectMap, "ask", c.Ask, runtime.Base64StdFormat) populate(objectMap, "fairPlayPfx", c.FairPlayPfx) populate(objectMap, "fairPlayPfxPassword", c.FairPlayPfxPassword) @@ -1635,7 +1639,7 @@ func (c *ContentKeyPolicyFairPlayConfiguration) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicyFairPlayOfflineRentalConfiguration. func (c ContentKeyPolicyFairPlayOfflineRentalConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "playbackDurationSeconds", c.PlaybackDurationSeconds) populate(objectMap, "storageDurationSeconds", c.StorageDurationSeconds) return json.Marshal(objectMap) @@ -1666,7 +1670,7 @@ func (c *ContentKeyPolicyFairPlayOfflineRentalConfiguration) UnmarshalJSON(data // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicyOpenRestriction. func (c ContentKeyPolicyOpenRestriction) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["@odata.type"] = "#Microsoft.Media.ContentKeyPolicyOpenRestriction" return json.Marshal(objectMap) } @@ -1693,7 +1697,7 @@ func (c *ContentKeyPolicyOpenRestriction) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicyOption. func (c ContentKeyPolicyOption) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "configuration", c.Configuration) populate(objectMap, "name", c.Name) populate(objectMap, "policyOptionId", c.PolicyOptionID) @@ -1732,7 +1736,7 @@ func (c *ContentKeyPolicyOption) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicyPlayReadyConfiguration. func (c ContentKeyPolicyPlayReadyConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "licenses", c.Licenses) objectMap["@odata.type"] = "#Microsoft.Media.ContentKeyPolicyPlayReadyConfiguration" populate(objectMap, "responseCustomData", c.ResponseCustomData) @@ -1767,7 +1771,7 @@ func (c *ContentKeyPolicyPlayReadyConfiguration) UnmarshalJSON(data []byte) erro // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader. func (c ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["@odata.type"] = "#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader" return json.Marshal(objectMap) } @@ -1794,7 +1798,7 @@ func (c *ContentKeyPolicyPlayReadyContentEncryptionKeyFromHeader) UnmarshalJSON( // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier. func (c ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "keyId", c.KeyID) objectMap["@odata.type"] = "#Microsoft.Media.ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier" return json.Marshal(objectMap) @@ -1825,7 +1829,7 @@ func (c *ContentKeyPolicyPlayReadyContentEncryptionKeyFromKeyIdentifier) Unmarsh // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicyPlayReadyContentKeyLocation. func (c ContentKeyPolicyPlayReadyContentKeyLocation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["@odata.type"] = c.ODataType return json.Marshal(objectMap) } @@ -1852,7 +1856,7 @@ func (c *ContentKeyPolicyPlayReadyContentKeyLocation) UnmarshalJSON(data []byte) // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction. func (c ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "bestEffort", c.BestEffort) populate(objectMap, "configurationData", c.ConfigurationData) return json.Marshal(objectMap) @@ -1883,7 +1887,7 @@ func (c *ContentKeyPolicyPlayReadyExplicitAnalogTelevisionRestriction) Unmarshal // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicyPlayReadyLicense. func (c ContentKeyPolicyPlayReadyLicense) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "allowTestDevices", c.AllowTestDevices) populateTimeRFC3339(objectMap, "beginDate", c.BeginDate) populate(objectMap, "contentKeyLocation", c.ContentKeyLocation) @@ -1950,7 +1954,7 @@ func (c *ContentKeyPolicyPlayReadyLicense) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicyPlayReadyPlayRight. func (c ContentKeyPolicyPlayReadyPlayRight) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "agcAndColorStripeRestriction", c.AgcAndColorStripeRestriction) populate(objectMap, "allowPassingVideoContentToUnknownOutput", c.AllowPassingVideoContentToUnknownOutput) populate(objectMap, "analogVideoOpl", c.AnalogVideoOpl) @@ -2025,7 +2029,7 @@ func (c *ContentKeyPolicyPlayReadyPlayRight) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicyProperties. func (c ContentKeyPolicyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "created", c.Created) populate(objectMap, "description", c.Description) populateTimeRFC3339(objectMap, "lastModified", c.LastModified) @@ -2068,7 +2072,7 @@ func (c *ContentKeyPolicyProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicyRestriction. func (c ContentKeyPolicyRestriction) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["@odata.type"] = c.ODataType return json.Marshal(objectMap) } @@ -2095,7 +2099,7 @@ func (c *ContentKeyPolicyRestriction) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicyRestrictionTokenKey. func (c ContentKeyPolicyRestrictionTokenKey) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["@odata.type"] = c.ODataType return json.Marshal(objectMap) } @@ -2122,7 +2126,7 @@ func (c *ContentKeyPolicyRestrictionTokenKey) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicyRsaTokenKey. func (c ContentKeyPolicyRsaTokenKey) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateByteArray(objectMap, "exponent", c.Exponent, runtime.Base64StdFormat) populateByteArray(objectMap, "modulus", c.Modulus, runtime.Base64StdFormat) objectMap["@odata.type"] = "#Microsoft.Media.ContentKeyPolicyRsaTokenKey" @@ -2157,7 +2161,7 @@ func (c *ContentKeyPolicyRsaTokenKey) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicySymmetricTokenKey. func (c ContentKeyPolicySymmetricTokenKey) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateByteArray(objectMap, "keyValue", c.KeyValue, runtime.Base64StdFormat) objectMap["@odata.type"] = "#Microsoft.Media.ContentKeyPolicySymmetricTokenKey" return json.Marshal(objectMap) @@ -2188,7 +2192,7 @@ func (c *ContentKeyPolicySymmetricTokenKey) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicyTokenClaim. func (c ContentKeyPolicyTokenClaim) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "claimType", c.ClaimType) populate(objectMap, "claimValue", c.ClaimValue) return json.Marshal(objectMap) @@ -2219,7 +2223,7 @@ func (c *ContentKeyPolicyTokenClaim) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicyTokenRestriction. func (c ContentKeyPolicyTokenRestriction) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "alternateVerificationKeys", c.AlternateVerificationKeys) populate(objectMap, "audience", c.Audience) populate(objectMap, "issuer", c.Issuer) @@ -2274,7 +2278,7 @@ func (c *ContentKeyPolicyTokenRestriction) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicyUnknownConfiguration. func (c ContentKeyPolicyUnknownConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["@odata.type"] = "#Microsoft.Media.ContentKeyPolicyUnknownConfiguration" return json.Marshal(objectMap) } @@ -2301,7 +2305,7 @@ func (c *ContentKeyPolicyUnknownConfiguration) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicyUnknownRestriction. func (c ContentKeyPolicyUnknownRestriction) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["@odata.type"] = "#Microsoft.Media.ContentKeyPolicyUnknownRestriction" return json.Marshal(objectMap) } @@ -2328,7 +2332,7 @@ func (c *ContentKeyPolicyUnknownRestriction) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicyWidevineConfiguration. func (c ContentKeyPolicyWidevineConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["@odata.type"] = "#Microsoft.Media.ContentKeyPolicyWidevineConfiguration" populate(objectMap, "widevineTemplate", c.WidevineTemplate) return json.Marshal(objectMap) @@ -2359,7 +2363,7 @@ func (c *ContentKeyPolicyWidevineConfiguration) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type ContentKeyPolicyX509CertificateTokenKey. func (c ContentKeyPolicyX509CertificateTokenKey) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["@odata.type"] = "#Microsoft.Media.ContentKeyPolicyX509CertificateTokenKey" populateByteArray(objectMap, "rawBody", c.RawBody, runtime.Base64StdFormat) return json.Marshal(objectMap) @@ -2390,7 +2394,7 @@ func (c *ContentKeyPolicyX509CertificateTokenKey) UnmarshalJSON(data []byte) err // MarshalJSON implements the json.Marshaller interface for type CopyAudio. func (c CopyAudio) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "label", c.Label) objectMap["@odata.type"] = "#Microsoft.Media.CopyAudio" return json.Marshal(objectMap) @@ -2421,7 +2425,7 @@ func (c *CopyAudio) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CopyVideo. func (c CopyVideo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "label", c.Label) objectMap["@odata.type"] = "#Microsoft.Media.CopyVideo" return json.Marshal(objectMap) @@ -2452,7 +2456,7 @@ func (c *CopyVideo) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CrossSiteAccessPolicies. func (c CrossSiteAccessPolicies) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "clientAccessPolicy", c.ClientAccessPolicy) populate(objectMap, "crossDomainPolicy", c.CrossDomainPolicy) return json.Marshal(objectMap) @@ -2483,7 +2487,7 @@ func (c *CrossSiteAccessPolicies) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DDAudio. func (d DDAudio) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "bitrate", d.Bitrate) populate(objectMap, "channels", d.Channels) populate(objectMap, "label", d.Label) @@ -2526,7 +2530,7 @@ func (d *DDAudio) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DashSettings. func (d DashSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "role", d.Role) return json.Marshal(objectMap) } @@ -2553,7 +2557,7 @@ func (d *DashSettings) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DefaultKey. func (d DefaultKey) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "label", d.Label) populate(objectMap, "policyName", d.PolicyName) return json.Marshal(objectMap) @@ -2584,7 +2588,7 @@ func (d *DefaultKey) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Deinterlace. func (d Deinterlace) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "mode", d.Mode) populate(objectMap, "parity", d.Parity) return json.Marshal(objectMap) @@ -2615,7 +2619,7 @@ func (d *Deinterlace) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type EdgePolicies. func (e EdgePolicies) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "usageDataCollectionPolicy", e.UsageDataCollectionPolicy) return json.Marshal(objectMap) } @@ -2642,7 +2646,7 @@ func (e *EdgePolicies) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type EdgeUsageDataCollectionPolicy. func (e EdgeUsageDataCollectionPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "dataCollectionFrequency", e.DataCollectionFrequency) populate(objectMap, "dataReportingFrequency", e.DataReportingFrequency) populate(objectMap, "eventHubDetails", e.EventHubDetails) @@ -2681,7 +2685,7 @@ func (e *EdgeUsageDataCollectionPolicy) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type EdgeUsageDataEventHub. func (e EdgeUsageDataEventHub) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "name", e.Name) populate(objectMap, "namespace", e.Namespace) populate(objectMap, "token", e.Token) @@ -2716,7 +2720,7 @@ func (e *EdgeUsageDataEventHub) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type EnabledProtocols. func (e EnabledProtocols) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "dash", e.Dash) populate(objectMap, "download", e.Download) populate(objectMap, "hls", e.Hls) @@ -2755,7 +2759,7 @@ func (e *EnabledProtocols) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type EntityNameAvailabilityCheckOutput. func (e EntityNameAvailabilityCheckOutput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "message", e.Message) populate(objectMap, "nameAvailable", e.NameAvailable) populate(objectMap, "reason", e.Reason) @@ -2790,7 +2794,7 @@ func (e *EntityNameAvailabilityCheckOutput) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type EnvelopeEncryption. func (e EnvelopeEncryption) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "clearTracks", e.ClearTracks) populate(objectMap, "contentKeys", e.ContentKeys) populate(objectMap, "customKeyAcquisitionUrlTemplate", e.CustomKeyAcquisitionURLTemplate) @@ -2829,7 +2833,7 @@ func (e *EnvelopeEncryption) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo. func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "info", &e.Info) populate(objectMap, "type", e.Type) return json.Marshal(objectMap) @@ -2860,7 +2864,7 @@ func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ErrorDetail. func (e ErrorDetail) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "additionalInfo", e.AdditionalInfo) populate(objectMap, "code", e.Code) populate(objectMap, "details", e.Details) @@ -2903,7 +2907,7 @@ func (e *ErrorDetail) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ErrorResponse. func (e ErrorResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "error", e.Error) return json.Marshal(objectMap) } @@ -2930,7 +2934,7 @@ func (e *ErrorResponse) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type FaceDetectorPreset. func (f FaceDetectorPreset) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "blurType", f.BlurType) populate(objectMap, "experimentalOptions", f.ExperimentalOptions) populate(objectMap, "mode", f.Mode) @@ -2973,7 +2977,7 @@ func (f *FaceDetectorPreset) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Fade. func (f Fade) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "duration", f.Duration) populate(objectMap, "fadeColor", f.FadeColor) populate(objectMap, "start", f.Start) @@ -3008,7 +3012,7 @@ func (f *Fade) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type FilterTrackPropertyCondition. func (f FilterTrackPropertyCondition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "operation", f.Operation) populate(objectMap, "property", f.Property) populate(objectMap, "value", f.Value) @@ -3043,7 +3047,7 @@ func (f *FilterTrackPropertyCondition) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type FilterTrackSelection. func (f FilterTrackSelection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "trackSelections", f.TrackSelections) return json.Marshal(objectMap) } @@ -3070,7 +3074,7 @@ func (f *FilterTrackSelection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Filters. func (f Filters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "crop", f.Crop) populate(objectMap, "deinterlace", f.Deinterlace) populate(objectMap, "fadeIn", f.FadeIn) @@ -3117,7 +3121,7 @@ func (f *Filters) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type FirstQuality. func (f FirstQuality) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "bitrate", f.Bitrate) return json.Marshal(objectMap) } @@ -3144,7 +3148,7 @@ func (f *FirstQuality) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Format. func (f Format) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "filenamePattern", f.FilenamePattern) objectMap["@odata.type"] = f.ODataType return json.Marshal(objectMap) @@ -3175,7 +3179,7 @@ func (f *Format) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type FromAllInputFile. func (f FromAllInputFile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "includedTracks", f.IncludedTracks) objectMap["@odata.type"] = "#Microsoft.Media.FromAllInputFile" return json.Marshal(objectMap) @@ -3206,7 +3210,7 @@ func (f *FromAllInputFile) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type FromEachInputFile. func (f FromEachInputFile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "includedTracks", f.IncludedTracks) objectMap["@odata.type"] = "#Microsoft.Media.FromEachInputFile" return json.Marshal(objectMap) @@ -3237,7 +3241,7 @@ func (f *FromEachInputFile) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type H264Layer. func (h H264Layer) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "adaptiveBFrame", h.AdaptiveBFrame) populate(objectMap, "bFrames", h.BFrames) populate(objectMap, "bitrate", h.Bitrate) @@ -3320,7 +3324,7 @@ func (h *H264Layer) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type H264Video. func (h H264Video) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "complexity", h.Complexity) populate(objectMap, "keyFrameInterval", h.KeyFrameInterval) populate(objectMap, "label", h.Label) @@ -3379,7 +3383,7 @@ func (h *H264Video) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type H265Layer. func (h H265Layer) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "adaptiveBFrame", h.AdaptiveBFrame) populate(objectMap, "bFrames", h.BFrames) populate(objectMap, "bitrate", h.Bitrate) @@ -3458,7 +3462,7 @@ func (h *H265Layer) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type H265Video. func (h H265Video) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "complexity", h.Complexity) populate(objectMap, "keyFrameInterval", h.KeyFrameInterval) populate(objectMap, "label", h.Label) @@ -3513,7 +3517,7 @@ func (h *H265Video) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type H265VideoLayer. func (h H265VideoLayer) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "adaptiveBFrame", h.AdaptiveBFrame) populate(objectMap, "bFrames", h.BFrames) populate(objectMap, "bitrate", h.Bitrate) @@ -3572,7 +3576,7 @@ func (h *H265VideoLayer) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Hls. func (h Hls) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "fragmentsPerTsSegment", h.FragmentsPerTsSegment) return json.Marshal(objectMap) } @@ -3599,7 +3603,7 @@ func (h *Hls) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type HlsSettings. func (h HlsSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "characteristics", h.Characteristics) populate(objectMap, "default", h.Default) populate(objectMap, "forced", h.Forced) @@ -3634,7 +3638,7 @@ func (h *HlsSettings) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type IPAccessControl. func (i IPAccessControl) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "allow", i.Allow) return json.Marshal(objectMap) } @@ -3661,7 +3665,7 @@ func (i *IPAccessControl) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type IPRange. func (i IPRange) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "address", i.Address) populate(objectMap, "name", i.Name) populate(objectMap, "subnetPrefixLength", i.SubnetPrefixLength) @@ -3696,7 +3700,7 @@ func (i *IPRange) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Image. func (i Image) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "keyFrameInterval", i.KeyFrameInterval) populate(objectMap, "label", i.Label) objectMap["@odata.type"] = "#Microsoft.Media.Image" @@ -3751,7 +3755,7 @@ func (i *Image) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ImageFormat. func (i ImageFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "filenamePattern", i.FilenamePattern) objectMap["@odata.type"] = "#Microsoft.Media.ImageFormat" return json.Marshal(objectMap) @@ -3782,7 +3786,7 @@ func (i *ImageFormat) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type InputDefinition. func (i InputDefinition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "includedTracks", i.IncludedTracks) objectMap["@odata.type"] = i.ODataType return json.Marshal(objectMap) @@ -3813,7 +3817,7 @@ func (i *InputDefinition) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type InputFile. func (i InputFile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "filename", i.Filename) populate(objectMap, "includedTracks", i.IncludedTracks) objectMap["@odata.type"] = "#Microsoft.Media.InputFile" @@ -3848,7 +3852,7 @@ func (i *InputFile) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Job. func (j Job) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", j.ID) populate(objectMap, "name", j.Name) populate(objectMap, "properties", j.Properties) @@ -3891,7 +3895,7 @@ func (j *Job) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type JobCollection. func (j JobCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "@odata.nextLink", j.ODataNextLink) populate(objectMap, "value", j.Value) return json.Marshal(objectMap) @@ -3922,7 +3926,7 @@ func (j *JobCollection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type JobError. func (j JobError) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "category", j.Category) populate(objectMap, "code", j.Code) populate(objectMap, "details", j.Details) @@ -3965,7 +3969,7 @@ func (j *JobError) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type JobErrorDetail. func (j JobErrorDetail) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "code", j.Code) populate(objectMap, "message", j.Message) return json.Marshal(objectMap) @@ -3996,7 +4000,7 @@ func (j *JobErrorDetail) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type JobInput. func (j JobInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["@odata.type"] = j.ODataType return json.Marshal(objectMap) } @@ -4023,7 +4027,7 @@ func (j *JobInput) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type JobInputAsset. func (j JobInputAsset) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "assetName", j.AssetName) populate(objectMap, "end", j.End) populate(objectMap, "files", j.Files) @@ -4074,7 +4078,7 @@ func (j *JobInputAsset) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type JobInputClip. func (j JobInputClip) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "end", j.End) populate(objectMap, "files", j.Files) populate(objectMap, "inputDefinitions", j.InputDefinitions) @@ -4121,7 +4125,7 @@ func (j *JobInputClip) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type JobInputHTTP. func (j JobInputHTTP) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "baseUri", j.BaseURI) populate(objectMap, "end", j.End) populate(objectMap, "files", j.Files) @@ -4172,7 +4176,7 @@ func (j *JobInputHTTP) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type JobInputSequence. func (j JobInputSequence) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "inputs", j.Inputs) objectMap["@odata.type"] = "#Microsoft.Media.JobInputSequence" return json.Marshal(objectMap) @@ -4203,7 +4207,7 @@ func (j *JobInputSequence) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type JobInputs. func (j JobInputs) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "inputs", j.Inputs) objectMap["@odata.type"] = "#Microsoft.Media.JobInputs" return json.Marshal(objectMap) @@ -4234,7 +4238,7 @@ func (j *JobInputs) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type JobOutput. func (j JobOutput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "endTime", j.EndTime) populate(objectMap, "error", j.Error) populate(objectMap, "label", j.Label) @@ -4289,7 +4293,7 @@ func (j *JobOutput) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type JobOutputAsset. func (j JobOutputAsset) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "assetName", j.AssetName) populateTimeRFC3339(objectMap, "endTime", j.EndTime) populate(objectMap, "error", j.Error) @@ -4348,7 +4352,7 @@ func (j *JobOutputAsset) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type JobProperties. func (j JobProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "correlationData", j.CorrelationData) populateTimeRFC3339(objectMap, "created", j.Created) populate(objectMap, "description", j.Description) @@ -4411,7 +4415,7 @@ func (j *JobProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type JpgFormat. func (j JpgFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "filenamePattern", j.FilenamePattern) objectMap["@odata.type"] = "#Microsoft.Media.JpgFormat" return json.Marshal(objectMap) @@ -4442,7 +4446,7 @@ func (j *JpgFormat) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type JpgImage. func (j JpgImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "keyFrameInterval", j.KeyFrameInterval) populate(objectMap, "label", j.Label) populate(objectMap, "layers", j.Layers) @@ -4505,7 +4509,7 @@ func (j *JpgImage) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type JpgLayer. func (j JpgLayer) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "height", j.Height) populate(objectMap, "label", j.Label) populate(objectMap, "quality", j.Quality) @@ -4544,7 +4548,7 @@ func (j *JpgLayer) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type KeyDelivery. func (k KeyDelivery) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "accessControl", k.AccessControl) return json.Marshal(objectMap) } @@ -4571,7 +4575,7 @@ func (k *KeyDelivery) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type KeyVaultProperties. func (k KeyVaultProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "currentKeyIdentifier", k.CurrentKeyIdentifier) populate(objectMap, "keyIdentifier", k.KeyIdentifier) return json.Marshal(objectMap) @@ -4602,7 +4606,7 @@ func (k *KeyVaultProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Layer. func (l Layer) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "height", l.Height) populate(objectMap, "label", l.Label) populate(objectMap, "width", l.Width) @@ -4637,7 +4641,7 @@ func (l *Layer) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ListContainerSasInput. func (l ListContainerSasInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "expiryTime", l.ExpiryTime) populate(objectMap, "permissions", l.Permissions) return json.Marshal(objectMap) @@ -4668,7 +4672,7 @@ func (l *ListContainerSasInput) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ListContentKeysResponse. func (l ListContentKeysResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "contentKeys", l.ContentKeys) return json.Marshal(objectMap) } @@ -4695,7 +4699,7 @@ func (l *ListContentKeysResponse) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ListEdgePoliciesInput. func (l ListEdgePoliciesInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "deviceId", l.DeviceID) return json.Marshal(objectMap) } @@ -4722,7 +4726,7 @@ func (l *ListEdgePoliciesInput) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ListPathsResponse. func (l ListPathsResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "downloadPaths", l.DownloadPaths) populate(objectMap, "streamingPaths", l.StreamingPaths) return json.Marshal(objectMap) @@ -4753,7 +4757,7 @@ func (l *ListPathsResponse) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ListStreamingLocatorsResponse. func (l ListStreamingLocatorsResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "streamingLocators", l.StreamingLocators) return json.Marshal(objectMap) } @@ -4780,7 +4784,7 @@ func (l *ListStreamingLocatorsResponse) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type LiveEvent. func (l LiveEvent) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", l.ID) populate(objectMap, "location", l.Location) populate(objectMap, "name", l.Name) @@ -4831,7 +4835,7 @@ func (l *LiveEvent) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type LiveEventActionInput. func (l LiveEventActionInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "removeOutputsOnStop", l.RemoveOutputsOnStop) return json.Marshal(objectMap) } @@ -4858,7 +4862,7 @@ func (l *LiveEventActionInput) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type LiveEventEncoding. func (l LiveEventEncoding) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "encodingType", l.EncodingType) populate(objectMap, "keyFrameInterval", l.KeyFrameInterval) populate(objectMap, "presetName", l.PresetName) @@ -4897,7 +4901,7 @@ func (l *LiveEventEncoding) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type LiveEventEndpoint. func (l LiveEventEndpoint) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "protocol", l.Protocol) populate(objectMap, "url", l.URL) return json.Marshal(objectMap) @@ -4926,14 +4930,178 @@ func (l *LiveEventEndpoint) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type LiveEventGetStatusResult. +func (l LiveEventGetStatusResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LiveEventGetStatusResult. +func (l *LiveEventGetStatusResult) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &l.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LiveEventGetStreamEventsResult. +func (l LiveEventGetStreamEventsResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LiveEventGetStreamEventsResult. +func (l *LiveEventGetStreamEventsResult) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &l.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LiveEventGetTrackIngestHeartbeatsResult. +func (l LiveEventGetTrackIngestHeartbeatsResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LiveEventGetTrackIngestHeartbeatsResult. +func (l *LiveEventGetTrackIngestHeartbeatsResult) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &l.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LiveEventIngestInterruption. +func (l LiveEventIngestInterruption) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "begin", l.Begin) + populate(objectMap, "duration", l.Duration) + populateTimeRFC3339(objectMap, "end", l.End) + populate(objectMap, "reason", l.Reason) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LiveEventIngestInterruption. +func (l *LiveEventIngestInterruption) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "begin": + err = unpopulateTimeRFC3339(val, "Begin", &l.Begin) + delete(rawMsg, key) + case "duration": + err = unpopulate(val, "Duration", &l.Duration) + delete(rawMsg, key) + case "end": + err = unpopulateTimeRFC3339(val, "End", &l.End) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &l.Reason) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LiveEventIngestion. +func (l LiveEventIngestion) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "begin", l.Begin) + populateTimeRFC3339(objectMap, "end", l.End) + populate(objectMap, "endReason", l.EndReason) + populate(objectMap, "ingestInterruptions", l.IngestInterruptions) + populate(objectMap, "streamName", l.StreamName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LiveEventIngestion. +func (l *LiveEventIngestion) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "begin": + err = unpopulateTimeRFC3339(val, "Begin", &l.Begin) + delete(rawMsg, key) + case "end": + err = unpopulateTimeRFC3339(val, "End", &l.End) + delete(rawMsg, key) + case "endReason": + err = unpopulate(val, "EndReason", &l.EndReason) + delete(rawMsg, key) + case "ingestInterruptions": + err = unpopulate(val, "IngestInterruptions", &l.IngestInterruptions) + delete(rawMsg, key) + case "streamName": + err = unpopulate(val, "StreamName", &l.StreamName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type LiveEventInput. func (l LiveEventInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "accessControl", l.AccessControl) populate(objectMap, "accessToken", l.AccessToken) populate(objectMap, "endpoints", l.Endpoints) populate(objectMap, "keyFrameIntervalDuration", l.KeyFrameIntervalDuration) populate(objectMap, "streamingProtocol", l.StreamingProtocol) + populate(objectMap, "timedMetadataEndpoints", l.TimedMetadataEndpoints) return json.Marshal(objectMap) } @@ -4961,6 +5129,9 @@ func (l *LiveEventInput) UnmarshalJSON(data []byte) error { case "streamingProtocol": err = unpopulate(val, "StreamingProtocol", &l.StreamingProtocol) delete(rawMsg, key) + case "timedMetadataEndpoints": + err = unpopulate(val, "TimedMetadataEndpoints", &l.TimedMetadataEndpoints) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", l, err) @@ -4971,7 +5142,7 @@ func (l *LiveEventInput) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type LiveEventInputAccessControl. func (l LiveEventInputAccessControl) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "ip", l.IP) return json.Marshal(objectMap) } @@ -4998,7 +5169,7 @@ func (l *LiveEventInputAccessControl) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type LiveEventInputTrackSelection. func (l LiveEventInputTrackSelection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "operation", l.Operation) populate(objectMap, "property", l.Property) populate(objectMap, "value", l.Value) @@ -5033,7 +5204,7 @@ func (l *LiveEventInputTrackSelection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type LiveEventListResult. func (l LiveEventListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "@odata.count", l.ODataCount) populate(objectMap, "@odata.nextLink", l.ODataNextLink) populate(objectMap, "value", l.Value) @@ -5068,7 +5239,7 @@ func (l *LiveEventListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type LiveEventOutputTranscriptionTrack. func (l LiveEventOutputTranscriptionTrack) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "trackName", l.TrackName) return json.Marshal(objectMap) } @@ -5095,7 +5266,7 @@ func (l *LiveEventOutputTranscriptionTrack) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type LiveEventPreview. func (l LiveEventPreview) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "accessControl", l.AccessControl) populate(objectMap, "alternativeMediaId", l.AlternativeMediaID) populate(objectMap, "endpoints", l.Endpoints) @@ -5138,7 +5309,7 @@ func (l *LiveEventPreview) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type LiveEventPreviewAccessControl. func (l LiveEventPreviewAccessControl) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "ip", l.IP) return json.Marshal(objectMap) } @@ -5165,7 +5336,7 @@ func (l *LiveEventPreviewAccessControl) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type LiveEventProperties. func (l LiveEventProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "created", l.Created) populate(objectMap, "crossSiteAccessPolicies", l.CrossSiteAccessPolicies) populate(objectMap, "description", l.Description) @@ -5238,9 +5409,430 @@ func (l *LiveEventProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type LiveEventStatus. +func (l LiveEventStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "healthDescriptions", l.HealthDescriptions) + populate(objectMap, "healthStatus", l.HealthStatus) + populate(objectMap, "ingestion", l.Ingestion) + populateTimeRFC3339(objectMap, "lastUpdatedTime", l.LastUpdatedTime) + populate(objectMap, "state", l.State) + populate(objectMap, "trackStatus", l.TrackStatus) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LiveEventStatus. +func (l *LiveEventStatus) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "healthDescriptions": + err = unpopulate(val, "HealthDescriptions", &l.HealthDescriptions) + delete(rawMsg, key) + case "healthStatus": + err = unpopulate(val, "HealthStatus", &l.HealthStatus) + delete(rawMsg, key) + case "ingestion": + err = unpopulate(val, "Ingestion", &l.Ingestion) + delete(rawMsg, key) + case "lastUpdatedTime": + err = unpopulateTimeRFC3339(val, "LastUpdatedTime", &l.LastUpdatedTime) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &l.State) + delete(rawMsg, key) + case "trackStatus": + err = unpopulate(val, "TrackStatus", &l.TrackStatus) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LiveEventStreamEvent. +func (l LiveEventStreamEvent) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "data", l.Data) + populate(objectMap, "eventLevel", l.EventLevel) + populateTimeRFC3339(objectMap, "eventTime", l.EventTime) + populate(objectMap, "eventType", l.EventType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LiveEventStreamEvent. +func (l *LiveEventStreamEvent) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "data": + err = unpopulate(val, "Data", &l.Data) + delete(rawMsg, key) + case "eventLevel": + err = unpopulate(val, "EventLevel", &l.EventLevel) + delete(rawMsg, key) + case "eventTime": + err = unpopulateTimeRFC3339(val, "EventTime", &l.EventTime) + delete(rawMsg, key) + case "eventType": + err = unpopulate(val, "EventType", &l.EventType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LiveEventStreamEventData. +func (l LiveEventStreamEventData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "bitrate", l.Bitrate) + populate(objectMap, "currentFragmentTimestamp", l.CurrentFragmentTimestamp) + populate(objectMap, "discontinuityGap", l.DiscontinuityGap) + populate(objectMap, "duration", l.Duration) + populate(objectMap, "fragmentDropReason", l.FragmentDropReason) + populate(objectMap, "fragmentOneDuration", l.FragmentOneDuration) + populate(objectMap, "fragmentOneTimestamp", l.FragmentOneTimestamp) + populate(objectMap, "fragmentTwoDuration", l.FragmentTwoDuration) + populate(objectMap, "fragmentTwoTimestamp", l.FragmentTwoTimestamp) + populate(objectMap, "maxTime", l.MaxTime) + populate(objectMap, "maxTimeMediaType", l.MaxTimeMediaType) + populate(objectMap, "mediaTimestamp", l.MediaTimestamp) + populate(objectMap, "mediaType", l.MediaType) + populate(objectMap, "minTime", l.MinTime) + populate(objectMap, "minTimeMediaType", l.MinTimeMediaType) + populate(objectMap, "previousFragmentDuration", l.PreviousFragmentDuration) + populate(objectMap, "previousFragmentTimestamp", l.PreviousFragmentTimestamp) + populate(objectMap, "remoteIp", l.RemoteIP) + populate(objectMap, "remotePort", l.RemotePort) + populate(objectMap, "resolution", l.Resolution) + populate(objectMap, "resultCode", l.ResultCode) + populate(objectMap, "resultMessage", l.ResultMessage) + populate(objectMap, "streamId", l.StreamID) + populate(objectMap, "streamName", l.StreamName) + populate(objectMap, "timescale", l.Timescale) + populate(objectMap, "timescaleOfMaxTime", l.TimescaleOfMaxTime) + populate(objectMap, "timescaleOfMinTime", l.TimescaleOfMinTime) + populate(objectMap, "trackId", l.TrackID) + populate(objectMap, "trackName", l.TrackName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LiveEventStreamEventData. +func (l *LiveEventStreamEventData) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "bitrate": + err = unpopulate(val, "Bitrate", &l.Bitrate) + delete(rawMsg, key) + case "currentFragmentTimestamp": + err = unpopulate(val, "CurrentFragmentTimestamp", &l.CurrentFragmentTimestamp) + delete(rawMsg, key) + case "discontinuityGap": + err = unpopulate(val, "DiscontinuityGap", &l.DiscontinuityGap) + delete(rawMsg, key) + case "duration": + err = unpopulate(val, "Duration", &l.Duration) + delete(rawMsg, key) + case "fragmentDropReason": + err = unpopulate(val, "FragmentDropReason", &l.FragmentDropReason) + delete(rawMsg, key) + case "fragmentOneDuration": + err = unpopulate(val, "FragmentOneDuration", &l.FragmentOneDuration) + delete(rawMsg, key) + case "fragmentOneTimestamp": + err = unpopulate(val, "FragmentOneTimestamp", &l.FragmentOneTimestamp) + delete(rawMsg, key) + case "fragmentTwoDuration": + err = unpopulate(val, "FragmentTwoDuration", &l.FragmentTwoDuration) + delete(rawMsg, key) + case "fragmentTwoTimestamp": + err = unpopulate(val, "FragmentTwoTimestamp", &l.FragmentTwoTimestamp) + delete(rawMsg, key) + case "maxTime": + err = unpopulate(val, "MaxTime", &l.MaxTime) + delete(rawMsg, key) + case "maxTimeMediaType": + err = unpopulate(val, "MaxTimeMediaType", &l.MaxTimeMediaType) + delete(rawMsg, key) + case "mediaTimestamp": + err = unpopulate(val, "MediaTimestamp", &l.MediaTimestamp) + delete(rawMsg, key) + case "mediaType": + err = unpopulate(val, "MediaType", &l.MediaType) + delete(rawMsg, key) + case "minTime": + err = unpopulate(val, "MinTime", &l.MinTime) + delete(rawMsg, key) + case "minTimeMediaType": + err = unpopulate(val, "MinTimeMediaType", &l.MinTimeMediaType) + delete(rawMsg, key) + case "previousFragmentDuration": + err = unpopulate(val, "PreviousFragmentDuration", &l.PreviousFragmentDuration) + delete(rawMsg, key) + case "previousFragmentTimestamp": + err = unpopulate(val, "PreviousFragmentTimestamp", &l.PreviousFragmentTimestamp) + delete(rawMsg, key) + case "remoteIp": + err = unpopulate(val, "RemoteIP", &l.RemoteIP) + delete(rawMsg, key) + case "remotePort": + err = unpopulate(val, "RemotePort", &l.RemotePort) + delete(rawMsg, key) + case "resolution": + err = unpopulate(val, "Resolution", &l.Resolution) + delete(rawMsg, key) + case "resultCode": + err = unpopulate(val, "ResultCode", &l.ResultCode) + delete(rawMsg, key) + case "resultMessage": + err = unpopulate(val, "ResultMessage", &l.ResultMessage) + delete(rawMsg, key) + case "streamId": + err = unpopulate(val, "StreamID", &l.StreamID) + delete(rawMsg, key) + case "streamName": + err = unpopulate(val, "StreamName", &l.StreamName) + delete(rawMsg, key) + case "timescale": + err = unpopulate(val, "Timescale", &l.Timescale) + delete(rawMsg, key) + case "timescaleOfMaxTime": + err = unpopulate(val, "TimescaleOfMaxTime", &l.TimescaleOfMaxTime) + delete(rawMsg, key) + case "timescaleOfMinTime": + err = unpopulate(val, "TimescaleOfMinTime", &l.TimescaleOfMinTime) + delete(rawMsg, key) + case "trackId": + err = unpopulate(val, "TrackID", &l.TrackID) + delete(rawMsg, key) + case "trackName": + err = unpopulate(val, "TrackName", &l.TrackName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LiveEventTimedMetadataEndpoint. +func (l LiveEventTimedMetadataEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "url", l.URL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LiveEventTimedMetadataEndpoint. +func (l *LiveEventTimedMetadataEndpoint) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "url": + err = unpopulate(val, "URL", &l.URL) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LiveEventTrackEvent. +func (l LiveEventTrackEvent) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "data", l.Data) + populateTimeRFC3339(objectMap, "eventTime", l.EventTime) + populate(objectMap, "eventType", l.EventType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LiveEventTrackEvent. +func (l *LiveEventTrackEvent) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "data": + err = unpopulate(val, "Data", &l.Data) + delete(rawMsg, key) + case "eventTime": + err = unpopulateTimeRFC3339(val, "EventTime", &l.EventTime) + delete(rawMsg, key) + case "eventType": + err = unpopulate(val, "EventType", &l.EventType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LiveEventTrackEventData. +func (l LiveEventTrackEventData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "bitrate", l.Bitrate) + populate(objectMap, "discontinuityCount", l.DiscontinuityCount) + populate(objectMap, "healthy", l.Healthy) + populate(objectMap, "incomingBitrate", l.IncomingBitrate) + populate(objectMap, "ingestDriftValue", l.IngestDriftValue) + populateTimeRFC3339(objectMap, "lastFragmentArrivalTime", l.LastFragmentArrivalTime) + populate(objectMap, "lastTimestamp", l.LastTimestamp) + populate(objectMap, "nonincreasingCount", l.NonincreasingCount) + populate(objectMap, "overlapCount", l.OverlapCount) + populate(objectMap, "state", l.State) + populate(objectMap, "timescale", l.Timescale) + populate(objectMap, "trackName", l.TrackName) + populate(objectMap, "trackType", l.TrackType) + populate(objectMap, "transcriptionLanguage", l.TranscriptionLanguage) + populate(objectMap, "transcriptionState", l.TranscriptionState) + populate(objectMap, "unexpectedBitrate", l.UnexpectedBitrate) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LiveEventTrackEventData. +func (l *LiveEventTrackEventData) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "bitrate": + err = unpopulate(val, "Bitrate", &l.Bitrate) + delete(rawMsg, key) + case "discontinuityCount": + err = unpopulate(val, "DiscontinuityCount", &l.DiscontinuityCount) + delete(rawMsg, key) + case "healthy": + err = unpopulate(val, "Healthy", &l.Healthy) + delete(rawMsg, key) + case "incomingBitrate": + err = unpopulate(val, "IncomingBitrate", &l.IncomingBitrate) + delete(rawMsg, key) + case "ingestDriftValue": + err = unpopulate(val, "IngestDriftValue", &l.IngestDriftValue) + delete(rawMsg, key) + case "lastFragmentArrivalTime": + err = unpopulateTimeRFC3339(val, "LastFragmentArrivalTime", &l.LastFragmentArrivalTime) + delete(rawMsg, key) + case "lastTimestamp": + err = unpopulate(val, "LastTimestamp", &l.LastTimestamp) + delete(rawMsg, key) + case "nonincreasingCount": + err = unpopulate(val, "NonincreasingCount", &l.NonincreasingCount) + delete(rawMsg, key) + case "overlapCount": + err = unpopulate(val, "OverlapCount", &l.OverlapCount) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &l.State) + delete(rawMsg, key) + case "timescale": + err = unpopulate(val, "Timescale", &l.Timescale) + delete(rawMsg, key) + case "trackName": + err = unpopulate(val, "TrackName", &l.TrackName) + delete(rawMsg, key) + case "trackType": + err = unpopulate(val, "TrackType", &l.TrackType) + delete(rawMsg, key) + case "transcriptionLanguage": + err = unpopulate(val, "TranscriptionLanguage", &l.TranscriptionLanguage) + delete(rawMsg, key) + case "transcriptionState": + err = unpopulate(val, "TranscriptionState", &l.TranscriptionState) + delete(rawMsg, key) + case "unexpectedBitrate": + err = unpopulate(val, "UnexpectedBitrate", &l.UnexpectedBitrate) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LiveEventTrackStatus. +func (l LiveEventTrackStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "expectedBitrate", l.ExpectedBitrate) + populate(objectMap, "incomingBitrate", l.IncomingBitrate) + populate(objectMap, "ingestDrift", l.IngestDrift) + populate(objectMap, "requestReceived", l.RequestReceived) + populate(objectMap, "requestSucceeded", l.RequestSucceeded) + populate(objectMap, "trackId", l.TrackID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LiveEventTrackStatus. +func (l *LiveEventTrackStatus) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "expectedBitrate": + err = unpopulate(val, "ExpectedBitrate", &l.ExpectedBitrate) + delete(rawMsg, key) + case "incomingBitrate": + err = unpopulate(val, "IncomingBitrate", &l.IncomingBitrate) + delete(rawMsg, key) + case "ingestDrift": + err = unpopulate(val, "IngestDrift", &l.IngestDrift) + delete(rawMsg, key) + case "requestReceived": + err = unpopulate(val, "RequestReceived", &l.RequestReceived) + delete(rawMsg, key) + case "requestSucceeded": + err = unpopulate(val, "RequestSucceeded", &l.RequestSucceeded) + delete(rawMsg, key) + case "trackId": + err = unpopulate(val, "TrackID", &l.TrackID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type LiveEventTranscription. func (l LiveEventTranscription) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "inputTrackSelection", l.InputTrackSelection) populate(objectMap, "language", l.Language) populate(objectMap, "outputTranscriptionTrack", l.OutputTranscriptionTrack) @@ -5275,7 +5867,7 @@ func (l *LiveEventTranscription) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type LiveOutput. func (l LiveOutput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", l.ID) populate(objectMap, "name", l.Name) populate(objectMap, "properties", l.Properties) @@ -5318,7 +5910,7 @@ func (l *LiveOutput) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type LiveOutputListResult. func (l LiveOutputListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "@odata.count", l.ODataCount) populate(objectMap, "@odata.nextLink", l.ODataNextLink) populate(objectMap, "value", l.Value) @@ -5353,7 +5945,7 @@ func (l *LiveOutputListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type LiveOutputProperties. func (l LiveOutputProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "archiveWindowLength", l.ArchiveWindowLength) populate(objectMap, "assetName", l.AssetName) populateTimeRFC3339(objectMap, "created", l.Created) @@ -5420,7 +6012,7 @@ func (l *LiveOutputProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type LogSpecification. func (l LogSpecification) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "blobDuration", l.BlobDuration) populate(objectMap, "displayName", l.DisplayName) populate(objectMap, "name", l.Name) @@ -5455,7 +6047,7 @@ func (l *LogSpecification) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MediaFilterProperties. func (m MediaFilterProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "firstQuality", m.FirstQuality) populate(objectMap, "presentationTimeRange", m.PresentationTimeRange) populate(objectMap, "tracks", m.Tracks) @@ -5490,7 +6082,7 @@ func (m *MediaFilterProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MediaService. func (m MediaService) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", m.ID) populate(objectMap, "identity", m.Identity) populate(objectMap, "location", m.Location) @@ -5545,7 +6137,7 @@ func (m *MediaService) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MediaServiceCollection. func (m MediaServiceCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "@odata.nextLink", m.ODataNextLink) populate(objectMap, "value", m.Value) return json.Marshal(objectMap) @@ -5576,7 +6168,7 @@ func (m *MediaServiceCollection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MediaServiceIdentity. func (m MediaServiceIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "principalId", m.PrincipalID) populate(objectMap, "tenantId", m.TenantID) populate(objectMap, "type", m.Type) @@ -5615,7 +6207,7 @@ func (m *MediaServiceIdentity) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MediaServiceOperationStatus. func (m MediaServiceOperationStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "endTime", m.EndTime) populate(objectMap, "error", m.Error) populate(objectMap, "id", m.ID) @@ -5662,10 +6254,11 @@ func (m *MediaServiceOperationStatus) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MediaServiceProperties. func (m MediaServiceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "encryption", m.Encryption) populate(objectMap, "keyDelivery", m.KeyDelivery) populate(objectMap, "mediaServiceId", m.MediaServiceID) + populate(objectMap, "minimumTlsVersion", m.MinimumTLSVersion) populate(objectMap, "privateEndpointConnections", m.PrivateEndpointConnections) populate(objectMap, "provisioningState", m.ProvisioningState) populate(objectMap, "publicNetworkAccess", m.PublicNetworkAccess) @@ -5692,6 +6285,9 @@ func (m *MediaServiceProperties) UnmarshalJSON(data []byte) error { case "mediaServiceId": err = unpopulate(val, "MediaServiceID", &m.MediaServiceID) delete(rawMsg, key) + case "minimumTlsVersion": + err = unpopulate(val, "MinimumTLSVersion", &m.MinimumTLSVersion) + delete(rawMsg, key) case "privateEndpointConnections": err = unpopulate(val, "PrivateEndpointConnections", &m.PrivateEndpointConnections) delete(rawMsg, key) @@ -5717,7 +6313,7 @@ func (m *MediaServiceProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MediaServiceUpdate. func (m MediaServiceUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "identity", m.Identity) populate(objectMap, "properties", m.Properties) populate(objectMap, "tags", m.Tags) @@ -5752,7 +6348,7 @@ func (m *MediaServiceUpdate) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MetricDimension. func (m MetricDimension) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "displayName", m.DisplayName) populate(objectMap, "name", m.Name) populate(objectMap, "toBeExportedForShoebox", m.ToBeExportedForShoebox) @@ -5787,7 +6383,7 @@ func (m *MetricDimension) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MetricSpecification. func (m MetricSpecification) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "aggregationType", m.AggregationType) populate(objectMap, "dimensions", m.Dimensions) populate(objectMap, "displayDescription", m.DisplayDescription) @@ -5858,7 +6454,7 @@ func (m *MetricSpecification) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Mp4Format. func (m Mp4Format) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "filenamePattern", m.FilenamePattern) objectMap["@odata.type"] = "#Microsoft.Media.Mp4Format" populate(objectMap, "outputFiles", m.OutputFiles) @@ -5893,7 +6489,7 @@ func (m *Mp4Format) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MultiBitrateFormat. func (m MultiBitrateFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "filenamePattern", m.FilenamePattern) objectMap["@odata.type"] = "#Microsoft.Media.MultiBitrateFormat" populate(objectMap, "outputFiles", m.OutputFiles) @@ -5928,7 +6524,7 @@ func (m *MultiBitrateFormat) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type NoEncryption. func (n NoEncryption) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "enabledProtocols", n.EnabledProtocols) return json.Marshal(objectMap) } @@ -5955,7 +6551,7 @@ func (n *NoEncryption) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Operation. func (o Operation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "actionType", o.ActionType) populate(objectMap, "display", o.Display) populate(objectMap, "isDataAction", o.IsDataAction) @@ -6002,7 +6598,7 @@ func (o *Operation) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OperationCollection. func (o OperationCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", o.Value) return json.Marshal(objectMap) } @@ -6029,7 +6625,7 @@ func (o *OperationCollection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OperationDisplay. func (o OperationDisplay) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", o.Description) populate(objectMap, "operation", o.Operation) populate(objectMap, "provider", o.Provider) @@ -6068,7 +6664,7 @@ func (o *OperationDisplay) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OutputFile. func (o OutputFile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "labels", o.Labels) return json.Marshal(objectMap) } @@ -6095,7 +6691,7 @@ func (o *OutputFile) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Overlay. func (o Overlay) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "audioGainLevel", o.AudioGainLevel) populate(objectMap, "end", o.End) populate(objectMap, "fadeInDuration", o.FadeInDuration) @@ -6146,7 +6742,7 @@ func (o *Overlay) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PNGFormat. func (p PNGFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "filenamePattern", p.FilenamePattern) objectMap["@odata.type"] = "#Microsoft.Media.PngFormat" return json.Marshal(objectMap) @@ -6177,7 +6773,7 @@ func (p *PNGFormat) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PNGImage. func (p PNGImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "keyFrameInterval", p.KeyFrameInterval) populate(objectMap, "label", p.Label) populate(objectMap, "layers", p.Layers) @@ -6236,7 +6832,7 @@ func (p *PNGImage) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PNGLayer. func (p PNGLayer) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "height", p.Height) populate(objectMap, "label", p.Label) populate(objectMap, "width", p.Width) @@ -6271,7 +6867,7 @@ func (p *PNGLayer) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PresentationTimeRange. func (p PresentationTimeRange) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "endTimestamp", p.EndTimestamp) populate(objectMap, "forceEndTimestamp", p.ForceEndTimestamp) populate(objectMap, "liveBackoffDuration", p.LiveBackoffDuration) @@ -6318,7 +6914,7 @@ func (p *PresentationTimeRange) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Preset. func (p Preset) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["@odata.type"] = p.ODataType return json.Marshal(objectMap) } @@ -6345,7 +6941,7 @@ func (p *Preset) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PresetConfigurations. func (p PresetConfigurations) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "complexity", p.Complexity) populate(objectMap, "interleaveOutput", p.InterleaveOutput) populate(objectMap, "keyFrameIntervalInSeconds", p.KeyFrameIntervalInSeconds) @@ -6400,7 +6996,7 @@ func (p *PresetConfigurations) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PrivateEndpoint. func (p PrivateEndpoint) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", p.ID) return json.Marshal(objectMap) } @@ -6427,7 +7023,7 @@ func (p *PrivateEndpoint) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection. func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", p.ID) populate(objectMap, "name", p.Name) populate(objectMap, "properties", p.Properties) @@ -6466,7 +7062,7 @@ func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult. func (p PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } @@ -6493,7 +7089,7 @@ func (p *PrivateEndpointConnectionListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties. func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "privateEndpoint", p.PrivateEndpoint) populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) populate(objectMap, "provisioningState", p.ProvisioningState) @@ -6528,7 +7124,7 @@ func (p *PrivateEndpointConnectionProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource. func (p PrivateLinkResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", p.ID) populate(objectMap, "name", p.Name) populate(objectMap, "properties", p.Properties) @@ -6567,7 +7163,7 @@ func (p *PrivateLinkResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult. func (p PrivateLinkResourceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } @@ -6594,7 +7190,7 @@ func (p *PrivateLinkResourceListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties. func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "groupId", p.GroupID) populate(objectMap, "requiredMembers", p.RequiredMembers) populate(objectMap, "requiredZoneNames", p.RequiredZoneNames) @@ -6629,7 +7225,7 @@ func (p *PrivateLinkResourceProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionState. func (p PrivateLinkServiceConnectionState) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "actionsRequired", p.ActionsRequired) populate(objectMap, "description", p.Description) populate(objectMap, "status", p.Status) @@ -6664,7 +7260,7 @@ func (p *PrivateLinkServiceConnectionState) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Properties. func (p Properties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "serviceSpecification", p.ServiceSpecification) return json.Marshal(objectMap) } @@ -6691,7 +7287,7 @@ func (p *Properties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ProxyResource. func (p ProxyResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", p.ID) populate(objectMap, "name", p.Name) populate(objectMap, "type", p.Type) @@ -6726,7 +7322,7 @@ func (p *ProxyResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Rectangle. func (r Rectangle) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "height", r.Height) populate(objectMap, "left", r.Left) populate(objectMap, "top", r.Top) @@ -6765,7 +7361,7 @@ func (r *Rectangle) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Resource. func (r Resource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", r.ID) populate(objectMap, "name", r.Name) populate(objectMap, "type", r.Type) @@ -6800,7 +7396,7 @@ func (r *Resource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ResourceIdentity. func (r ResourceIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "useSystemAssignedIdentity", r.UseSystemAssignedIdentity) populate(objectMap, "userAssignedIdentity", r.UserAssignedIdentity) return json.Marshal(objectMap) @@ -6831,7 +7427,7 @@ func (r *ResourceIdentity) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SelectAudioTrackByAttribute. func (s SelectAudioTrackByAttribute) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "attribute", s.Attribute) populate(objectMap, "channelMapping", s.ChannelMapping) populate(objectMap, "filter", s.Filter) @@ -6874,7 +7470,7 @@ func (s *SelectAudioTrackByAttribute) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SelectAudioTrackByID. func (s SelectAudioTrackByID) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "channelMapping", s.ChannelMapping) objectMap["@odata.type"] = "#Microsoft.Media.SelectAudioTrackById" populate(objectMap, "trackId", s.TrackID) @@ -6909,7 +7505,7 @@ func (s *SelectAudioTrackByID) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SelectVideoTrackByAttribute. func (s SelectVideoTrackByAttribute) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "attribute", s.Attribute) populate(objectMap, "filter", s.Filter) populate(objectMap, "filterValue", s.FilterValue) @@ -6948,7 +7544,7 @@ func (s *SelectVideoTrackByAttribute) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SelectVideoTrackByID. func (s SelectVideoTrackByID) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["@odata.type"] = "#Microsoft.Media.SelectVideoTrackById" populate(objectMap, "trackId", s.TrackID) return json.Marshal(objectMap) @@ -6979,7 +7575,7 @@ func (s *SelectVideoTrackByID) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ServiceSpecification. func (s ServiceSpecification) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "logSpecifications", s.LogSpecifications) populate(objectMap, "metricSpecifications", s.MetricSpecifications) return json.Marshal(objectMap) @@ -7010,7 +7606,7 @@ func (s *ServiceSpecification) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type StandardEncoderPreset. func (s StandardEncoderPreset) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "codecs", s.Codecs) populate(objectMap, "experimentalOptions", s.ExperimentalOptions) populate(objectMap, "filters", s.Filters) @@ -7053,7 +7649,7 @@ func (s *StandardEncoderPreset) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type StorageAccount. func (s StorageAccount) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "identity", s.Identity) populate(objectMap, "status", s.Status) @@ -7092,7 +7688,7 @@ func (s *StorageAccount) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type StorageEncryptedAssetDecryptionData. func (s StorageEncryptedAssetDecryptionData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "assetFileEncryptionMetadata", s.AssetFileEncryptionMetadata) populateByteArray(objectMap, "key", s.Key, runtime.Base64StdFormat) return json.Marshal(objectMap) @@ -7123,7 +7719,7 @@ func (s *StorageEncryptedAssetDecryptionData) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type StreamingEndpoint. func (s StreamingEndpoint) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "location", s.Location) populate(objectMap, "name", s.Name) @@ -7178,7 +7774,7 @@ func (s *StreamingEndpoint) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type StreamingEndpointAccessControl. func (s StreamingEndpointAccessControl) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "akamai", s.Akamai) populate(objectMap, "ip", s.IP) return json.Marshal(objectMap) @@ -7209,7 +7805,7 @@ func (s *StreamingEndpointAccessControl) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type StreamingEndpointListResult. func (s StreamingEndpointListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "@odata.count", s.ODataCount) populate(objectMap, "@odata.nextLink", s.ODataNextLink) populate(objectMap, "value", s.Value) @@ -7244,7 +7840,7 @@ func (s *StreamingEndpointListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type StreamingEndpointProperties. func (s StreamingEndpointProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "accessControl", s.AccessControl) populate(objectMap, "availabilitySetName", s.AvailabilitySetName) populate(objectMap, "cdnEnabled", s.CdnEnabled) @@ -7331,7 +7927,7 @@ func (s *StreamingEndpointProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type StreamingEndpointSKUInfoListResult. func (s StreamingEndpointSKUInfoListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } @@ -7358,7 +7954,7 @@ func (s *StreamingEndpointSKUInfoListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type StreamingEntityScaleUnit. func (s StreamingEntityScaleUnit) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "scaleUnit", s.ScaleUnit) return json.Marshal(objectMap) } @@ -7385,7 +7981,7 @@ func (s *StreamingEntityScaleUnit) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type StreamingLocator. func (s StreamingLocator) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) @@ -7428,7 +8024,7 @@ func (s *StreamingLocator) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type StreamingLocatorCollection. func (s StreamingLocatorCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "@odata.nextLink", s.ODataNextLink) populate(objectMap, "value", s.Value) return json.Marshal(objectMap) @@ -7459,7 +8055,7 @@ func (s *StreamingLocatorCollection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type StreamingLocatorContentKey. func (s StreamingLocatorContentKey) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "labelReferenceInStreamingPolicy", s.LabelReferenceInStreamingPolicy) populate(objectMap, "policyName", s.PolicyName) @@ -7506,7 +8102,7 @@ func (s *StreamingLocatorContentKey) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type StreamingLocatorProperties. func (s StreamingLocatorProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "alternativeMediaId", s.AlternativeMediaID) populate(objectMap, "assetName", s.AssetName) populate(objectMap, "contentKeys", s.ContentKeys) @@ -7569,7 +8165,7 @@ func (s *StreamingLocatorProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type StreamingPath. func (s StreamingPath) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "encryptionScheme", s.EncryptionScheme) populate(objectMap, "paths", s.Paths) populate(objectMap, "streamingProtocol", s.StreamingProtocol) @@ -7604,7 +8200,7 @@ func (s *StreamingPath) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type StreamingPolicy. func (s StreamingPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) @@ -7647,7 +8243,7 @@ func (s *StreamingPolicy) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type StreamingPolicyCollection. func (s StreamingPolicyCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "@odata.nextLink", s.ODataNextLink) populate(objectMap, "value", s.Value) return json.Marshal(objectMap) @@ -7678,7 +8274,7 @@ func (s *StreamingPolicyCollection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type StreamingPolicyContentKey. func (s StreamingPolicyContentKey) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "label", s.Label) populate(objectMap, "policyName", s.PolicyName) populate(objectMap, "tracks", s.Tracks) @@ -7713,7 +8309,7 @@ func (s *StreamingPolicyContentKey) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type StreamingPolicyContentKeys. func (s StreamingPolicyContentKeys) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "defaultKey", s.DefaultKey) populate(objectMap, "keyToTrackMappings", s.KeyToTrackMappings) return json.Marshal(objectMap) @@ -7744,7 +8340,7 @@ func (s *StreamingPolicyContentKeys) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type StreamingPolicyFairPlayConfiguration. func (s StreamingPolicyFairPlayConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "allowPersistentLicense", s.AllowPersistentLicense) populate(objectMap, "customLicenseAcquisitionUrlTemplate", s.CustomLicenseAcquisitionURLTemplate) return json.Marshal(objectMap) @@ -7775,7 +8371,7 @@ func (s *StreamingPolicyFairPlayConfiguration) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type StreamingPolicyPlayReadyConfiguration. func (s StreamingPolicyPlayReadyConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "customLicenseAcquisitionUrlTemplate", s.CustomLicenseAcquisitionURLTemplate) populate(objectMap, "playReadyCustomAttributes", s.PlayReadyCustomAttributes) return json.Marshal(objectMap) @@ -7806,7 +8402,7 @@ func (s *StreamingPolicyPlayReadyConfiguration) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type StreamingPolicyProperties. func (s StreamingPolicyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "commonEncryptionCbcs", s.CommonEncryptionCbcs) populate(objectMap, "commonEncryptionCenc", s.CommonEncryptionCenc) populateTimeRFC3339(objectMap, "created", s.Created) @@ -7853,7 +8449,7 @@ func (s *StreamingPolicyProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type StreamingPolicyWidevineConfiguration. func (s StreamingPolicyWidevineConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "customLicenseAcquisitionUrlTemplate", s.CustomLicenseAcquisitionURLTemplate) return json.Marshal(objectMap) } @@ -7880,7 +8476,7 @@ func (s *StreamingPolicyWidevineConfiguration) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type SyncStorageKeysInput. func (s SyncStorageKeysInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", s.ID) return json.Marshal(objectMap) } @@ -7907,7 +8503,7 @@ func (s *SyncStorageKeysInput) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SystemData. func (s SystemData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) populate(objectMap, "createdBy", s.CreatedBy) populate(objectMap, "createdByType", s.CreatedByType) @@ -7954,7 +8550,7 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TextTrack. func (t TextTrack) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "displayName", t.DisplayName) populate(objectMap, "fileName", t.FileName) populate(objectMap, "hlsSettings", t.HlsSettings) @@ -8001,7 +8597,7 @@ func (t *TextTrack) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TrackBase. func (t TrackBase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["@odata.type"] = t.ODataType return json.Marshal(objectMap) } @@ -8028,7 +8624,7 @@ func (t *TrackBase) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TrackDescriptor. func (t TrackDescriptor) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["@odata.type"] = t.ODataType return json.Marshal(objectMap) } @@ -8055,7 +8651,7 @@ func (t *TrackDescriptor) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TrackPropertyCondition. func (t TrackPropertyCondition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "operation", t.Operation) populate(objectMap, "property", t.Property) populate(objectMap, "value", t.Value) @@ -8090,7 +8686,7 @@ func (t *TrackPropertyCondition) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TrackSelection. func (t TrackSelection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "trackSelections", t.TrackSelections) return json.Marshal(objectMap) } @@ -8117,7 +8713,7 @@ func (t *TrackSelection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TrackedResource. func (t TrackedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", t.ID) populate(objectMap, "location", t.Location) populate(objectMap, "name", t.Name) @@ -8160,7 +8756,7 @@ func (t *TrackedResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Transform. func (t Transform) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", t.ID) populate(objectMap, "name", t.Name) populate(objectMap, "properties", t.Properties) @@ -8203,7 +8799,7 @@ func (t *Transform) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TransformCollection. func (t TransformCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "@odata.nextLink", t.ODataNextLink) populate(objectMap, "value", t.Value) return json.Marshal(objectMap) @@ -8234,7 +8830,7 @@ func (t *TransformCollection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TransformOutput. func (t TransformOutput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "onError", t.OnError) populate(objectMap, "preset", t.Preset) populate(objectMap, "relativePriority", t.RelativePriority) @@ -8269,7 +8865,7 @@ func (t *TransformOutput) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TransformProperties. func (t TransformProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "created", t.Created) populate(objectMap, "description", t.Description) populateTimeRFC3339(objectMap, "lastModified", t.LastModified) @@ -8308,7 +8904,7 @@ func (t *TransformProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TransportStreamFormat. func (t TransportStreamFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "filenamePattern", t.FilenamePattern) objectMap["@odata.type"] = "#Microsoft.Media.TransportStreamFormat" populate(objectMap, "outputFiles", t.OutputFiles) @@ -8343,7 +8939,7 @@ func (t *TransportStreamFormat) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type UTCClipTime. func (u UTCClipTime) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["@odata.type"] = "#Microsoft.Media.UtcClipTime" populateTimeRFC3339(objectMap, "time", u.Time) return json.Marshal(objectMap) @@ -8374,7 +8970,7 @@ func (u *UTCClipTime) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type UserAssignedManagedIdentity. func (u UserAssignedManagedIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "clientId", u.ClientID) populate(objectMap, "principalId", u.PrincipalID) return json.Marshal(objectMap) @@ -8405,7 +9001,7 @@ func (u *UserAssignedManagedIdentity) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Video. func (v Video) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "keyFrameInterval", v.KeyFrameInterval) populate(objectMap, "label", v.Label) objectMap["@odata.type"] = "#Microsoft.Media.Video" @@ -8448,7 +9044,7 @@ func (v *Video) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VideoAnalyzerPreset. func (v VideoAnalyzerPreset) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "audioLanguage", v.AudioLanguage) populate(objectMap, "experimentalOptions", v.ExperimentalOptions) populate(objectMap, "insightsToExtract", v.InsightsToExtract) @@ -8491,7 +9087,7 @@ func (v *VideoAnalyzerPreset) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VideoLayer. func (v VideoLayer) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "adaptiveBFrame", v.AdaptiveBFrame) populate(objectMap, "bFrames", v.BFrames) populate(objectMap, "bitrate", v.Bitrate) @@ -8550,7 +9146,7 @@ func (v *VideoLayer) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VideoOverlay. func (v VideoOverlay) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "audioGainLevel", v.AudioGainLevel) populate(objectMap, "cropRectangle", v.CropRectangle) populate(objectMap, "end", v.End) @@ -8613,7 +9209,7 @@ func (v *VideoOverlay) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VideoTrack. func (v VideoTrack) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["@odata.type"] = "#Microsoft.Media.VideoTrack" return json.Marshal(objectMap) } @@ -8640,7 +9236,7 @@ func (v *VideoTrack) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VideoTrackDescriptor. func (v VideoTrackDescriptor) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["@odata.type"] = "#Microsoft.Media.VideoTrackDescriptor" return json.Marshal(objectMap) } @@ -8665,7 +9261,7 @@ func (v *VideoTrackDescriptor) UnmarshalJSON(data []byte) error { return nil } -func populate(m map[string]interface{}, k string, v interface{}) { +func populate(m map[string]any, k string, v any) { if v == nil { return } else if azcore.IsNullValue(v) { @@ -8675,7 +9271,7 @@ func populate(m map[string]interface{}, k string, v interface{}) { } } -func populateByteArray(m map[string]interface{}, k string, b []byte, f runtime.Base64Encoding) { +func populateByteArray(m map[string]any, k string, b []byte, f runtime.Base64Encoding) { if azcore.IsNullValue(b) { m[k] = nil } else if len(b) == 0 { @@ -8685,7 +9281,7 @@ func populateByteArray(m map[string]interface{}, k string, b []byte, f runtime.B } } -func unpopulate(data json.RawMessage, fn string, v interface{}) error { +func unpopulate(data json.RawMessage, fn string, v any) error { if data == nil { return nil } diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/operationresults_client.go b/sdk/resourcemanager/mediaservices/armmediaservices/operationresults_client.go index 1043f7a43456..6a2197cd381a 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/operationresults_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/operationresults_client.go @@ -33,9 +33,9 @@ type OperationResultsClient struct { } // NewOperationResultsClient creates a new instance of OperationResultsClient with the specified values. -// subscriptionID - The unique identifier for a Microsoft Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The unique identifier for a Microsoft Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewOperationResultsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationResultsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,10 +58,11 @@ func NewOperationResultsClient(subscriptionID string, credential azcore.TokenCre // Get - Get media service operation result. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 -// locationName - Location name. -// operationID - Operation Id. -// options - OperationResultsClientGetOptions contains the optional parameters for the OperationResultsClient.Get method. +// +// Generated from API version 2023-01-01 +// - locationName - Location name. +// - operationID - Operation Id. +// - options - OperationResultsClientGetOptions contains the optional parameters for the OperationResultsClient.Get method. func (client *OperationResultsClient) Get(ctx context.Context, locationName string, operationID string, options *OperationResultsClientGetOptions) (OperationResultsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, locationName, operationID, options) if err != nil { @@ -97,7 +98,7 @@ func (client *OperationResultsClient) getCreateRequest(ctx context.Context, loca return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/operationresults_client_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/operationresults_client_example_test.go deleted file mode 100644 index 8ab00c234519..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/operationresults_client_example_test.go +++ /dev/null @@ -1,36 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armmediaservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mediaservices/armmediaservices/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/media-service-operation-result-by-id.json -func ExampleOperationResultsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewOperationResultsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "westus", "6FBA62C4-99B5-4FF8-9826-FC4744A8864F", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/operations_client.go b/sdk/resourcemanager/mediaservices/armmediaservices/operations_client.go index cf671eab811e..77fe7787a6d1 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/operations_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/operations_client.go @@ -28,8 +28,8 @@ type OperationsClient struct { } // NewOperationsClient creates a new instance of OperationsClient with the specified values. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -51,8 +51,9 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // List - Lists all the Media Services operations. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 -// options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +// +// Generated from API version 2023-01-01 +// - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. func (client *OperationsClient) List(ctx context.Context, options *OperationsClientListOptions) (OperationsClientListResponse, error) { req, err := client.listCreateRequest(ctx, options) if err != nil { @@ -76,7 +77,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/operations_client_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/operations_client_example_test.go deleted file mode 100644 index 2c50a656f256..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/operations_client_example_test.go +++ /dev/null @@ -1,36 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armmediaservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mediaservices/armmediaservices/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/operations-list-all.json -func ExampleOperationsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewOperationsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/operationstatuses_client.go b/sdk/resourcemanager/mediaservices/armmediaservices/operationstatuses_client.go index 6ca002166d82..aea41553f05e 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/operationstatuses_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/operationstatuses_client.go @@ -32,9 +32,9 @@ type OperationStatusesClient struct { } // NewOperationStatusesClient creates a new instance of OperationStatusesClient with the specified values. -// subscriptionID - The unique identifier for a Microsoft Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The unique identifier for a Microsoft Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewOperationStatusesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationStatusesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,10 +57,11 @@ func NewOperationStatusesClient(subscriptionID string, credential azcore.TokenCr // Get - Get media service operation status. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 -// locationName - Location name. -// operationID - Operation ID. -// options - OperationStatusesClientGetOptions contains the optional parameters for the OperationStatusesClient.Get method. +// +// Generated from API version 2023-01-01 +// - locationName - Location name. +// - operationID - Operation ID. +// - options - OperationStatusesClientGetOptions contains the optional parameters for the OperationStatusesClient.Get method. func (client *OperationStatusesClient) Get(ctx context.Context, locationName string, operationID string, options *OperationStatusesClientGetOptions) (OperationStatusesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, locationName, operationID, options) if err != nil { @@ -96,7 +97,7 @@ func (client *OperationStatusesClient) getCreateRequest(ctx context.Context, loc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/operationstatuses_client_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/operationstatuses_client_example_test.go deleted file mode 100644 index 935c52436b0b..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/operationstatuses_client_example_test.go +++ /dev/null @@ -1,74 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armmediaservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mediaservices/armmediaservices/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/media-service-operation-status-by-id-non-terminal-state-failed.json -func ExampleOperationStatusesClient_Get_getStatusOfAsynchronousOperationWhenItIsCompletedWithError() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewOperationStatusesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "westus", "D612C429-2526-49D5-961B-885AE11406FD", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/media-service-operation-status-by-id-terminal-state.json -func ExampleOperationStatusesClient_Get_getStatusOfAsynchronousOperationWhenItIsCompleted() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewOperationStatusesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "westus", "D612C429-2526-49D5-961B-885AE11406FD", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/media-service-operation-status-by-id-non-terminal-state.json -func ExampleOperationStatusesClient_Get_getStatusOfAsynchronousOperationWhenItIsOngoing() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewOperationStatusesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "westus", "D612C429-2526-49D5-961B-885AE11406FD", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/polymorphic_helpers.go b/sdk/resourcemanager/mediaservices/armmediaservices/polymorphic_helpers.go index bcdcadcdf0ba..e3470ba0c25f 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/polymorphic_helpers.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/polymorphic_helpers.go @@ -15,7 +15,7 @@ func unmarshalClipTimeClassification(rawMsg json.RawMessage) (ClipTimeClassifica if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -35,7 +35,7 @@ func unmarshalCodecClassification(rawMsg json.RawMessage) (CodecClassification, if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -92,7 +92,7 @@ func unmarshalContentKeyPolicyConfigurationClassification(rawMsg json.RawMessage if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -118,7 +118,7 @@ func unmarshalContentKeyPolicyPlayReadyContentKeyLocationClassification(rawMsg j if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -138,7 +138,7 @@ func unmarshalContentKeyPolicyRestrictionClassification(rawMsg json.RawMessage) if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -160,7 +160,7 @@ func unmarshalContentKeyPolicyRestrictionTokenKeyClassification(rawMsg json.RawM if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -201,7 +201,7 @@ func unmarshalFormatClassification(rawMsg json.RawMessage) (FormatClassification if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -248,7 +248,7 @@ func unmarshalInputDefinitionClassification(rawMsg json.RawMessage) (InputDefini if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -289,7 +289,7 @@ func unmarshalJobInputClassification(rawMsg json.RawMessage) (JobInputClassifica if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -334,7 +334,7 @@ func unmarshalJobInputClipClassification(rawMsg json.RawMessage) (JobInputClipCl if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -373,7 +373,7 @@ func unmarshalJobOutputClassification(rawMsg json.RawMessage) (JobOutputClassifi if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -410,7 +410,7 @@ func unmarshalOverlayClassification(rawMsg json.RawMessage) (OverlayClassificati if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -449,7 +449,7 @@ func unmarshalPresetClassification(rawMsg json.RawMessage) (PresetClassification if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -475,7 +475,7 @@ func unmarshalTrackBaseClassification(rawMsg json.RawMessage) (TrackBaseClassifi if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -497,7 +497,7 @@ func unmarshalTrackDescriptorClassification(rawMsg json.RawMessage) (TrackDescri if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/privateendpointconnections_client.go b/sdk/resourcemanager/mediaservices/armmediaservices/privateendpointconnections_client.go index ae9b799cf989..3be8a3f69478 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/privateendpointconnections_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/privateendpointconnections_client.go @@ -32,9 +32,9 @@ type PrivateEndpointConnectionsClient struct { } // NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient with the specified values. -// subscriptionID - The unique identifier for a Microsoft Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The unique identifier for a Microsoft Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateEndpointConnectionsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,12 +57,13 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor // CreateOrUpdate - Update an existing private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// parameters - The request parameters -// options - PrivateEndpointConnectionsClientCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.CreateOrUpdate -// method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - parameters - The request parameters +// - options - PrivateEndpointConnectionsClientCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.CreateOrUpdate +// method. func (client *PrivateEndpointConnectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, name string, parameters PrivateEndpointConnection, options *PrivateEndpointConnectionsClientCreateOrUpdateOptions) (PrivateEndpointConnectionsClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, accountName, name, parameters, options) if err != nil { @@ -102,7 +103,7 @@ func (client *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -119,11 +120,12 @@ func (client *PrivateEndpointConnectionsClient) createOrUpdateHandleResponse(res // Delete - Deletes a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// options - PrivateEndpointConnectionsClientDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Delete -// method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - options - PrivateEndpointConnectionsClientDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Delete +// method. func (client *PrivateEndpointConnectionsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, name string, options *PrivateEndpointConnectionsClientDeleteOptions) (PrivateEndpointConnectionsClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, name, options) if err != nil { @@ -163,7 +165,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -171,11 +173,12 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. // Get - Get the details of a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// options - PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get -// method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - options - PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get +// method. func (client *PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, accountName string, name string, options *PrivateEndpointConnectionsClientGetOptions) (PrivateEndpointConnectionsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, name, options) if err != nil { @@ -215,7 +218,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -232,11 +235,12 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res // List - List all private endpoint connections. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// options - PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.List -// method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - options - PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.List +// method. func (client *PrivateEndpointConnectionsClient) List(ctx context.Context, resourceGroupName string, accountName string, options *PrivateEndpointConnectionsClientListOptions) (PrivateEndpointConnectionsClientListResponse, error) { req, err := client.listCreateRequest(ctx, resourceGroupName, accountName, options) if err != nil { @@ -272,7 +276,7 @@ func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/privateendpointconnections_client_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/privateendpointconnections_client_example_test.go deleted file mode 100644 index 9d381023b814..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/privateendpointconnections_client_example_test.go +++ /dev/null @@ -1,99 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armmediaservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mediaservices/armmediaservices/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/private-endpoint-connection-list.json -func ExamplePrivateEndpointConnectionsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewPrivateEndpointConnectionsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, "contoso", "contososports", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/private-endpoint-connection-get-by-name.json -func ExamplePrivateEndpointConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewPrivateEndpointConnectionsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "contoso", "contososports", "connectionName1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/private-endpoint-connection-put.json -func ExamplePrivateEndpointConnectionsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewPrivateEndpointConnectionsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, "contoso", "contososports", "connectionName1", armmediaservices.PrivateEndpointConnection{ - Properties: &armmediaservices.PrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armmediaservices.PrivateLinkServiceConnectionState{ - Description: to.Ptr("Test description."), - Status: to.Ptr(armmediaservices.PrivateEndpointServiceConnectionStatusApproved), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/private-endpoint-connection-delete.json -func ExamplePrivateEndpointConnectionsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewPrivateEndpointConnectionsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, "contoso", "contososports", "connectionName1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/privatelinkresources_client.go b/sdk/resourcemanager/mediaservices/armmediaservices/privatelinkresources_client.go index e1d229b57a36..fcbca5118781 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/privatelinkresources_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/privatelinkresources_client.go @@ -32,9 +32,9 @@ type PrivateLinkResourcesClient struct { } // NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient with the specified values. -// subscriptionID - The unique identifier for a Microsoft Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The unique identifier for a Microsoft Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateLinkResourcesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,11 +57,12 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke // Get - Get details of a group ID. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// options - PrivateLinkResourcesClientGetOptions contains the optional parameters for the PrivateLinkResourcesClient.Get -// method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - options - PrivateLinkResourcesClientGetOptions contains the optional parameters for the PrivateLinkResourcesClient.Get +// method. func (client *PrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupName string, accountName string, name string, options *PrivateLinkResourcesClientGetOptions) (PrivateLinkResourcesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, name, options) if err != nil { @@ -101,7 +102,7 @@ func (client *PrivateLinkResourcesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -118,11 +119,12 @@ func (client *PrivateLinkResourcesClient) getHandleResponse(resp *http.Response) // List - List supported group IDs. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// options - PrivateLinkResourcesClientListOptions contains the optional parameters for the PrivateLinkResourcesClient.List -// method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - options - PrivateLinkResourcesClientListOptions contains the optional parameters for the PrivateLinkResourcesClient.List +// method. func (client *PrivateLinkResourcesClient) List(ctx context.Context, resourceGroupName string, accountName string, options *PrivateLinkResourcesClientListOptions) (PrivateLinkResourcesClientListResponse, error) { req, err := client.listCreateRequest(ctx, resourceGroupName, accountName, options) if err != nil { @@ -158,7 +160,7 @@ func (client *PrivateLinkResourcesClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/privatelinkresources_client_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/privatelinkresources_client_example_test.go deleted file mode 100644 index 32a45193f436..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/privatelinkresources_client_example_test.go +++ /dev/null @@ -1,55 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armmediaservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mediaservices/armmediaservices/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/private-link-resources-list.json -func ExamplePrivateLinkResourcesClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewPrivateLinkResourcesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, "contoso", "contososports", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/private-link-resources-get-by-name.json -func ExamplePrivateLinkResourcesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewPrivateLinkResourcesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "contoso", "contososports", "keydelivery", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/response_types.go b/sdk/resourcemanager/mediaservices/armmediaservices/response_types.go index 273d19f7ce2a..e56e0565e08a 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/response_types.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/response_types.go @@ -24,7 +24,7 @@ type AccountFiltersClientGetResponse struct { AccountFilter } -// AccountFiltersClientListResponse contains the response from method AccountFiltersClient.List. +// AccountFiltersClientListResponse contains the response from method AccountFiltersClient.NewListPager. type AccountFiltersClientListResponse struct { AccountFilterCollection } @@ -49,7 +49,7 @@ type AssetFiltersClientGetResponse struct { AssetFilter } -// AssetFiltersClientListResponse contains the response from method AssetFiltersClient.List. +// AssetFiltersClientListResponse contains the response from method AssetFiltersClient.NewListPager. type AssetFiltersClientListResponse struct { AssetFilterCollection } @@ -102,7 +102,7 @@ type AssetsClientListContainerSasResponse struct { AssetContainerSas } -// AssetsClientListResponse contains the response from method AssetsClient.List. +// AssetsClientListResponse contains the response from method AssetsClient.NewListPager. type AssetsClientListResponse struct { AssetCollection } @@ -117,7 +117,7 @@ type AssetsClientUpdateResponse struct { Asset } -// ClientCreateOrUpdateResponse contains the response from method Client.CreateOrUpdate. +// ClientCreateOrUpdateResponse contains the response from method Client.BeginCreateOrUpdate. type ClientCreateOrUpdateResponse struct { MediaService } @@ -132,7 +132,7 @@ type ClientGetResponse struct { MediaService } -// ClientListBySubscriptionResponse contains the response from method Client.ListBySubscription. +// ClientListBySubscriptionResponse contains the response from method Client.NewListBySubscriptionPager. type ClientListBySubscriptionResponse struct { MediaServiceCollection } @@ -142,7 +142,7 @@ type ClientListEdgePoliciesResponse struct { EdgePolicies } -// ClientListResponse contains the response from method Client.List. +// ClientListResponse contains the response from method Client.NewListPager. type ClientListResponse struct { MediaServiceCollection } @@ -152,7 +152,7 @@ type ClientSyncStorageKeysResponse struct { // placeholder for future response values } -// ClientUpdateResponse contains the response from method Client.Update. +// ClientUpdateResponse contains the response from method Client.BeginUpdate. type ClientUpdateResponse struct { MediaService } @@ -177,7 +177,7 @@ type ContentKeyPoliciesClientGetResponse struct { ContentKeyPolicy } -// ContentKeyPoliciesClientListResponse contains the response from method ContentKeyPoliciesClient.List. +// ContentKeyPoliciesClientListResponse contains the response from method ContentKeyPoliciesClient.NewListPager. type ContentKeyPoliciesClientListResponse struct { ContentKeyPolicyCollection } @@ -207,7 +207,7 @@ type JobsClientGetResponse struct { Job } -// JobsClientListResponse contains the response from method JobsClient.List. +// JobsClientListResponse contains the response from method JobsClient.NewListPager. type JobsClientListResponse struct { JobCollection } @@ -217,7 +217,7 @@ type JobsClientUpdateResponse struct { Job } -// LiveEventsClientAllocateResponse contains the response from method LiveEventsClient.Allocate. +// LiveEventsClientAllocateResponse contains the response from method LiveEventsClient.BeginAllocate. type LiveEventsClientAllocateResponse struct { // placeholder for future response values } @@ -227,12 +227,12 @@ type LiveEventsClientAsyncOperationResponse struct { AsyncOperationResult } -// LiveEventsClientCreateResponse contains the response from method LiveEventsClient.Create. +// LiveEventsClientCreateResponse contains the response from method LiveEventsClient.BeginCreate. type LiveEventsClientCreateResponse struct { LiveEvent } -// LiveEventsClientDeleteResponse contains the response from method LiveEventsClient.Delete. +// LiveEventsClientDeleteResponse contains the response from method LiveEventsClient.BeginDelete. type LiveEventsClientDeleteResponse struct { // placeholder for future response values } @@ -242,7 +242,22 @@ type LiveEventsClientGetResponse struct { LiveEvent } -// LiveEventsClientListResponse contains the response from method LiveEventsClient.List. +// LiveEventsClientListGetStatusResponse contains the response from method LiveEventsClient.BeginListGetStatus. +type LiveEventsClientListGetStatusResponse struct { + LiveEventGetStatusResult +} + +// LiveEventsClientListGetStreamEventsResponse contains the response from method LiveEventsClient.BeginListGetStreamEvents. +type LiveEventsClientListGetStreamEventsResponse struct { + LiveEventGetStreamEventsResult +} + +// LiveEventsClientListGetTrackIngestHeartbeatsResponse contains the response from method LiveEventsClient.BeginListGetTrackIngestHeartbeats. +type LiveEventsClientListGetTrackIngestHeartbeatsResponse struct { + LiveEventGetTrackIngestHeartbeatsResult +} + +// LiveEventsClientListResponse contains the response from method LiveEventsClient.NewListPager. type LiveEventsClientListResponse struct { LiveEventListResult } @@ -252,22 +267,22 @@ type LiveEventsClientOperationLocationResponse struct { LiveEvent } -// LiveEventsClientResetResponse contains the response from method LiveEventsClient.Reset. +// LiveEventsClientResetResponse contains the response from method LiveEventsClient.BeginReset. type LiveEventsClientResetResponse struct { // placeholder for future response values } -// LiveEventsClientStartResponse contains the response from method LiveEventsClient.Start. +// LiveEventsClientStartResponse contains the response from method LiveEventsClient.BeginStart. type LiveEventsClientStartResponse struct { // placeholder for future response values } -// LiveEventsClientStopResponse contains the response from method LiveEventsClient.Stop. +// LiveEventsClientStopResponse contains the response from method LiveEventsClient.BeginStop. type LiveEventsClientStopResponse struct { // placeholder for future response values } -// LiveEventsClientUpdateResponse contains the response from method LiveEventsClient.Update. +// LiveEventsClientUpdateResponse contains the response from method LiveEventsClient.BeginUpdate. type LiveEventsClientUpdateResponse struct { LiveEvent } @@ -277,12 +292,12 @@ type LiveOutputsClientAsyncOperationResponse struct { AsyncOperationResult } -// LiveOutputsClientCreateResponse contains the response from method LiveOutputsClient.Create. +// LiveOutputsClientCreateResponse contains the response from method LiveOutputsClient.BeginCreate. type LiveOutputsClientCreateResponse struct { LiveOutput } -// LiveOutputsClientDeleteResponse contains the response from method LiveOutputsClient.Delete. +// LiveOutputsClientDeleteResponse contains the response from method LiveOutputsClient.BeginDelete. type LiveOutputsClientDeleteResponse struct { // placeholder for future response values } @@ -292,7 +307,7 @@ type LiveOutputsClientGetResponse struct { LiveOutput } -// LiveOutputsClientListResponse contains the response from method LiveOutputsClient.List. +// LiveOutputsClientListResponse contains the response from method LiveOutputsClient.NewListPager. type LiveOutputsClientListResponse struct { LiveOutputListResult } @@ -365,12 +380,12 @@ type StreamingEndpointsClientAsyncOperationResponse struct { AsyncOperationResult } -// StreamingEndpointsClientCreateResponse contains the response from method StreamingEndpointsClient.Create. +// StreamingEndpointsClientCreateResponse contains the response from method StreamingEndpointsClient.BeginCreate. type StreamingEndpointsClientCreateResponse struct { StreamingEndpoint } -// StreamingEndpointsClientDeleteResponse contains the response from method StreamingEndpointsClient.Delete. +// StreamingEndpointsClientDeleteResponse contains the response from method StreamingEndpointsClient.BeginDelete. type StreamingEndpointsClientDeleteResponse struct { // placeholder for future response values } @@ -380,7 +395,7 @@ type StreamingEndpointsClientGetResponse struct { StreamingEndpoint } -// StreamingEndpointsClientListResponse contains the response from method StreamingEndpointsClient.List. +// StreamingEndpointsClientListResponse contains the response from method StreamingEndpointsClient.NewListPager. type StreamingEndpointsClientListResponse struct { StreamingEndpointListResult } @@ -395,22 +410,22 @@ type StreamingEndpointsClientSKUsResponse struct { StreamingEndpointSKUInfoListResult } -// StreamingEndpointsClientScaleResponse contains the response from method StreamingEndpointsClient.Scale. +// StreamingEndpointsClientScaleResponse contains the response from method StreamingEndpointsClient.BeginScale. type StreamingEndpointsClientScaleResponse struct { // placeholder for future response values } -// StreamingEndpointsClientStartResponse contains the response from method StreamingEndpointsClient.Start. +// StreamingEndpointsClientStartResponse contains the response from method StreamingEndpointsClient.BeginStart. type StreamingEndpointsClientStartResponse struct { // placeholder for future response values } -// StreamingEndpointsClientStopResponse contains the response from method StreamingEndpointsClient.Stop. +// StreamingEndpointsClientStopResponse contains the response from method StreamingEndpointsClient.BeginStop. type StreamingEndpointsClientStopResponse struct { // placeholder for future response values } -// StreamingEndpointsClientUpdateResponse contains the response from method StreamingEndpointsClient.Update. +// StreamingEndpointsClientUpdateResponse contains the response from method StreamingEndpointsClient.BeginUpdate. type StreamingEndpointsClientUpdateResponse struct { StreamingEndpoint } @@ -440,7 +455,7 @@ type StreamingLocatorsClientListPathsResponse struct { ListPathsResponse } -// StreamingLocatorsClientListResponse contains the response from method StreamingLocatorsClient.List. +// StreamingLocatorsClientListResponse contains the response from method StreamingLocatorsClient.NewListPager. type StreamingLocatorsClientListResponse struct { StreamingLocatorCollection } @@ -460,17 +475,17 @@ type StreamingPoliciesClientGetResponse struct { StreamingPolicy } -// StreamingPoliciesClientListResponse contains the response from method StreamingPoliciesClient.List. +// StreamingPoliciesClientListResponse contains the response from method StreamingPoliciesClient.NewListPager. type StreamingPoliciesClientListResponse struct { StreamingPolicyCollection } -// TracksClientCreateOrUpdateResponse contains the response from method TracksClient.CreateOrUpdate. +// TracksClientCreateOrUpdateResponse contains the response from method TracksClient.BeginCreateOrUpdate. type TracksClientCreateOrUpdateResponse struct { AssetTrack } -// TracksClientDeleteResponse contains the response from method TracksClient.Delete. +// TracksClientDeleteResponse contains the response from method TracksClient.BeginDelete. type TracksClientDeleteResponse struct { // placeholder for future response values } @@ -480,17 +495,17 @@ type TracksClientGetResponse struct { AssetTrack } -// TracksClientListResponse contains the response from method TracksClient.List. +// TracksClientListResponse contains the response from method TracksClient.NewListPager. type TracksClientListResponse struct { AssetTrackCollection } -// TracksClientUpdateResponse contains the response from method TracksClient.Update. +// TracksClientUpdateResponse contains the response from method TracksClient.BeginUpdate. type TracksClientUpdateResponse struct { AssetTrack } -// TracksClientUpdateTrackDataResponse contains the response from method TracksClient.UpdateTrackData. +// TracksClientUpdateTrackDataResponse contains the response from method TracksClient.BeginUpdateTrackData. type TracksClientUpdateTrackDataResponse struct { // placeholder for future response values } @@ -510,7 +525,7 @@ type TransformsClientGetResponse struct { Transform } -// TransformsClientListResponse contains the response from method TransformsClient.List. +// TransformsClientListResponse contains the response from method TransformsClient.NewListPager. type TransformsClientListResponse struct { TransformCollection } diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/streamingendpoints_client.go b/sdk/resourcemanager/mediaservices/armmediaservices/streamingendpoints_client.go index 67be18e4854d..8a426dd5d7a2 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/streamingendpoints_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/streamingendpoints_client.go @@ -33,9 +33,9 @@ type StreamingEndpointsClient struct { } // NewStreamingEndpointsClient creates a new instance of StreamingEndpointsClient with the specified values. -// subscriptionID - The unique identifier for a Microsoft Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The unique identifier for a Microsoft Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewStreamingEndpointsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*StreamingEndpointsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,12 +58,13 @@ func NewStreamingEndpointsClient(subscriptionID string, credential azcore.TokenC // AsyncOperation - Get a streaming endpoint operation status. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// operationID - The ID of an ongoing async operation. -// options - StreamingEndpointsClientAsyncOperationOptions contains the optional parameters for the StreamingEndpointsClient.AsyncOperation -// method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - operationID - The ID of an ongoing async operation. +// - options - StreamingEndpointsClientAsyncOperationOptions contains the optional parameters for the StreamingEndpointsClient.AsyncOperation +// method. func (client *StreamingEndpointsClient) AsyncOperation(ctx context.Context, resourceGroupName string, accountName string, operationID string, options *StreamingEndpointsClientAsyncOperationOptions) (StreamingEndpointsClientAsyncOperationResponse, error) { req, err := client.asyncOperationCreateRequest(ctx, resourceGroupName, accountName, operationID, options) if err != nil { @@ -103,7 +104,7 @@ func (client *StreamingEndpointsClient) asyncOperationCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -120,13 +121,14 @@ func (client *StreamingEndpointsClient) asyncOperationHandleResponse(resp *http. // BeginCreate - Creates a streaming endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// streamingEndpointName - The name of the streaming endpoint, maximum length is 24. -// parameters - Streaming endpoint properties needed for creation. -// options - StreamingEndpointsClientBeginCreateOptions contains the optional parameters for the StreamingEndpointsClient.BeginCreate -// method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - streamingEndpointName - The name of the streaming endpoint, maximum length is 24. +// - parameters - Streaming endpoint properties needed for creation. +// - options - StreamingEndpointsClientBeginCreateOptions contains the optional parameters for the StreamingEndpointsClient.BeginCreate +// method. func (client *StreamingEndpointsClient) BeginCreate(ctx context.Context, resourceGroupName string, accountName string, streamingEndpointName string, parameters StreamingEndpoint, options *StreamingEndpointsClientBeginCreateOptions) (*runtime.Poller[StreamingEndpointsClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.create(ctx, resourceGroupName, accountName, streamingEndpointName, parameters, options) @@ -141,7 +143,8 @@ func (client *StreamingEndpointsClient) BeginCreate(ctx context.Context, resourc // Create - Creates a streaming endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 +// +// Generated from API version 2022-11-01 func (client *StreamingEndpointsClient) create(ctx context.Context, resourceGroupName string, accountName string, streamingEndpointName string, parameters StreamingEndpoint, options *StreamingEndpointsClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, accountName, streamingEndpointName, parameters, options) if err != nil { @@ -181,7 +184,7 @@ func (client *StreamingEndpointsClient) createCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2022-11-01") if options != nil && options.AutoStart != nil { reqQP.Set("autoStart", strconv.FormatBool(*options.AutoStart)) } @@ -192,12 +195,13 @@ func (client *StreamingEndpointsClient) createCreateRequest(ctx context.Context, // BeginDelete - Deletes a streaming endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// streamingEndpointName - The name of the streaming endpoint, maximum length is 24. -// options - StreamingEndpointsClientBeginDeleteOptions contains the optional parameters for the StreamingEndpointsClient.BeginDelete -// method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - streamingEndpointName - The name of the streaming endpoint, maximum length is 24. +// - options - StreamingEndpointsClientBeginDeleteOptions contains the optional parameters for the StreamingEndpointsClient.BeginDelete +// method. func (client *StreamingEndpointsClient) BeginDelete(ctx context.Context, resourceGroupName string, accountName string, streamingEndpointName string, options *StreamingEndpointsClientBeginDeleteOptions) (*runtime.Poller[StreamingEndpointsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, accountName, streamingEndpointName, options) @@ -212,7 +216,8 @@ func (client *StreamingEndpointsClient) BeginDelete(ctx context.Context, resourc // Delete - Deletes a streaming endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 +// +// Generated from API version 2022-11-01 func (client *StreamingEndpointsClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, streamingEndpointName string, options *StreamingEndpointsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, streamingEndpointName, options) if err != nil { @@ -252,7 +257,7 @@ func (client *StreamingEndpointsClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -260,11 +265,12 @@ func (client *StreamingEndpointsClient) deleteCreateRequest(ctx context.Context, // Get - Gets a streaming endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// streamingEndpointName - The name of the streaming endpoint, maximum length is 24. -// options - StreamingEndpointsClientGetOptions contains the optional parameters for the StreamingEndpointsClient.Get method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - streamingEndpointName - The name of the streaming endpoint, maximum length is 24. +// - options - StreamingEndpointsClientGetOptions contains the optional parameters for the StreamingEndpointsClient.Get method. func (client *StreamingEndpointsClient) Get(ctx context.Context, resourceGroupName string, accountName string, streamingEndpointName string, options *StreamingEndpointsClientGetOptions) (StreamingEndpointsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, streamingEndpointName, options) if err != nil { @@ -304,7 +310,7 @@ func (client *StreamingEndpointsClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -320,10 +326,12 @@ func (client *StreamingEndpointsClient) getHandleResponse(resp *http.Response) ( } // NewListPager - Lists the streaming endpoints in the account. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// options - StreamingEndpointsClientListOptions contains the optional parameters for the StreamingEndpointsClient.List method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - options - StreamingEndpointsClientListOptions contains the optional parameters for the StreamingEndpointsClient.NewListPager +// method. func (client *StreamingEndpointsClient) NewListPager(resourceGroupName string, accountName string, options *StreamingEndpointsClientListOptions) *runtime.Pager[StreamingEndpointsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[StreamingEndpointsClientListResponse]{ More: func(page StreamingEndpointsClientListResponse) bool { @@ -372,7 +380,7 @@ func (client *StreamingEndpointsClient) listCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -389,13 +397,14 @@ func (client *StreamingEndpointsClient) listHandleResponse(resp *http.Response) // OperationLocation - Get a streaming endpoint operation status. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// streamingEndpointName - The name of the streaming endpoint, maximum length is 24. -// operationID - The ID of an ongoing async operation. -// options - StreamingEndpointsClientOperationLocationOptions contains the optional parameters for the StreamingEndpointsClient.OperationLocation -// method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - streamingEndpointName - The name of the streaming endpoint, maximum length is 24. +// - operationID - The ID of an ongoing async operation. +// - options - StreamingEndpointsClientOperationLocationOptions contains the optional parameters for the StreamingEndpointsClient.OperationLocation +// method. func (client *StreamingEndpointsClient) OperationLocation(ctx context.Context, resourceGroupName string, accountName string, streamingEndpointName string, operationID string, options *StreamingEndpointsClientOperationLocationOptions) (StreamingEndpointsClientOperationLocationResponse, error) { req, err := client.operationLocationCreateRequest(ctx, resourceGroupName, accountName, streamingEndpointName, operationID, options) if err != nil { @@ -439,7 +448,7 @@ func (client *StreamingEndpointsClient) operationLocationCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -456,11 +465,12 @@ func (client *StreamingEndpointsClient) operationLocationHandleResponse(resp *ht // SKUs - List streaming endpoint supported skus. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// streamingEndpointName - The name of the streaming endpoint, maximum length is 24. -// options - StreamingEndpointsClientSKUsOptions contains the optional parameters for the StreamingEndpointsClient.SKUs method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - streamingEndpointName - The name of the streaming endpoint, maximum length is 24. +// - options - StreamingEndpointsClientSKUsOptions contains the optional parameters for the StreamingEndpointsClient.SKUs method. func (client *StreamingEndpointsClient) SKUs(ctx context.Context, resourceGroupName string, accountName string, streamingEndpointName string, options *StreamingEndpointsClientSKUsOptions) (StreamingEndpointsClientSKUsResponse, error) { req, err := client.skUsCreateRequest(ctx, resourceGroupName, accountName, streamingEndpointName, options) if err != nil { @@ -500,7 +510,7 @@ func (client *StreamingEndpointsClient) skUsCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -517,13 +527,14 @@ func (client *StreamingEndpointsClient) skUsHandleResponse(resp *http.Response) // BeginScale - Scales an existing streaming endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// streamingEndpointName - The name of the streaming endpoint, maximum length is 24. -// parameters - Streaming endpoint scale parameters -// options - StreamingEndpointsClientBeginScaleOptions contains the optional parameters for the StreamingEndpointsClient.BeginScale -// method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - streamingEndpointName - The name of the streaming endpoint, maximum length is 24. +// - parameters - Streaming endpoint scale parameters +// - options - StreamingEndpointsClientBeginScaleOptions contains the optional parameters for the StreamingEndpointsClient.BeginScale +// method. func (client *StreamingEndpointsClient) BeginScale(ctx context.Context, resourceGroupName string, accountName string, streamingEndpointName string, parameters StreamingEntityScaleUnit, options *StreamingEndpointsClientBeginScaleOptions) (*runtime.Poller[StreamingEndpointsClientScaleResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.scale(ctx, resourceGroupName, accountName, streamingEndpointName, parameters, options) @@ -538,7 +549,8 @@ func (client *StreamingEndpointsClient) BeginScale(ctx context.Context, resource // Scale - Scales an existing streaming endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 +// +// Generated from API version 2022-11-01 func (client *StreamingEndpointsClient) scale(ctx context.Context, resourceGroupName string, accountName string, streamingEndpointName string, parameters StreamingEntityScaleUnit, options *StreamingEndpointsClientBeginScaleOptions) (*http.Response, error) { req, err := client.scaleCreateRequest(ctx, resourceGroupName, accountName, streamingEndpointName, parameters, options) if err != nil { @@ -578,7 +590,7 @@ func (client *StreamingEndpointsClient) scaleCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -586,12 +598,13 @@ func (client *StreamingEndpointsClient) scaleCreateRequest(ctx context.Context, // BeginStart - Starts an existing streaming endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// streamingEndpointName - The name of the streaming endpoint, maximum length is 24. -// options - StreamingEndpointsClientBeginStartOptions contains the optional parameters for the StreamingEndpointsClient.BeginStart -// method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - streamingEndpointName - The name of the streaming endpoint, maximum length is 24. +// - options - StreamingEndpointsClientBeginStartOptions contains the optional parameters for the StreamingEndpointsClient.BeginStart +// method. func (client *StreamingEndpointsClient) BeginStart(ctx context.Context, resourceGroupName string, accountName string, streamingEndpointName string, options *StreamingEndpointsClientBeginStartOptions) (*runtime.Poller[StreamingEndpointsClientStartResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.start(ctx, resourceGroupName, accountName, streamingEndpointName, options) @@ -606,7 +619,8 @@ func (client *StreamingEndpointsClient) BeginStart(ctx context.Context, resource // Start - Starts an existing streaming endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 +// +// Generated from API version 2022-11-01 func (client *StreamingEndpointsClient) start(ctx context.Context, resourceGroupName string, accountName string, streamingEndpointName string, options *StreamingEndpointsClientBeginStartOptions) (*http.Response, error) { req, err := client.startCreateRequest(ctx, resourceGroupName, accountName, streamingEndpointName, options) if err != nil { @@ -646,7 +660,7 @@ func (client *StreamingEndpointsClient) startCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -654,12 +668,13 @@ func (client *StreamingEndpointsClient) startCreateRequest(ctx context.Context, // BeginStop - Stops an existing streaming endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// streamingEndpointName - The name of the streaming endpoint, maximum length is 24. -// options - StreamingEndpointsClientBeginStopOptions contains the optional parameters for the StreamingEndpointsClient.BeginStop -// method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - streamingEndpointName - The name of the streaming endpoint, maximum length is 24. +// - options - StreamingEndpointsClientBeginStopOptions contains the optional parameters for the StreamingEndpointsClient.BeginStop +// method. func (client *StreamingEndpointsClient) BeginStop(ctx context.Context, resourceGroupName string, accountName string, streamingEndpointName string, options *StreamingEndpointsClientBeginStopOptions) (*runtime.Poller[StreamingEndpointsClientStopResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.stop(ctx, resourceGroupName, accountName, streamingEndpointName, options) @@ -674,7 +689,8 @@ func (client *StreamingEndpointsClient) BeginStop(ctx context.Context, resourceG // Stop - Stops an existing streaming endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 +// +// Generated from API version 2022-11-01 func (client *StreamingEndpointsClient) stop(ctx context.Context, resourceGroupName string, accountName string, streamingEndpointName string, options *StreamingEndpointsClientBeginStopOptions) (*http.Response, error) { req, err := client.stopCreateRequest(ctx, resourceGroupName, accountName, streamingEndpointName, options) if err != nil { @@ -714,7 +730,7 @@ func (client *StreamingEndpointsClient) stopCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -722,13 +738,14 @@ func (client *StreamingEndpointsClient) stopCreateRequest(ctx context.Context, r // BeginUpdate - Updates a existing streaming endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// streamingEndpointName - The name of the streaming endpoint, maximum length is 24. -// parameters - Streaming endpoint properties needed for creation. -// options - StreamingEndpointsClientBeginUpdateOptions contains the optional parameters for the StreamingEndpointsClient.BeginUpdate -// method. +// +// Generated from API version 2022-11-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - streamingEndpointName - The name of the streaming endpoint, maximum length is 24. +// - parameters - Streaming endpoint properties needed for creation. +// - options - StreamingEndpointsClientBeginUpdateOptions contains the optional parameters for the StreamingEndpointsClient.BeginUpdate +// method. func (client *StreamingEndpointsClient) BeginUpdate(ctx context.Context, resourceGroupName string, accountName string, streamingEndpointName string, parameters StreamingEndpoint, options *StreamingEndpointsClientBeginUpdateOptions) (*runtime.Poller[StreamingEndpointsClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, accountName, streamingEndpointName, parameters, options) @@ -743,7 +760,8 @@ func (client *StreamingEndpointsClient) BeginUpdate(ctx context.Context, resourc // Update - Updates a existing streaming endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 +// +// Generated from API version 2022-11-01 func (client *StreamingEndpointsClient) update(ctx context.Context, resourceGroupName string, accountName string, streamingEndpointName string, parameters StreamingEndpoint, options *StreamingEndpointsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, streamingEndpointName, parameters, options) if err != nil { @@ -783,7 +801,7 @@ func (client *StreamingEndpointsClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/streamingendpoints_client_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/streamingendpoints_client_example_test.go deleted file mode 100644 index 176d84a6b0de..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/streamingendpoints_client_example_test.go +++ /dev/null @@ -1,297 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armmediaservices_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mediaservices/armmediaservices/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-list-all.json -func ExampleStreamingEndpointsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewStreamingEndpointsClient("0a6ec948-5a62-437d-b9df-934dc7c1b722", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("mediaresources", "slitestmedia10", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-list-by-name.json -func ExampleStreamingEndpointsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewStreamingEndpointsClient("0a6ec948-5a62-437d-b9df-934dc7c1b722", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "mediaresources", "slitestmedia10", "myStreamingEndpoint1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-create.json -func ExampleStreamingEndpointsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewStreamingEndpointsClient("0a6ec948-5a62-437d-b9df-934dc7c1b722", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "mediaresources", "slitestmedia10", "myStreamingEndpoint1", armmediaservices.StreamingEndpoint{ - Location: to.Ptr("West US"), - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - Properties: &armmediaservices.StreamingEndpointProperties{ - Description: to.Ptr("test event 1"), - AccessControl: &armmediaservices.StreamingEndpointAccessControl{ - Akamai: &armmediaservices.AkamaiAccessControl{ - AkamaiSignatureHeaderAuthenticationKeyList: []*armmediaservices.AkamaiSignatureHeaderAuthenticationKey{ - { - Base64Key: to.Ptr("dGVzdGlkMQ=="), - Expiration: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2029-12-31T16:00:00-08:00"); return t }()), - Identifier: to.Ptr("id1"), - }, - { - Base64Key: to.Ptr("dGVzdGlkMQ=="), - Expiration: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2030-12-31T16:00:00-08:00"); return t }()), - Identifier: to.Ptr("id2"), - }}, - }, - IP: &armmediaservices.IPAccessControl{ - Allow: []*armmediaservices.IPRange{ - { - Name: to.Ptr("AllowedIp"), - Address: to.Ptr("192.168.1.1"), - }}, - }, - }, - AvailabilitySetName: to.Ptr("availableset"), - CdnEnabled: to.Ptr(false), - ScaleUnits: to.Ptr[int32](1), - }, - }, &armmediaservices.StreamingEndpointsClientBeginCreateOptions{AutoStart: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-update.json -func ExampleStreamingEndpointsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewStreamingEndpointsClient("0a6ec948-5a62-437d-b9df-934dc7c1b722", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, "mediaresources", "slitestmedia10", "myStreamingEndpoint1", armmediaservices.StreamingEndpoint{ - Location: to.Ptr("West US"), - Tags: map[string]*string{ - "tag3": to.Ptr("value3"), - "tag5": to.Ptr("value5"), - }, - Properties: &armmediaservices.StreamingEndpointProperties{ - Description: to.Ptr("test event 2"), - AvailabilitySetName: to.Ptr("availableset"), - ScaleUnits: to.Ptr[int32](5), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-delete.json -func ExampleStreamingEndpointsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewStreamingEndpointsClient("0a6ec948-5a62-437d-b9df-934dc7c1b722", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, "mediaresources", "slitestmedia10", "myStreamingEndpoint1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-list-skus.json -func ExampleStreamingEndpointsClient_SKUs() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewStreamingEndpointsClient("0a6ec948-5a62-437d-b9df-934dc7c1b722", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.SKUs(ctx, "mediaresources", "slitestmedia10", "myStreamingEndpoint1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-start.json -func ExampleStreamingEndpointsClient_BeginStart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewStreamingEndpointsClient("0a6ec948-5a62-437d-b9df-934dc7c1b722", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginStart(ctx, "mediaresources", "slitestmedia10", "myStreamingEndpoint1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-stop.json -func ExampleStreamingEndpointsClient_BeginStop() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewStreamingEndpointsClient("0a6ec948-5a62-437d-b9df-934dc7c1b722", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginStop(ctx, "mediaresources", "slitestmedia10", "myStreamingEndpoint1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-scale.json -func ExampleStreamingEndpointsClient_BeginScale() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewStreamingEndpointsClient("0a6ec948-5a62-437d-b9df-934dc7c1b722", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginScale(ctx, "mediaresources", "slitestmedia10", "myStreamingEndpoint1", armmediaservices.StreamingEntityScaleUnit{ - ScaleUnit: to.Ptr[int32](5), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/async-operation-result.json -func ExampleStreamingEndpointsClient_AsyncOperation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewStreamingEndpointsClient("0a6ec948-5a62-437d-b9df-934dc7c1b722", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.AsyncOperation(ctx, "mediaresources", "slitestmedia10", "62e4d893-d233-4005-988e-a428d9f77076", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-operation-location.json -func ExampleStreamingEndpointsClient_OperationLocation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewStreamingEndpointsClient("0a6ec948-5a62-437d-b9df-934dc7c1b722", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.OperationLocation(ctx, "mediaresources", "slitestmedia10", "myStreamingEndpoint1", "62e4d893-d233-4005-988e-a428d9f77076", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/streaminglocators_client.go b/sdk/resourcemanager/mediaservices/armmediaservices/streaminglocators_client.go index 28451c258e26..0361b75f5768 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/streaminglocators_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/streaminglocators_client.go @@ -33,9 +33,9 @@ type StreamingLocatorsClient struct { } // NewStreamingLocatorsClient creates a new instance of StreamingLocatorsClient with the specified values. -// subscriptionID - The unique identifier for a Microsoft Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The unique identifier for a Microsoft Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewStreamingLocatorsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*StreamingLocatorsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,13 +58,14 @@ func NewStreamingLocatorsClient(subscriptionID string, credential azcore.TokenCr // Create - Create a Streaming Locator in the Media Services account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// streamingLocatorName - The Streaming Locator name. -// parameters - The request parameters -// options - StreamingLocatorsClientCreateOptions contains the optional parameters for the StreamingLocatorsClient.Create -// method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - streamingLocatorName - The Streaming Locator name. +// - parameters - The request parameters +// - options - StreamingLocatorsClientCreateOptions contains the optional parameters for the StreamingLocatorsClient.Create +// method. func (client *StreamingLocatorsClient) Create(ctx context.Context, resourceGroupName string, accountName string, streamingLocatorName string, parameters StreamingLocator, options *StreamingLocatorsClientCreateOptions) (StreamingLocatorsClientCreateResponse, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, accountName, streamingLocatorName, parameters, options) if err != nil { @@ -104,7 +105,7 @@ func (client *StreamingLocatorsClient) createCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -121,12 +122,13 @@ func (client *StreamingLocatorsClient) createHandleResponse(resp *http.Response) // Delete - Deletes a Streaming Locator in the Media Services account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// streamingLocatorName - The Streaming Locator name. -// options - StreamingLocatorsClientDeleteOptions contains the optional parameters for the StreamingLocatorsClient.Delete -// method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - streamingLocatorName - The Streaming Locator name. +// - options - StreamingLocatorsClientDeleteOptions contains the optional parameters for the StreamingLocatorsClient.Delete +// method. func (client *StreamingLocatorsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, streamingLocatorName string, options *StreamingLocatorsClientDeleteOptions) (StreamingLocatorsClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, streamingLocatorName, options) if err != nil { @@ -166,7 +168,7 @@ func (client *StreamingLocatorsClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -174,11 +176,12 @@ func (client *StreamingLocatorsClient) deleteCreateRequest(ctx context.Context, // Get - Get the details of a Streaming Locator in the Media Services account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// streamingLocatorName - The Streaming Locator name. -// options - StreamingLocatorsClientGetOptions contains the optional parameters for the StreamingLocatorsClient.Get method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - streamingLocatorName - The Streaming Locator name. +// - options - StreamingLocatorsClientGetOptions contains the optional parameters for the StreamingLocatorsClient.Get method. func (client *StreamingLocatorsClient) Get(ctx context.Context, resourceGroupName string, accountName string, streamingLocatorName string, options *StreamingLocatorsClientGetOptions) (StreamingLocatorsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, streamingLocatorName, options) if err != nil { @@ -218,7 +221,7 @@ func (client *StreamingLocatorsClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -234,10 +237,12 @@ func (client *StreamingLocatorsClient) getHandleResponse(resp *http.Response) (S } // NewListPager - Lists the Streaming Locators in the account -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// options - StreamingLocatorsClientListOptions contains the optional parameters for the StreamingLocatorsClient.List method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - options - StreamingLocatorsClientListOptions contains the optional parameters for the StreamingLocatorsClient.NewListPager +// method. func (client *StreamingLocatorsClient) NewListPager(resourceGroupName string, accountName string, options *StreamingLocatorsClientListOptions) *runtime.Pager[StreamingLocatorsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[StreamingLocatorsClientListResponse]{ More: func(page StreamingLocatorsClientListResponse) bool { @@ -286,7 +291,7 @@ func (client *StreamingLocatorsClient) listCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2023-01-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -312,12 +317,13 @@ func (client *StreamingLocatorsClient) listHandleResponse(resp *http.Response) ( // ListContentKeys - List Content Keys used by this Streaming Locator // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// streamingLocatorName - The Streaming Locator name. -// options - StreamingLocatorsClientListContentKeysOptions contains the optional parameters for the StreamingLocatorsClient.ListContentKeys -// method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - streamingLocatorName - The Streaming Locator name. +// - options - StreamingLocatorsClientListContentKeysOptions contains the optional parameters for the StreamingLocatorsClient.ListContentKeys +// method. func (client *StreamingLocatorsClient) ListContentKeys(ctx context.Context, resourceGroupName string, accountName string, streamingLocatorName string, options *StreamingLocatorsClientListContentKeysOptions) (StreamingLocatorsClientListContentKeysResponse, error) { req, err := client.listContentKeysCreateRequest(ctx, resourceGroupName, accountName, streamingLocatorName, options) if err != nil { @@ -357,7 +363,7 @@ func (client *StreamingLocatorsClient) listContentKeysCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -374,12 +380,13 @@ func (client *StreamingLocatorsClient) listContentKeysHandleResponse(resp *http. // ListPaths - List Paths supported by this Streaming Locator // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// streamingLocatorName - The Streaming Locator name. -// options - StreamingLocatorsClientListPathsOptions contains the optional parameters for the StreamingLocatorsClient.ListPaths -// method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - streamingLocatorName - The Streaming Locator name. +// - options - StreamingLocatorsClientListPathsOptions contains the optional parameters for the StreamingLocatorsClient.ListPaths +// method. func (client *StreamingLocatorsClient) ListPaths(ctx context.Context, resourceGroupName string, accountName string, streamingLocatorName string, options *StreamingLocatorsClientListPathsOptions) (StreamingLocatorsClientListPathsResponse, error) { req, err := client.listPathsCreateRequest(ctx, resourceGroupName, accountName, streamingLocatorName, options) if err != nil { @@ -419,7 +426,7 @@ func (client *StreamingLocatorsClient) listPathsCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/streaminglocators_client_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/streaminglocators_client_example_test.go deleted file mode 100644 index bfb2a269368f..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/streaminglocators_client_example_test.go +++ /dev/null @@ -1,225 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armmediaservices_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mediaservices/armmediaservices/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-locators-list.json -func ExampleStreamingLocatorsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewStreamingLocatorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("contoso", "contosomedia", &armmediaservices.StreamingLocatorsClientListOptions{Filter: nil, - Top: nil, - Orderby: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-locators-get-by-name.json -func ExampleStreamingLocatorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewStreamingLocatorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "contoso", "contosomedia", "clearStreamingLocator", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-locators-create-clear.json -func ExampleStreamingLocatorsClient_Create_createsAStreamingLocatorWithClearStreaming() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewStreamingLocatorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Create(ctx, "contoso", "contosomedia", "UserCreatedClearStreamingLocator", armmediaservices.StreamingLocator{ - Properties: &armmediaservices.StreamingLocatorProperties{ - AssetName: to.Ptr("ClimbingMountRainier"), - StreamingPolicyName: to.Ptr("clearStreamingPolicy"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-locators-create-secure.json -func ExampleStreamingLocatorsClient_Create_createsAStreamingLocatorWithSecureStreaming() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewStreamingLocatorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Create(ctx, "contoso", "contosomedia", "UserCreatedSecureStreamingLocator", armmediaservices.StreamingLocator{ - Properties: &armmediaservices.StreamingLocatorProperties{ - AssetName: to.Ptr("ClimbingMountRainier"), - EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2028-12-31T23:59:59.9999999Z"); return t }()), - StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-01T00:00:00Z"); return t }()), - StreamingPolicyName: to.Ptr("secureStreamingPolicy"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-locators-create-secure-userDefinedContentKeys.json -func ExampleStreamingLocatorsClient_Create_createsAStreamingLocatorWithUserDefinedContentKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewStreamingLocatorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Create(ctx, "contoso", "contosomedia", "UserCreatedSecureStreamingLocatorWithUserDefinedContentKeys", armmediaservices.StreamingLocator{ - Properties: &armmediaservices.StreamingLocatorProperties{ - AssetName: to.Ptr("ClimbingMountRainier"), - ContentKeys: []*armmediaservices.StreamingLocatorContentKey{ - { - ID: to.Ptr("60000000-0000-0000-0000-000000000001"), - LabelReferenceInStreamingPolicy: to.Ptr("aesDefaultKey"), - Value: to.Ptr("1UqLohAfWsEGkULYxHjYZg=="), - }, - { - ID: to.Ptr("60000000-0000-0000-0000-000000000004"), - LabelReferenceInStreamingPolicy: to.Ptr("cencDefaultKey"), - Value: to.Ptr("4UqLohAfWsEGkULYxHjYZg=="), - }, - { - ID: to.Ptr("60000000-0000-0000-0000-000000000007"), - LabelReferenceInStreamingPolicy: to.Ptr("cbcsDefaultKey"), - Value: to.Ptr("7UqLohAfWsEGkULYxHjYZg=="), - }}, - StreamingLocatorID: to.Ptr("90000000-0000-0000-0000-00000000000A"), - StreamingPolicyName: to.Ptr("secureStreamingPolicy"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-locators-delete.json -func ExampleStreamingLocatorsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewStreamingLocatorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, "contoso", "contosomedia", "clearStreamingLocator", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-locators-list-content-keys.json -func ExampleStreamingLocatorsClient_ListContentKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewStreamingLocatorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListContentKeys(ctx, "contoso", "contosomedia", "secureStreamingLocator", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-locators-list-paths-streaming-and-download.json -func ExampleStreamingLocatorsClient_ListPaths_listPathsWhichHasStreamingPathsAndDownloadPaths() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewStreamingLocatorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListPaths(ctx, "contoso", "contosomedia", "clearStreamingLocator", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-locators-list-paths-streaming-only.json -func ExampleStreamingLocatorsClient_ListPaths_listPathsWhichHasStreamingPathsOnly() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewStreamingLocatorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListPaths(ctx, "contoso", "contosomedia", "secureStreamingLocator", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/streamingpolicies_client.go b/sdk/resourcemanager/mediaservices/armmediaservices/streamingpolicies_client.go index 7ce608bd6d54..0ed852297231 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/streamingpolicies_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/streamingpolicies_client.go @@ -33,9 +33,9 @@ type StreamingPoliciesClient struct { } // NewStreamingPoliciesClient creates a new instance of StreamingPoliciesClient with the specified values. -// subscriptionID - The unique identifier for a Microsoft Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The unique identifier for a Microsoft Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewStreamingPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*StreamingPoliciesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,13 +58,14 @@ func NewStreamingPoliciesClient(subscriptionID string, credential azcore.TokenCr // Create - Create a Streaming Policy in the Media Services account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// streamingPolicyName - The Streaming Policy name. -// parameters - The request parameters -// options - StreamingPoliciesClientCreateOptions contains the optional parameters for the StreamingPoliciesClient.Create -// method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - streamingPolicyName - The Streaming Policy name. +// - parameters - The request parameters +// - options - StreamingPoliciesClientCreateOptions contains the optional parameters for the StreamingPoliciesClient.Create +// method. func (client *StreamingPoliciesClient) Create(ctx context.Context, resourceGroupName string, accountName string, streamingPolicyName string, parameters StreamingPolicy, options *StreamingPoliciesClientCreateOptions) (StreamingPoliciesClientCreateResponse, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, accountName, streamingPolicyName, parameters, options) if err != nil { @@ -104,7 +105,7 @@ func (client *StreamingPoliciesClient) createCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -121,12 +122,13 @@ func (client *StreamingPoliciesClient) createHandleResponse(resp *http.Response) // Delete - Deletes a Streaming Policy in the Media Services account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// streamingPolicyName - The Streaming Policy name. -// options - StreamingPoliciesClientDeleteOptions contains the optional parameters for the StreamingPoliciesClient.Delete -// method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - streamingPolicyName - The Streaming Policy name. +// - options - StreamingPoliciesClientDeleteOptions contains the optional parameters for the StreamingPoliciesClient.Delete +// method. func (client *StreamingPoliciesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, streamingPolicyName string, options *StreamingPoliciesClientDeleteOptions) (StreamingPoliciesClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, streamingPolicyName, options) if err != nil { @@ -166,7 +168,7 @@ func (client *StreamingPoliciesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -174,11 +176,12 @@ func (client *StreamingPoliciesClient) deleteCreateRequest(ctx context.Context, // Get - Get the details of a Streaming Policy in the Media Services account // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// streamingPolicyName - The Streaming Policy name. -// options - StreamingPoliciesClientGetOptions contains the optional parameters for the StreamingPoliciesClient.Get method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - streamingPolicyName - The Streaming Policy name. +// - options - StreamingPoliciesClientGetOptions contains the optional parameters for the StreamingPoliciesClient.Get method. func (client *StreamingPoliciesClient) Get(ctx context.Context, resourceGroupName string, accountName string, streamingPolicyName string, options *StreamingPoliciesClientGetOptions) (StreamingPoliciesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, streamingPolicyName, options) if err != nil { @@ -218,7 +221,7 @@ func (client *StreamingPoliciesClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -234,10 +237,12 @@ func (client *StreamingPoliciesClient) getHandleResponse(resp *http.Response) (S } // NewListPager - Lists the Streaming Policies in the account -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// options - StreamingPoliciesClientListOptions contains the optional parameters for the StreamingPoliciesClient.List method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - options - StreamingPoliciesClientListOptions contains the optional parameters for the StreamingPoliciesClient.NewListPager +// method. func (client *StreamingPoliciesClient) NewListPager(resourceGroupName string, accountName string, options *StreamingPoliciesClientListOptions) *runtime.Pager[StreamingPoliciesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[StreamingPoliciesClientListResponse]{ More: func(page StreamingPoliciesClientListResponse) bool { @@ -286,7 +291,7 @@ func (client *StreamingPoliciesClient) listCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2023-01-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/streamingpolicies_client_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/streamingpolicies_client_example_test.go deleted file mode 100644 index d389777e5969..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/streamingpolicies_client_example_test.go +++ /dev/null @@ -1,404 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armmediaservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mediaservices/armmediaservices/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-policies-list.json -func ExampleStreamingPoliciesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewStreamingPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("contoso", "contosomedia", &armmediaservices.StreamingPoliciesClientListOptions{Filter: nil, - Top: nil, - Orderby: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-policy-get-by-name.json -func ExampleStreamingPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewStreamingPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "contoso", "contosomedia", "clearStreamingPolicy", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-policies-create-commonEncryptionCbcs-clearKeyEncryption.json -func ExampleStreamingPoliciesClient_Create_createsAStreamingPolicyWithClearKeyEncryptionInCommonEncryptionCbcs() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewStreamingPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Create(ctx, "contoso", "contosomedia", "UserCreatedSecureStreamingPolicyWithCommonEncryptionCbcsOnly", armmediaservices.StreamingPolicy{ - Properties: &armmediaservices.StreamingPolicyProperties{ - CommonEncryptionCbcs: &armmediaservices.CommonEncryptionCbcs{ - ClearKeyEncryptionConfiguration: &armmediaservices.ClearKeyEncryptionConfiguration{ - CustomKeysAcquisitionURLTemplate: to.Ptr("https://contoso.com/{AlternativeMediaId}/clearkey/"), - }, - ContentKeys: &armmediaservices.StreamingPolicyContentKeys{ - DefaultKey: &armmediaservices.DefaultKey{ - Label: to.Ptr("cbcsDefaultKey"), - }, - }, - EnabledProtocols: &armmediaservices.EnabledProtocols{ - Dash: to.Ptr(false), - Download: to.Ptr(false), - Hls: to.Ptr(true), - SmoothStreaming: to.Ptr(false), - }, - }, - DefaultContentKeyPolicyName: to.Ptr("PolicyWithMultipleOptions"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-policies-create-commonEncryptionCenc-clearKeyEncryption.json -func ExampleStreamingPoliciesClient_Create_createsAStreamingPolicyWithClearKeyEncryptionInCommonEncryptionCenc() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewStreamingPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Create(ctx, "contoso", "contosomedia", "UserCreatedSecureStreamingPolicyWithCommonEncryptionCencOnly", armmediaservices.StreamingPolicy{ - Properties: &armmediaservices.StreamingPolicyProperties{ - CommonEncryptionCenc: &armmediaservices.CommonEncryptionCenc{ - ClearKeyEncryptionConfiguration: &armmediaservices.ClearKeyEncryptionConfiguration{ - CustomKeysAcquisitionURLTemplate: to.Ptr("https://contoso.com/{AlternativeMediaId}/clearkey/"), - }, - ClearTracks: []*armmediaservices.TrackSelection{ - { - TrackSelections: []*armmediaservices.TrackPropertyCondition{ - { - Operation: to.Ptr(armmediaservices.TrackPropertyCompareOperationEqual), - Property: to.Ptr(armmediaservices.TrackPropertyTypeFourCC), - Value: to.Ptr("hev1"), - }}, - }}, - ContentKeys: &armmediaservices.StreamingPolicyContentKeys{ - DefaultKey: &armmediaservices.DefaultKey{ - Label: to.Ptr("cencDefaultKey"), - }, - }, - EnabledProtocols: &armmediaservices.EnabledProtocols{ - Dash: to.Ptr(true), - Download: to.Ptr(false), - Hls: to.Ptr(false), - SmoothStreaming: to.Ptr(true), - }, - }, - DefaultContentKeyPolicyName: to.Ptr("PolicyWithPlayReadyOptionAndOpenRestriction"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-policies-create-clear.json -func ExampleStreamingPoliciesClient_Create_createsAStreamingPolicyWithClearStreaming() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewStreamingPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Create(ctx, "contoso", "contosomedia", "UserCreatedClearStreamingPolicy", armmediaservices.StreamingPolicy{ - Properties: &armmediaservices.StreamingPolicyProperties{ - NoEncryption: &armmediaservices.NoEncryption{ - EnabledProtocols: &armmediaservices.EnabledProtocols{ - Dash: to.Ptr(true), - Download: to.Ptr(true), - Hls: to.Ptr(true), - SmoothStreaming: to.Ptr(true), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-policies-create-commonEncryptionCbcs-only.json -func ExampleStreamingPoliciesClient_Create_createsAStreamingPolicyWithCommonEncryptionCbcsOnly() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewStreamingPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Create(ctx, "contoso", "contosomedia", "UserCreatedSecureStreamingPolicyWithCommonEncryptionCbcsOnly", armmediaservices.StreamingPolicy{ - Properties: &armmediaservices.StreamingPolicyProperties{ - CommonEncryptionCbcs: &armmediaservices.CommonEncryptionCbcs{ - ContentKeys: &armmediaservices.StreamingPolicyContentKeys{ - DefaultKey: &armmediaservices.DefaultKey{ - Label: to.Ptr("cbcsDefaultKey"), - }, - }, - Drm: &armmediaservices.CbcsDrmConfiguration{ - FairPlay: &armmediaservices.StreamingPolicyFairPlayConfiguration{ - AllowPersistentLicense: to.Ptr(true), - CustomLicenseAcquisitionURLTemplate: to.Ptr("https://contoso.com/{AssetAlternativeId}/fairplay/{ContentKeyId}"), - }, - }, - EnabledProtocols: &armmediaservices.EnabledProtocols{ - Dash: to.Ptr(false), - Download: to.Ptr(false), - Hls: to.Ptr(true), - SmoothStreaming: to.Ptr(false), - }, - }, - DefaultContentKeyPolicyName: to.Ptr("PolicyWithMultipleOptions"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-policies-create-commonEncryptionCenc-only.json -func ExampleStreamingPoliciesClient_Create_createsAStreamingPolicyWithCommonEncryptionCencOnly() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewStreamingPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Create(ctx, "contoso", "contosomedia", "UserCreatedSecureStreamingPolicyWithCommonEncryptionCencOnly", armmediaservices.StreamingPolicy{ - Properties: &armmediaservices.StreamingPolicyProperties{ - CommonEncryptionCenc: &armmediaservices.CommonEncryptionCenc{ - ClearTracks: []*armmediaservices.TrackSelection{ - { - TrackSelections: []*armmediaservices.TrackPropertyCondition{ - { - Operation: to.Ptr(armmediaservices.TrackPropertyCompareOperationEqual), - Property: to.Ptr(armmediaservices.TrackPropertyTypeFourCC), - Value: to.Ptr("hev1"), - }}, - }}, - ContentKeys: &armmediaservices.StreamingPolicyContentKeys{ - DefaultKey: &armmediaservices.DefaultKey{ - Label: to.Ptr("cencDefaultKey"), - }, - }, - Drm: &armmediaservices.CencDrmConfiguration{ - PlayReady: &armmediaservices.StreamingPolicyPlayReadyConfiguration{ - CustomLicenseAcquisitionURLTemplate: to.Ptr("https://contoso.com/{AssetAlternativeId}/playready/{ContentKeyId}"), - PlayReadyCustomAttributes: to.Ptr("PlayReady CustomAttributes"), - }, - Widevine: &armmediaservices.StreamingPolicyWidevineConfiguration{ - CustomLicenseAcquisitionURLTemplate: to.Ptr("https://contoso.com/{AssetAlternativeId}/widevine/{ContentKeyId"), - }, - }, - EnabledProtocols: &armmediaservices.EnabledProtocols{ - Dash: to.Ptr(true), - Download: to.Ptr(false), - Hls: to.Ptr(false), - SmoothStreaming: to.Ptr(true), - }, - }, - DefaultContentKeyPolicyName: to.Ptr("PolicyWithPlayReadyOptionAndOpenRestriction"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-policies-create-envelopeEncryption-only.json -func ExampleStreamingPoliciesClient_Create_createsAStreamingPolicyWithEnvelopeEncryptionOnly() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewStreamingPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Create(ctx, "contoso", "contosomedia", "UserCreatedSecureStreamingPolicyWithEnvelopeEncryptionOnly", armmediaservices.StreamingPolicy{ - Properties: &armmediaservices.StreamingPolicyProperties{ - DefaultContentKeyPolicyName: to.Ptr("PolicyWithClearKeyOptionAndTokenRestriction"), - EnvelopeEncryption: &armmediaservices.EnvelopeEncryption{ - ContentKeys: &armmediaservices.StreamingPolicyContentKeys{ - DefaultKey: &armmediaservices.DefaultKey{ - Label: to.Ptr("aesDefaultKey"), - }, - }, - CustomKeyAcquisitionURLTemplate: to.Ptr("https://contoso.com/{AssetAlternativeId}/envelope/{ContentKeyId}"), - EnabledProtocols: &armmediaservices.EnabledProtocols{ - Dash: to.Ptr(true), - Download: to.Ptr(false), - Hls: to.Ptr(true), - SmoothStreaming: to.Ptr(true), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-policies-create-secure-streaming.json -func ExampleStreamingPoliciesClient_Create_createsAStreamingPolicyWithSecureStreaming() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewStreamingPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Create(ctx, "contoso", "contosomedia", "UserCreatedSecureStreamingPolicy", armmediaservices.StreamingPolicy{ - Properties: &armmediaservices.StreamingPolicyProperties{ - CommonEncryptionCbcs: &armmediaservices.CommonEncryptionCbcs{ - ContentKeys: &armmediaservices.StreamingPolicyContentKeys{ - DefaultKey: &armmediaservices.DefaultKey{ - Label: to.Ptr("cbcsDefaultKey"), - }, - }, - Drm: &armmediaservices.CbcsDrmConfiguration{ - FairPlay: &armmediaservices.StreamingPolicyFairPlayConfiguration{ - AllowPersistentLicense: to.Ptr(true), - CustomLicenseAcquisitionURLTemplate: to.Ptr("https://contoso.com/{AssetAlternativeId}/fairplay/{ContentKeyId}"), - }, - }, - EnabledProtocols: &armmediaservices.EnabledProtocols{ - Dash: to.Ptr(false), - Download: to.Ptr(false), - Hls: to.Ptr(true), - SmoothStreaming: to.Ptr(false), - }, - }, - CommonEncryptionCenc: &armmediaservices.CommonEncryptionCenc{ - ClearTracks: []*armmediaservices.TrackSelection{ - { - TrackSelections: []*armmediaservices.TrackPropertyCondition{ - { - Operation: to.Ptr(armmediaservices.TrackPropertyCompareOperationEqual), - Property: to.Ptr(armmediaservices.TrackPropertyTypeFourCC), - Value: to.Ptr("hev1"), - }}, - }}, - ContentKeys: &armmediaservices.StreamingPolicyContentKeys{ - DefaultKey: &armmediaservices.DefaultKey{ - Label: to.Ptr("cencDefaultKey"), - }, - }, - Drm: &armmediaservices.CencDrmConfiguration{ - PlayReady: &armmediaservices.StreamingPolicyPlayReadyConfiguration{ - CustomLicenseAcquisitionURLTemplate: to.Ptr("https://contoso.com/{AssetAlternativeId}/playready/{ContentKeyId}"), - PlayReadyCustomAttributes: to.Ptr("PlayReady CustomAttributes"), - }, - Widevine: &armmediaservices.StreamingPolicyWidevineConfiguration{ - CustomLicenseAcquisitionURLTemplate: to.Ptr("https://contoso.com/{AssetAlternativeId}/widevine/{ContentKeyId"), - }, - }, - EnabledProtocols: &armmediaservices.EnabledProtocols{ - Dash: to.Ptr(true), - Download: to.Ptr(false), - Hls: to.Ptr(false), - SmoothStreaming: to.Ptr(true), - }, - }, - DefaultContentKeyPolicyName: to.Ptr("PolicyWithMultipleOptions"), - EnvelopeEncryption: &armmediaservices.EnvelopeEncryption{ - ContentKeys: &armmediaservices.StreamingPolicyContentKeys{ - DefaultKey: &armmediaservices.DefaultKey{ - Label: to.Ptr("aesDefaultKey"), - }, - }, - CustomKeyAcquisitionURLTemplate: to.Ptr("https://contoso.com/{AssetAlternativeId}/envelope/{ContentKeyId}"), - EnabledProtocols: &armmediaservices.EnabledProtocols{ - Dash: to.Ptr(true), - Download: to.Ptr(false), - Hls: to.Ptr(true), - SmoothStreaming: to.Ptr(true), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-policies-delete.json -func ExampleStreamingPoliciesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewStreamingPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, "contoso", "contosomedia", "secureStreamingPolicyWithCommonEncryptionCbcsOnly", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/time_rfc3339.go b/sdk/resourcemanager/mediaservices/armmediaservices/time_rfc3339.go index 59986c46def5..4d3aabbdeda7 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/time_rfc3339.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/time_rfc3339.go @@ -62,7 +62,7 @@ func (t *timeRFC3339) Parse(layout, value string) error { return err } -func populateTimeRFC3339(m map[string]interface{}, k string, t *time.Time) { +func populateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return } else if azcore.IsNullValue(t) { diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/tracks_client.go b/sdk/resourcemanager/mediaservices/armmediaservices/tracks_client.go index 65f999315e4e..a11ad9235d17 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/tracks_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/tracks_client.go @@ -32,9 +32,9 @@ type TracksClient struct { } // NewTracksClient creates a new instance of TracksClient with the specified values. -// subscriptionID - The unique identifier for a Microsoft Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The unique identifier for a Microsoft Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewTracksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TracksClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,14 +57,15 @@ func NewTracksClient(subscriptionID string, credential azcore.TokenCredential, o // BeginCreateOrUpdate - Create or update a Track in the asset // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// assetName - The Asset name. -// trackName - The Asset Track name. -// parameters - The request parameters -// options - TracksClientBeginCreateOrUpdateOptions contains the optional parameters for the TracksClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - assetName - The Asset name. +// - trackName - The Asset Track name. +// - parameters - The request parameters +// - options - TracksClientBeginCreateOrUpdateOptions contains the optional parameters for the TracksClient.BeginCreateOrUpdate +// method. func (client *TracksClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, assetName string, trackName string, parameters AssetTrack, options *TracksClientBeginCreateOrUpdateOptions) (*runtime.Poller[TracksClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, accountName, assetName, trackName, parameters, options) @@ -79,7 +80,8 @@ func (client *TracksClient) BeginCreateOrUpdate(ctx context.Context, resourceGro // CreateOrUpdate - Create or update a Track in the asset // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 +// +// Generated from API version 2023-01-01 func (client *TracksClient) createOrUpdate(ctx context.Context, resourceGroupName string, accountName string, assetName string, trackName string, parameters AssetTrack, options *TracksClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, accountName, assetName, trackName, parameters, options) if err != nil { @@ -123,7 +125,7 @@ func (client *TracksClient) createOrUpdateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -131,12 +133,13 @@ func (client *TracksClient) createOrUpdateCreateRequest(ctx context.Context, res // BeginDelete - Deletes a Track in the asset // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// assetName - The Asset name. -// trackName - The Asset Track name. -// options - TracksClientBeginDeleteOptions contains the optional parameters for the TracksClient.BeginDelete method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - assetName - The Asset name. +// - trackName - The Asset Track name. +// - options - TracksClientBeginDeleteOptions contains the optional parameters for the TracksClient.BeginDelete method. func (client *TracksClient) BeginDelete(ctx context.Context, resourceGroupName string, accountName string, assetName string, trackName string, options *TracksClientBeginDeleteOptions) (*runtime.Poller[TracksClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, accountName, assetName, trackName, options) @@ -151,7 +154,8 @@ func (client *TracksClient) BeginDelete(ctx context.Context, resourceGroupName s // Delete - Deletes a Track in the asset // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 +// +// Generated from API version 2023-01-01 func (client *TracksClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, assetName string, trackName string, options *TracksClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, assetName, trackName, options) if err != nil { @@ -195,7 +199,7 @@ func (client *TracksClient) deleteCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -203,12 +207,13 @@ func (client *TracksClient) deleteCreateRequest(ctx context.Context, resourceGro // Get - Get the details of a Track in the Asset // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// assetName - The Asset name. -// trackName - The Asset Track name. -// options - TracksClientGetOptions contains the optional parameters for the TracksClient.Get method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - assetName - The Asset name. +// - trackName - The Asset Track name. +// - options - TracksClientGetOptions contains the optional parameters for the TracksClient.Get method. func (client *TracksClient) Get(ctx context.Context, resourceGroupName string, accountName string, assetName string, trackName string, options *TracksClientGetOptions) (TracksClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, assetName, trackName, options) if err != nil { @@ -252,7 +257,7 @@ func (client *TracksClient) getCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -268,11 +273,12 @@ func (client *TracksClient) getHandleResponse(resp *http.Response) (TracksClient } // NewListPager - Lists the Tracks in the asset -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// assetName - The Asset name. -// options - TracksClientListOptions contains the optional parameters for the TracksClient.List method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - assetName - The Asset name. +// - options - TracksClientListOptions contains the optional parameters for the TracksClient.NewListPager method. func (client *TracksClient) NewListPager(resourceGroupName string, accountName string, assetName string, options *TracksClientListOptions) *runtime.Pager[TracksClientListResponse] { return runtime.NewPager(runtime.PagingHandler[TracksClientListResponse]{ More: func(page TracksClientListResponse) bool { @@ -319,7 +325,7 @@ func (client *TracksClient) listCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -336,13 +342,14 @@ func (client *TracksClient) listHandleResponse(resp *http.Response) (TracksClien // BeginUpdate - Updates an existing Track in the asset // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// assetName - The Asset name. -// trackName - The Asset Track name. -// parameters - The request parameters -// options - TracksClientBeginUpdateOptions contains the optional parameters for the TracksClient.BeginUpdate method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - assetName - The Asset name. +// - trackName - The Asset Track name. +// - parameters - The request parameters +// - options - TracksClientBeginUpdateOptions contains the optional parameters for the TracksClient.BeginUpdate method. func (client *TracksClient) BeginUpdate(ctx context.Context, resourceGroupName string, accountName string, assetName string, trackName string, parameters AssetTrack, options *TracksClientBeginUpdateOptions) (*runtime.Poller[TracksClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, accountName, assetName, trackName, parameters, options) @@ -357,7 +364,8 @@ func (client *TracksClient) BeginUpdate(ctx context.Context, resourceGroupName s // Update - Updates an existing Track in the asset // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 +// +// Generated from API version 2023-01-01 func (client *TracksClient) update(ctx context.Context, resourceGroupName string, accountName string, assetName string, trackName string, parameters AssetTrack, options *TracksClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, assetName, trackName, parameters, options) if err != nil { @@ -401,7 +409,7 @@ func (client *TracksClient) updateCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -413,13 +421,14 @@ func (client *TracksClient) updateCreateRequest(ctx context.Context, resourceGro // may not be reflected immediately. CDN cache may also need to be purged if // applicable. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// assetName - The Asset name. -// trackName - The Asset Track name. -// options - TracksClientBeginUpdateTrackDataOptions contains the optional parameters for the TracksClient.BeginUpdateTrackData -// method. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - assetName - The Asset name. +// - trackName - The Asset Track name. +// - options - TracksClientBeginUpdateTrackDataOptions contains the optional parameters for the TracksClient.BeginUpdateTrackData +// method. func (client *TracksClient) BeginUpdateTrackData(ctx context.Context, resourceGroupName string, accountName string, assetName string, trackName string, options *TracksClientBeginUpdateTrackDataOptions) (*runtime.Poller[TracksClientUpdateTrackDataResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.updateTrackData(ctx, resourceGroupName, accountName, assetName, trackName, options) @@ -438,7 +447,8 @@ func (client *TracksClient) BeginUpdateTrackData(ctx context.Context, resourceGr // may not be reflected immediately. CDN cache may also need to be purged if // applicable. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-08-01 +// +// Generated from API version 2023-01-01 func (client *TracksClient) updateTrackData(ctx context.Context, resourceGroupName string, accountName string, assetName string, trackName string, options *TracksClientBeginUpdateTrackDataOptions) (*http.Response, error) { req, err := client.updateTrackDataCreateRequest(ctx, resourceGroupName, accountName, assetName, trackName, options) if err != nil { @@ -482,7 +492,7 @@ func (client *TracksClient) updateTrackDataCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/tracks_client_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/tracks_client_example_test.go deleted file mode 100644 index 9ee25489ac3b..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/tracks_client_example_test.go +++ /dev/null @@ -1,163 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armmediaservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mediaservices/armmediaservices/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-list-all.json -func ExampleTracksClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewTracksClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("contoso", "contosomedia", "ClimbingMountRainer", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-get-by-name.json -func ExampleTracksClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewTracksClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "contoso", "contosomedia", "ClimbingMountRainer", "text1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-create.json -func ExampleTracksClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewTracksClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, "contoso", "contosomedia", "ClimbingMountRainer", "text3", armmediaservices.AssetTrack{ - Properties: &armmediaservices.AssetTrackProperties{ - Track: &armmediaservices.TextTrack{ - ODataType: to.Ptr("#Microsoft.Media.TextTrack"), - DisplayName: to.Ptr("A new track"), - FileName: to.Ptr("text3.ttml"), - PlayerVisibility: to.Ptr(armmediaservices.VisibilityVisible), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-delete.json -func ExampleTracksClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewTracksClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, "contoso", "contosomedia", "ClimbingMountRainer", "text2", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-update.json -func ExampleTracksClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewTracksClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, "contoso", "contosomedia", "ClimbingMountRainer", "text1", armmediaservices.AssetTrack{ - Properties: &armmediaservices.AssetTrackProperties{ - Track: &armmediaservices.TextTrack{ - ODataType: to.Ptr("#Microsoft.Media.TextTrack"), - DisplayName: to.Ptr("A new name"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-update-data.json -func ExampleTracksClient_BeginUpdateTrackData() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewTracksClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdateTrackData(ctx, "contoso", "contosomedia", "ClimbingMountRainer", "text2", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/transforms_client.go b/sdk/resourcemanager/mediaservices/armmediaservices/transforms_client.go index 40f5ad0062d6..2525304aa5a1 100644 --- a/sdk/resourcemanager/mediaservices/armmediaservices/transforms_client.go +++ b/sdk/resourcemanager/mediaservices/armmediaservices/transforms_client.go @@ -32,9 +32,9 @@ type TransformsClient struct { } // NewTransformsClient creates a new instance of TransformsClient with the specified values. -// subscriptionID - The unique identifier for a Microsoft Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The unique identifier for a Microsoft Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewTransformsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TransformsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,13 +57,14 @@ func NewTransformsClient(subscriptionID string, credential azcore.TokenCredentia // CreateOrUpdate - Creates or updates a new Transform. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-07-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// transformName - The Transform name. -// parameters - The request parameters -// options - TransformsClientCreateOrUpdateOptions contains the optional parameters for the TransformsClient.CreateOrUpdate -// method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - transformName - The Transform name. +// - parameters - The request parameters +// - options - TransformsClientCreateOrUpdateOptions contains the optional parameters for the TransformsClient.CreateOrUpdate +// method. func (client *TransformsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, transformName string, parameters Transform, options *TransformsClientCreateOrUpdateOptions) (TransformsClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, accountName, transformName, parameters, options) if err != nil { @@ -120,11 +121,12 @@ func (client *TransformsClient) createOrUpdateHandleResponse(resp *http.Response // Delete - Deletes a Transform. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-07-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// transformName - The Transform name. -// options - TransformsClientDeleteOptions contains the optional parameters for the TransformsClient.Delete method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - transformName - The Transform name. +// - options - TransformsClientDeleteOptions contains the optional parameters for the TransformsClient.Delete method. func (client *TransformsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, transformName string, options *TransformsClientDeleteOptions) (TransformsClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, transformName, options) if err != nil { @@ -172,11 +174,12 @@ func (client *TransformsClient) deleteCreateRequest(ctx context.Context, resourc // Get - Gets a Transform. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-07-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// transformName - The Transform name. -// options - TransformsClientGetOptions contains the optional parameters for the TransformsClient.Get method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - transformName - The Transform name. +// - options - TransformsClientGetOptions contains the optional parameters for the TransformsClient.Get method. func (client *TransformsClient) Get(ctx context.Context, resourceGroupName string, accountName string, transformName string, options *TransformsClientGetOptions) (TransformsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, transformName, options) if err != nil { @@ -232,10 +235,11 @@ func (client *TransformsClient) getHandleResponse(resp *http.Response) (Transfor } // NewListPager - Lists the Transforms in the account. +// // Generated from API version 2022-07-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// options - TransformsClientListOptions contains the optional parameters for the TransformsClient.List method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - options - TransformsClientListOptions contains the optional parameters for the TransformsClient.NewListPager method. func (client *TransformsClient) NewListPager(resourceGroupName string, accountName string, options *TransformsClientListOptions) *runtime.Pager[TransformsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[TransformsClientListResponse]{ More: func(page TransformsClientListResponse) bool { @@ -307,12 +311,13 @@ func (client *TransformsClient) listHandleResponse(resp *http.Response) (Transfo // Update - Updates a Transform. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-07-01 -// resourceGroupName - The name of the resource group within the Azure subscription. -// accountName - The Media Services account name. -// transformName - The Transform name. -// parameters - The request parameters -// options - TransformsClientUpdateOptions contains the optional parameters for the TransformsClient.Update method. +// - resourceGroupName - The name of the resource group within the Azure subscription. +// - accountName - The Media Services account name. +// - transformName - The Transform name. +// - parameters - The request parameters +// - options - TransformsClientUpdateOptions contains the optional parameters for the TransformsClient.Update method. func (client *TransformsClient) Update(ctx context.Context, resourceGroupName string, accountName string, transformName string, parameters Transform, options *TransformsClientUpdateOptions) (TransformsClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, transformName, parameters, options) if err != nil { diff --git a/sdk/resourcemanager/mediaservices/armmediaservices/transforms_client_example_test.go b/sdk/resourcemanager/mediaservices/armmediaservices/transforms_client_example_test.go deleted file mode 100644 index 4a286626c005..000000000000 --- a/sdk/resourcemanager/mediaservices/armmediaservices/transforms_client_example_test.go +++ /dev/null @@ -1,219 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armmediaservices_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/mediaservices/armmediaservices/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/transforms-list-all.json -func ExampleTransformsClient_NewListPager_listsTheTransforms() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewTransformsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("contosoresources", "contosomedia", &armmediaservices.TransformsClientListOptions{Filter: nil, - Orderby: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/transforms-list-all-filter-by-created.json -func ExampleTransformsClient_NewListPager_listsTheTransformsFilterByCreated() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewTransformsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("contosoresources", "contosomedia", &armmediaservices.TransformsClientListOptions{Filter: to.Ptr("properties/created gt 2021-06-01T00:00:00.0000000Z and properties/created le 2021-06-01T00:00:10.0000000Z"), - Orderby: to.Ptr("properties/created"), - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/transforms-list-all-filter-by-lastmodified.json -func ExampleTransformsClient_NewListPager_listsTheTransformsFilterByLastmodified() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewTransformsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("contosoresources", "contosomedia", &armmediaservices.TransformsClientListOptions{Filter: to.Ptr("properties/lastmodified gt 2021-06-01T00:00:00.0000000Z and properties/lastmodified le 2021-06-01T00:00:10.0000000Z"), - Orderby: to.Ptr("properties/lastmodified desc"), - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/transforms-list-all-filter-by-name.json -func ExampleTransformsClient_NewListPager_listsTheTransformsFilterByName() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewTransformsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("contosoresources", "contosomedia", &armmediaservices.TransformsClientListOptions{Filter: to.Ptr("(name eq 'sampleEncode') or (name eq 'sampleEncodeAndVideoIndex')"), - Orderby: to.Ptr("name desc"), - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/transforms-get-by-name.json -func ExampleTransformsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewTransformsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "contosoresources", "contosomedia", "sampleTransform", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/transforms-create.json -func ExampleTransformsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewTransformsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, "contosoresources", "contosomedia", "createdTransform", armmediaservices.Transform{ - Properties: &armmediaservices.TransformProperties{ - Description: to.Ptr("Example Transform to illustrate create and update."), - Outputs: []*armmediaservices.TransformOutput{ - { - Preset: &armmediaservices.BuiltInStandardEncoderPreset{ - ODataType: to.Ptr("#Microsoft.Media.BuiltInStandardEncoderPreset"), - PresetName: to.Ptr(armmediaservices.EncoderNamedPresetAdaptiveStreaming), - }, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/transforms-delete.json -func ExampleTransformsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewTransformsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, "contosoresources", "contosomedia", "sampleTransform", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/transforms-update.json -func ExampleTransformsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armmediaservices.NewTransformsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, "contosoresources", "contosomedia", "transformToUpdate", armmediaservices.Transform{ - Properties: &armmediaservices.TransformProperties{ - Description: to.Ptr("Example transform to illustrate update."), - Outputs: []*armmediaservices.TransformOutput{ - { - Preset: &armmediaservices.BuiltInStandardEncoderPreset{ - ODataType: to.Ptr("#Microsoft.Media.BuiltInStandardEncoderPreset"), - PresetName: to.Ptr(armmediaservices.EncoderNamedPresetH264MultipleBitrate720P), - }, - RelativePriority: to.Ptr(armmediaservices.PriorityHigh), - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -}