diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/CHANGELOG.md b/sdk/resourcemanager/containerregistry/armcontainerregistry/CHANGELOG.md index 5304a21f57fe..a521defcdffa 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/CHANGELOG.md +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/CHANGELOG.md @@ -1,20 +1,134 @@ # Release History -## 3.0.0-beta.1 (2025-12-08) +## 3.0.0 (2026-01-28) ### Breaking Changes - -- Operation `*RegistriesClient.BeginScheduleRun` has been changed to non-LRO, use `*RegistriesClient.ScheduleRun` instead. -- Operation `*RunsClient.BeginCancel` has been changed to non-LRO, use `*RunsClient.Cancel` instead. -- Operation `*RunsClient.BeginUpdate` has been changed to non-LRO, use `*RunsClient.Update` instead. -- Operation `*TaskRunsClient.BeginDelete` has been changed to non-LRO, use `*TaskRunsClient.Delete` instead. -- Operation `*TasksClient.BeginCreate` has been changed to non-LRO, use `*TasksClient.Create` instead. -- Operation `*TasksClient.BeginDelete` has been changed to non-LRO, use `*TasksClient.Delete` instead. -- Operation `*TasksClient.BeginUpdate` has been changed to non-LRO, use `*TasksClient.Update` instead. +- Registry Task related clients, functions and types has been moved to new package:`sdk/resourcemanager/containerregistry/armcontainerregistrytasks`. +- Enum `Architecture` has been removed +- Enum `AutoGeneratedDomainNameLabelScope` has been removed +- Enum `BaseImageDependencyType` has been removed +- Enum `BaseImageTriggerType` has been removed +- Enum `OS` has been removed +- Enum `RunStatus` has been removed +- Enum `RunType` has been removed +- Enum `SecretObjectType` has been removed +- Enum `SourceControlType` has been removed +- Enum `SourceRegistryLoginMode` has been removed +- Enum `SourceTriggerEvent` has been removed +- Enum `StepType` has been removed +- Enum `TaskStatus` has been removed +- Enum `TokenType` has been removed +- Enum `TriggerStatus` has been removed +- Enum `UpdateTriggerPayloadType` has been removed +- Enum `Variant` has been removed +- Function `NewAgentPoolsClient` has been removed +- Function `*AgentPoolsClient.BeginCreate` has been removed +- Function `*AgentPoolsClient.BeginDelete` has been removed +- Function `*AgentPoolsClient.Get` has been removed +- Function `*AgentPoolsClient.GetQueueStatus` has been removed +- Function `*AgentPoolsClient.NewListPager` has been removed +- Function `*AgentPoolsClient.BeginUpdate` has been removed +- Function `*ClientFactory.NewAgentPoolsClient` has been removed +- Function `*ClientFactory.NewRunsClient` has been removed +- Function `*ClientFactory.NewTaskRunsClient` has been removed +- Function `*ClientFactory.NewTasksClient` has been removed +- Function `*DockerBuildRequest.GetRunRequest` has been removed +- Function `*DockerBuildStep.GetTaskStepProperties` has been removed +- Function `*DockerBuildStepUpdateParameters.GetTaskStepUpdateParameters` has been removed +- Function `*EncodedTaskRunRequest.GetRunRequest` has been removed +- Function `*EncodedTaskStep.GetTaskStepProperties` has been removed +- Function `*EncodedTaskStepUpdateParameters.GetTaskStepUpdateParameters` has been removed +- Function `*FileTaskRunRequest.GetRunRequest` has been removed +- Function `*FileTaskStep.GetTaskStepProperties` has been removed +- Function `*FileTaskStepUpdateParameters.GetTaskStepUpdateParameters` has been removed +- Function `*RegistriesClient.GetBuildSourceUploadURL` has been removed +- Function `*RegistriesClient.BeginScheduleRun` has been removed +- Function `*RunRequest.GetRunRequest` has been removed +- Function `NewRunsClient` has been removed +- Function `*RunsClient.BeginCancel` has been removed +- Function `*RunsClient.Get` has been removed +- Function `*RunsClient.GetLogSasURL` has been removed +- Function `*RunsClient.NewListPager` has been removed +- Function `*RunsClient.BeginUpdate` has been removed +- Function `*TaskRunRequest.GetRunRequest` has been removed +- Function `NewTaskRunsClient` has been removed +- Function `*TaskRunsClient.BeginCreate` has been removed +- Function `*TaskRunsClient.BeginDelete` has been removed +- Function `*TaskRunsClient.Get` has been removed +- Function `*TaskRunsClient.GetDetails` has been removed +- Function `*TaskRunsClient.NewListPager` has been removed +- Function `*TaskRunsClient.BeginUpdate` has been removed +- Function `*TaskStepProperties.GetTaskStepProperties` has been removed +- Function `*TaskStepUpdateParameters.GetTaskStepUpdateParameters` has been removed +- Function `NewTasksClient` has been removed +- Function `*TasksClient.BeginCreate` has been removed +- Function `*TasksClient.BeginDelete` has been removed +- Function `*TasksClient.Get` has been removed +- Function `*TasksClient.GetDetails` has been removed +- Function `*TasksClient.NewListPager` has been removed +- Function `*TasksClient.BeginUpdate` has been removed +- Struct `AgentPool` has been removed +- Struct `AgentPoolListResult` has been removed +- Struct `AgentPoolProperties` has been removed +- Struct `AgentPoolPropertiesUpdateParameters` has been removed +- Struct `AgentPoolQueueStatus` has been removed +- Struct `AgentPoolUpdateParameters` has been removed +- Struct `AgentProperties` has been removed +- Struct `Argument` has been removed +- Struct `AuthInfo` has been removed +- Struct `AuthInfoUpdateParameters` has been removed +- Struct `BaseImageDependency` has been removed +- Struct `BaseImageTrigger` has been removed +- Struct `BaseImageTriggerUpdateParameters` has been removed +- Struct `Credentials` has been removed +- Struct `CustomRegistryCredentials` has been removed +- Struct `DockerBuildRequest` has been removed +- Struct `DockerBuildStep` has been removed +- Struct `DockerBuildStepUpdateParameters` has been removed +- Struct `EncodedTaskRunRequest` has been removed +- Struct `EncodedTaskStep` has been removed +- Struct `EncodedTaskStepUpdateParameters` has been removed +- Struct `FileTaskRunRequest` has been removed +- Struct `FileTaskStep` has been removed +- Struct `FileTaskStepUpdateParameters` has been removed +- Struct `ImageDescriptor` has been removed +- Struct `ImageUpdateTrigger` has been removed +- Struct `OverrideTaskStepProperties` has been removed +- Struct `PlatformProperties` has been removed +- Struct `PlatformUpdateParameters` has been removed +- Struct `Run` has been removed - Struct `RunFilter` has been removed - -### Features Added - -- New field `Identity` in struct `SourceRegistryCredentials` +- Struct `RunGetLogResult` has been removed +- Struct `RunListResult` has been removed +- Struct `RunProperties` has been removed +- Struct `RunUpdateParameters` has been removed +- Struct `SecretObject` has been removed +- Struct `SetValue` has been removed +- Struct `SourceProperties` has been removed +- Struct `SourceRegistryCredentials` has been removed +- Struct `SourceTrigger` has been removed +- Struct `SourceTriggerDescriptor` has been removed +- Struct `SourceTriggerUpdateParameters` has been removed +- Struct `SourceUpdateParameters` has been removed +- Struct `SourceUploadDefinition` has been removed +- Struct `Task` has been removed +- Struct `TaskListResult` has been removed +- Struct `TaskProperties` has been removed +- Struct `TaskPropertiesUpdateParameters` has been removed +- Struct `TaskRun` has been removed +- Struct `TaskRunListResult` has been removed +- Struct `TaskRunProperties` has been removed +- Struct `TaskRunPropertiesUpdateParameters` has been removed +- Struct `TaskRunRequest` has been removed +- Struct `TaskRunUpdateParameters` has been removed +- Struct `TaskUpdateParameters` has been removed +- Struct `TimerTrigger` has been removed +- Struct `TimerTriggerDescriptor` has been removed +- Struct `TimerTriggerUpdateParameters` has been removed +- Struct `TriggerProperties` has been removed +- Struct `TriggerUpdateParameters` has been removed +- Field `AutoGeneratedDomainNameLabelScope`, `ResourceGroupName` of struct `RegistryNameCheckRequest` has been removed +- Field `AvailableLoginServerName` of struct `RegistryNameStatus` has been removed +- Field `AutoGeneratedDomainNameLabelScope` of struct `RegistryProperties` has been removed ## 2.0.0 (2025-11-05) diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/README.md b/sdk/resourcemanager/containerregistry/armcontainerregistry/README.md index f0bffa8b1e3b..e2b5ad4ad417 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/README.md +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/README.md @@ -55,7 +55,7 @@ clientFactory, err := armcontainerregistry.NewClientFactory(, c A client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory. ```go -client := clientFactory.NewAgentPoolsClient() +client := clientFactory.NewCacheRulesClient() ``` ## Fakes diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/agentpools_client.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/agentpools_client.go deleted file mode 100644 index 8f2531197e96..000000000000 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/agentpools_client.go +++ /dev/null @@ -1,495 +0,0 @@ -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcontainerregistry - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// AgentPoolsClient contains the methods for the AgentPools group. -// Don't use this type directly, use NewAgentPoolsClient() instead. -type AgentPoolsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewAgentPoolsClient creates a new instance of AgentPoolsClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - Contains optional client configuration. Pass nil to accept the default values. -func NewAgentPoolsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AgentPoolsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &AgentPoolsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreate - Creates an agent pool for a container registry with the specified parameters. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-03-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - registryName - The name of the Registry -// - agentPoolName - The name of the agent pool. -// - agentPool - The parameters of an agent pool that needs to scheduled. -// - options - AgentPoolsClientBeginCreateOptions contains the optional parameters for the AgentPoolsClient.BeginCreate method. -func (client *AgentPoolsClient) BeginCreate(ctx context.Context, resourceGroupName string, registryName string, agentPoolName string, agentPool AgentPool, options *AgentPoolsClientBeginCreateOptions) (*runtime.Poller[AgentPoolsClientCreateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.create(ctx, resourceGroupName, registryName, agentPoolName, agentPool, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AgentPoolsClientCreateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[AgentPoolsClientCreateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Create - Creates an agent pool for a container registry with the specified parameters. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-03-01-preview -func (client *AgentPoolsClient) create(ctx context.Context, resourceGroupName string, registryName string, agentPoolName string, agentPool AgentPool, options *AgentPoolsClientBeginCreateOptions) (*http.Response, error) { - var err error - const operationName = "AgentPoolsClient.BeginCreate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createCreateRequest(ctx, resourceGroupName, registryName, agentPoolName, agentPool, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createCreateRequest creates the Create request. -func (client *AgentPoolsClient) createCreateRequest(ctx context.Context, resourceGroupName string, registryName string, agentPoolName string, agentPool AgentPool, _ *AgentPoolsClientBeginCreateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}" - 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 registryName == "" { - return nil, errors.New("parameter registryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) - if agentPoolName == "" { - return nil, errors.New("parameter agentPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{agentPoolName}", url.PathEscape(agentPoolName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, agentPool); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - Deletes a specified agent pool resource. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-03-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - registryName - The name of the Registry -// - agentPoolName - The name of the agent pool. -// - options - AgentPoolsClientBeginDeleteOptions contains the optional parameters for the AgentPoolsClient.BeginDelete method. -func (client *AgentPoolsClient) BeginDelete(ctx context.Context, resourceGroupName string, registryName string, agentPoolName string, options *AgentPoolsClientBeginDeleteOptions) (*runtime.Poller[AgentPoolsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, registryName, agentPoolName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AgentPoolsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[AgentPoolsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Deletes a specified agent pool resource. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-03-01-preview -func (client *AgentPoolsClient) deleteOperation(ctx context.Context, resourceGroupName string, registryName string, agentPoolName string, options *AgentPoolsClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "AgentPoolsClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, registryName, agentPoolName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *AgentPoolsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, registryName string, agentPoolName string, _ *AgentPoolsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}" - 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 registryName == "" { - return nil, errors.New("parameter registryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) - if agentPoolName == "" { - return nil, errors.New("parameter agentPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{agentPoolName}", url.PathEscape(agentPoolName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the detailed information for a given agent pool. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-03-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - registryName - The name of the Registry -// - agentPoolName - The name of the agent pool. -// - options - AgentPoolsClientGetOptions contains the optional parameters for the AgentPoolsClient.Get method. -func (client *AgentPoolsClient) Get(ctx context.Context, resourceGroupName string, registryName string, agentPoolName string, options *AgentPoolsClientGetOptions) (AgentPoolsClientGetResponse, error) { - var err error - const operationName = "AgentPoolsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, registryName, agentPoolName, options) - if err != nil { - return AgentPoolsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return AgentPoolsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return AgentPoolsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *AgentPoolsClient) getCreateRequest(ctx context.Context, resourceGroupName string, registryName string, agentPoolName string, _ *AgentPoolsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}" - 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 registryName == "" { - return nil, errors.New("parameter registryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) - if agentPoolName == "" { - return nil, errors.New("parameter agentPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{agentPoolName}", url.PathEscape(agentPoolName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *AgentPoolsClient) getHandleResponse(resp *http.Response) (AgentPoolsClientGetResponse, error) { - result := AgentPoolsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AgentPool); err != nil { - return AgentPoolsClientGetResponse{}, err - } - return result, nil -} - -// GetQueueStatus - Gets the count of queued runs for a given agent pool. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-03-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - registryName - The name of the Registry -// - agentPoolName - The name of the agent pool. -// - options - AgentPoolsClientGetQueueStatusOptions contains the optional parameters for the AgentPoolsClient.GetQueueStatus -// method. -func (client *AgentPoolsClient) GetQueueStatus(ctx context.Context, resourceGroupName string, registryName string, agentPoolName string, options *AgentPoolsClientGetQueueStatusOptions) (AgentPoolsClientGetQueueStatusResponse, error) { - var err error - const operationName = "AgentPoolsClient.GetQueueStatus" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getQueueStatusCreateRequest(ctx, resourceGroupName, registryName, agentPoolName, options) - if err != nil { - return AgentPoolsClientGetQueueStatusResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return AgentPoolsClientGetQueueStatusResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return AgentPoolsClientGetQueueStatusResponse{}, err - } - resp, err := client.getQueueStatusHandleResponse(httpResp) - return resp, err -} - -// getQueueStatusCreateRequest creates the GetQueueStatus request. -func (client *AgentPoolsClient) getQueueStatusCreateRequest(ctx context.Context, resourceGroupName string, registryName string, agentPoolName string, _ *AgentPoolsClientGetQueueStatusOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}/listQueueStatus" - 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 registryName == "" { - return nil, errors.New("parameter registryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) - if agentPoolName == "" { - return nil, errors.New("parameter agentPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{agentPoolName}", url.PathEscape(agentPoolName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getQueueStatusHandleResponse handles the GetQueueStatus response. -func (client *AgentPoolsClient) getQueueStatusHandleResponse(resp *http.Response) (AgentPoolsClientGetQueueStatusResponse, error) { - result := AgentPoolsClientGetQueueStatusResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AgentPoolQueueStatus); err != nil { - return AgentPoolsClientGetQueueStatusResponse{}, err - } - return result, nil -} - -// NewListPager - Lists all the agent pools for a specified container registry. -// -// Generated from API version 2025-03-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - registryName - The name of the Registry -// - options - AgentPoolsClientListOptions contains the optional parameters for the AgentPoolsClient.NewListPager method. -func (client *AgentPoolsClient) NewListPager(resourceGroupName string, registryName string, options *AgentPoolsClientListOptions) *runtime.Pager[AgentPoolsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[AgentPoolsClientListResponse]{ - More: func(page AgentPoolsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *AgentPoolsClientListResponse) (AgentPoolsClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "AgentPoolsClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, registryName, options) - }, nil) - if err != nil { - return AgentPoolsClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *AgentPoolsClient) listCreateRequest(ctx context.Context, resourceGroupName string, registryName string, _ *AgentPoolsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools" - 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 registryName == "" { - return nil, errors.New("parameter registryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *AgentPoolsClient) listHandleResponse(resp *http.Response) (AgentPoolsClientListResponse, error) { - result := AgentPoolsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AgentPoolListResult); err != nil { - return AgentPoolsClientListResponse{}, err - } - return result, nil -} - -// BeginUpdate - Updates an agent pool with the specified parameters. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-03-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - registryName - The name of the Registry -// - agentPoolName - The name of the agent pool. -// - updateParameters - The parameters for updating an agent pool. -// - options - AgentPoolsClientBeginUpdateOptions contains the optional parameters for the AgentPoolsClient.BeginUpdate method. -func (client *AgentPoolsClient) BeginUpdate(ctx context.Context, resourceGroupName string, registryName string, agentPoolName string, updateParameters AgentPoolUpdateParameters, options *AgentPoolsClientBeginUpdateOptions) (*runtime.Poller[AgentPoolsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, registryName, agentPoolName, updateParameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AgentPoolsClientUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[AgentPoolsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - Updates an agent pool with the specified parameters. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-03-01-preview -func (client *AgentPoolsClient) update(ctx context.Context, resourceGroupName string, registryName string, agentPoolName string, updateParameters AgentPoolUpdateParameters, options *AgentPoolsClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "AgentPoolsClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, registryName, agentPoolName, updateParameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *AgentPoolsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, registryName string, agentPoolName string, updateParameters AgentPoolUpdateParameters, _ *AgentPoolsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}" - 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 registryName == "" { - return nil, errors.New("parameter registryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) - if agentPoolName == "" { - return nil, errors.New("parameter agentPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{agentPoolName}", url.PathEscape(agentPoolName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, updateParameters); err != nil { - return nil, err - } - return req, nil -} diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/autorest.md b/sdk/resourcemanager/containerregistry/armcontainerregistry/autorest.md deleted file mode 100644 index bdbc0cb20140..000000000000 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/autorest.md +++ /dev/null @@ -1,15 +0,0 @@ -### AutoRest Configuration - -> see https://aka.ms/autorest - -``` yaml -azure-arm: true -require: -- https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/readme.go.md -license-header: MICROSOFT_MIT_NO_VERSION -module-version: 3.0.0-beta.1 -tag: package-2025-11 -modelerfour: - lenient-model-deduplication: true -``` diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/build.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/build.go deleted file mode 100644 index f0c69abc5ccb..000000000000 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/build.go +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. - -// This file enables 'go generate' to regenerate this specific SDK -//go:generate pwsh ../../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate -removeUnreferencedTypes resourcemanager/containerregistry/armcontainerregistry - -package armcontainerregistry diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/cacherules_client.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/cacherules_client.go index 002629655d3d..9e86505210b7 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/cacherules_client.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/cacherules_client.go @@ -1,7 +1,6 @@ // 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armcontainerregistry @@ -56,8 +55,7 @@ func (client *CacheRulesClient) BeginCreate(ctx context.Context, resourceGroupNa return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CacheRulesClientCreateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -119,6 +117,7 @@ func (client *CacheRulesClient) createCreateRequest(ctx context.Context, resourc reqQP.Set("api-version", "2025-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, cacheRuleCreateParameters); err != nil { return nil, err } @@ -140,8 +139,7 @@ func (client *CacheRulesClient) BeginDelete(ctx context.Context, resourceGroupNa return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CacheRulesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -202,7 +200,6 @@ func (client *CacheRulesClient) deleteCreateRequest(ctx context.Context, resourc reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2025-11-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -355,8 +352,7 @@ func (client *CacheRulesClient) BeginUpdate(ctx context.Context, resourceGroupNa return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CacheRulesClientUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -418,6 +414,7 @@ func (client *CacheRulesClient) updateCreateRequest(ctx context.Context, resourc reqQP.Set("api-version", "2025-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, cacheRuleUpdateParameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/cacherules_client_example_test.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/cacherules_client_example_test.go index 337fe9445c62..08a1ed17e48a 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/cacherules_client_example_test.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/cacherules_client_example_test.go @@ -1,142 +1,167 @@ // 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. -// DO NOT EDIT. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armcontainerregistry_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/containerregistry/armcontainerregistry/v3" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/CacheRuleList.json -func ExampleCacheRulesClient_NewListPager() { +// Generated from example definition: 2025-11-01/CacheRuleCreate.json +func ExampleCacheRulesClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewCacheRulesClient().NewListPager("myResourceGroup", "myRegistry", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CacheRulesListResult = armcontainerregistry.CacheRulesListResult{ - // Value: []*armcontainerregistry.CacheRule{ - // { - // Name: to.Ptr("myCacheRule"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/cacheRules"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/cacheRules/myCacheRule"), - // Properties: &armcontainerregistry.CacheRuleProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-07T18:20:33.837Z"); return t}()), - // CredentialSetResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet"), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // SourceRepository: to.Ptr("docker.io/library/hello-world"), - // TargetRepository: to.Ptr("cached-docker-hub/hello-world"), - // }, - // }}, - // } + poller, err := clientFactory.NewCacheRulesClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", "myCacheRule", armcontainerregistry.CacheRule{ + Properties: &armcontainerregistry.CacheRuleProperties{ + SourceRepository: to.Ptr("docker.io/library/hello-world"), + TargetRepository: to.Ptr("cached-docker-hub/hello-world"), + CredentialSetResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet"), + }, + }, 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) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armcontainerregistry.CacheRulesClientCreateResponse{ + // CacheRule: &armcontainerregistry.CacheRule{ + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/cacheRules"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/cacheRules/myCacheRule"), + // Name: to.Ptr("myCacheRule"), + // Properties: &armcontainerregistry.CacheRuleProperties{ + // CredentialSetResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet"), + // SourceRepository: to.Ptr("docker.io/library/hello-world"), + // TargetRepository: to.Ptr("cached-docker-hub/hello-world"), + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-07T18:20:33.8374968+00:00"); return t}()), + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/CacheRuleGet.json -func ExampleCacheRulesClient_Get() { +// Generated from example definition: 2025-11-01/CacheRuleDelete.json +func ExampleCacheRulesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewCacheRulesClient().Get(ctx, "myResourceGroup", "myRegistry", "myCacheRule", nil) + poller, err := clientFactory.NewCacheRulesClient().BeginDelete(ctx, "myResourceGroup", "myRegistry", "myCacheRule", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CacheRule = armcontainerregistry.CacheRule{ - // Name: to.Ptr("myCacheRule"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/cacheRules"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/cacheRules/myCacheRule"), - // Properties: &armcontainerregistry.CacheRuleProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-07T18:20:33.837Z"); return t}()), - // CredentialSetResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet"), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // SourceRepository: to.Ptr("docker.io/library/hello-world"), - // TargetRepository: to.Ptr("cached-docker-hub/hello-world"), - // }, - // } + _, 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/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/CacheRuleCreate.json -func ExampleCacheRulesClient_BeginCreate() { +// Generated from example definition: 2025-11-01/CacheRuleGet.json +func ExampleCacheRulesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewCacheRulesClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", "myCacheRule", armcontainerregistry.CacheRule{ - Properties: &armcontainerregistry.CacheRuleProperties{ - CredentialSetResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet"), - SourceRepository: to.Ptr("docker.io/library/hello-world"), - TargetRepository: to.Ptr("cached-docker-hub/hello-world"), - }, - }, nil) + res, err := clientFactory.NewCacheRulesClient().Get(ctx, "myResourceGroup", "myRegistry", "myCacheRule", 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) - } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CacheRule = armcontainerregistry.CacheRule{ - // Name: to.Ptr("myCacheRule"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/cacheRules"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/cacheRules/myCacheRule"), - // Properties: &armcontainerregistry.CacheRuleProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-07T18:20:33.837Z"); return t}()), - // CredentialSetResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet"), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // SourceRepository: to.Ptr("docker.io/library/hello-world"), - // TargetRepository: to.Ptr("cached-docker-hub/hello-world"), + // res = armcontainerregistry.CacheRulesClientGetResponse{ + // CacheRule: &armcontainerregistry.CacheRule{ + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/cacheRules"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/cacheRules/myCacheRule"), + // Name: to.Ptr("myCacheRule"), + // Properties: &armcontainerregistry.CacheRuleProperties{ + // CredentialSetResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet"), + // SourceRepository: to.Ptr("docker.io/library/hello-world"), + // TargetRepository: to.Ptr("cached-docker-hub/hello-world"), + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-07T18:20:33.8374968+00:00"); return t}()), + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/CacheRuleUpdate.json +// Generated from example definition: 2025-11-01/CacheRuleList.json +func ExampleCacheRulesClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewCacheRulesClient().NewListPager("myResourceGroup", "myRegistry", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page = armcontainerregistry.CacheRulesClientListResponse{ + // CacheRulesListResult: armcontainerregistry.CacheRulesListResult{ + // Value: []*armcontainerregistry.CacheRule{ + // { + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/cacheRules"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/cacheRules/myCacheRule"), + // Name: to.Ptr("myCacheRule"), + // Properties: &armcontainerregistry.CacheRuleProperties{ + // CredentialSetResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet"), + // SourceRepository: to.Ptr("docker.io/library/hello-world"), + // TargetRepository: to.Ptr("cached-docker-hub/hello-world"), + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-07T18:20:33.8374968+00:00"); return t}()), + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // }, + // }, + // }, + // }, + // } + } +} + +// Generated from example definition: 2025-11-01/CacheRuleUpdate.json func ExampleCacheRulesClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -155,37 +180,18 @@ func ExampleCacheRulesClient_BeginUpdate() { // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CacheRule = armcontainerregistry.CacheRule{ - // Name: to.Ptr("myCacheRule"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/cacheRules"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/cacheRules/myCacheRule"), - // Properties: &armcontainerregistry.CacheRuleProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-07T18:20:33.837Z"); return t}()), - // CredentialSetResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet2"), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // SourceRepository: to.Ptr("docker.io/library/hello-world"), - // TargetRepository: to.Ptr("cached-docker-hub/hello-world"), + // res = armcontainerregistry.CacheRulesClientUpdateResponse{ + // CacheRule: &armcontainerregistry.CacheRule{ + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/cacheRules"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/cacheRules/myCacheRule"), + // Name: to.Ptr("myCacheRule"), + // Properties: &armcontainerregistry.CacheRuleProperties{ + // CredentialSetResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet2"), + // SourceRepository: to.Ptr("docker.io/library/hello-world"), + // TargetRepository: to.Ptr("cached-docker-hub/hello-world"), + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-07T18:20:33.8374968+00:00"); return t}()), + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // }, // }, // } } - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/CacheRuleDelete.json -func ExampleCacheRulesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCacheRulesClient().BeginDelete(ctx, "myResourceGroup", "myRegistry", "myCacheRule", 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/containerregistry/armcontainerregistry/client_factory.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/client_factory.go index fe7bc25f51c4..72fe8f74cf39 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/client_factory.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/client_factory.go @@ -1,7 +1,6 @@ // 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armcontainerregistry @@ -33,14 +32,6 @@ func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, }, nil } -// NewAgentPoolsClient creates a new instance of AgentPoolsClient. -func (c *ClientFactory) NewAgentPoolsClient() *AgentPoolsClient { - return &AgentPoolsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - // NewCacheRulesClient creates a new instance of CacheRulesClient. func (c *ClientFactory) NewCacheRulesClient() *CacheRulesClient { return &CacheRulesClient{ @@ -96,14 +87,6 @@ func (c *ClientFactory) NewReplicationsClient() *ReplicationsClient { } } -// NewRunsClient creates a new instance of RunsClient. -func (c *ClientFactory) NewRunsClient() *RunsClient { - return &RunsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - // NewScopeMapsClient creates a new instance of ScopeMapsClient. func (c *ClientFactory) NewScopeMapsClient() *ScopeMapsClient { return &ScopeMapsClient{ @@ -112,22 +95,6 @@ func (c *ClientFactory) NewScopeMapsClient() *ScopeMapsClient { } } -// NewTaskRunsClient creates a new instance of TaskRunsClient. -func (c *ClientFactory) NewTaskRunsClient() *TaskRunsClient { - return &TaskRunsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewTasksClient creates a new instance of TasksClient. -func (c *ClientFactory) NewTasksClient() *TasksClient { - return &TasksClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - // NewTokensClient creates a new instance of TokensClient. func (c *ClientFactory) NewTokensClient() *TokensClient { return &TokensClient{ diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/connectedregistries_client.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/connectedregistries_client.go index 3b57ddac72ae..af792ef9fa25 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/connectedregistries_client.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/connectedregistries_client.go @@ -1,7 +1,6 @@ // 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armcontainerregistry @@ -57,8 +56,7 @@ func (client *ConnectedRegistriesClient) BeginCreate(ctx context.Context, resour return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ConnectedRegistriesClientCreateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -120,6 +118,7 @@ func (client *ConnectedRegistriesClient) createCreateRequest(ctx context.Context reqQP.Set("api-version", "2025-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, connectedRegistryCreateParameters); err != nil { return nil, err } @@ -142,8 +141,7 @@ func (client *ConnectedRegistriesClient) BeginDeactivate(ctx context.Context, re return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ConnectedRegistriesClientDeactivateResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -204,7 +202,6 @@ func (client *ConnectedRegistriesClient) deactivateCreateRequest(ctx context.Con reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2025-11-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -224,8 +221,7 @@ func (client *ConnectedRegistriesClient) BeginDelete(ctx context.Context, resour return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ConnectedRegistriesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -286,7 +282,6 @@ func (client *ConnectedRegistriesClient) deleteCreateRequest(ctx context.Context reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2025-11-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -444,8 +439,7 @@ func (client *ConnectedRegistriesClient) BeginUpdate(ctx context.Context, resour return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ConnectedRegistriesClientUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -507,6 +501,7 @@ func (client *ConnectedRegistriesClient) updateCreateRequest(ctx context.Context reqQP.Set("api-version", "2025-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, connectedRegistryUpdateParameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/connectedregistries_client_example_test.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/connectedregistries_client_example_test.go index 0a6d63097531..6bd6a86009be 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/connectedregistries_client_example_test.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/connectedregistries_client_example_test.go @@ -1,165 +1,112 @@ // 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. -// DO NOT EDIT. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armcontainerregistry_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/containerregistry/armcontainerregistry/v3" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/ConnectedRegistryList.json -func ExampleConnectedRegistriesClient_NewListPager() { +// Generated from example definition: 2025-11-01/ConnectedRegistryCreate.json +func ExampleConnectedRegistriesClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewConnectedRegistriesClient().NewListPager("myResourceGroup", "myRegistry", &armcontainerregistry.ConnectedRegistriesClientListOptions{Filter: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ConnectedRegistryListResult = armcontainerregistry.ConnectedRegistryListResult{ - // Value: []*armcontainerregistry.ConnectedRegistry{ - // { - // Name: to.Ptr("myConnectedRegistry"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/connectedRegistries"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/connectedRegistries/myConnectedRegistry"), - // Properties: &armcontainerregistry.ConnectedRegistryProperties{ - // Activation: &armcontainerregistry.ActivationProperties{ - // Status: to.Ptr(armcontainerregistry.ActivationStatusInactive), - // }, - // ClientTokenIDs: []*string{ - // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/client1Token")}, - // GarbageCollection: &armcontainerregistry.GarbageCollectionProperties{ - // Enabled: to.Ptr(true), - // Schedule: to.Ptr("0 5 * * *"), - // }, - // Logging: &armcontainerregistry.LoggingProperties{ - // AuditLogStatus: to.Ptr(armcontainerregistry.AuditLogStatusDisabled), - // LogLevel: to.Ptr(armcontainerregistry.LogLevelInformation), - // }, - // Mode: to.Ptr(armcontainerregistry.ConnectedRegistryModeReadWrite), - // NotificationsList: []*string{ - // to.Ptr("hello-world:*:*"), - // to.Ptr("sample/repo/*:1.0:*")}, - // Parent: &armcontainerregistry.ParentProperties{ - // SyncProperties: &armcontainerregistry.SyncProperties{ - // MessageTTL: to.Ptr("P2D"), - // Schedule: to.Ptr("0 9 * * *"), - // SyncWindow: to.Ptr("PT3H"), - // TokenID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/syncToken"), - // }, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/ConnectedRegistryGet.json -func ExampleConnectedRegistriesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + poller, err := clientFactory.NewConnectedRegistriesClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", "myConnectedRegistry", armcontainerregistry.ConnectedRegistry{ + Properties: &armcontainerregistry.ConnectedRegistryProperties{ + Mode: to.Ptr(armcontainerregistry.ConnectedRegistryModeReadWrite), + Parent: &armcontainerregistry.ParentProperties{ + SyncProperties: &armcontainerregistry.SyncProperties{ + TokenID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/syncToken"), + Schedule: to.Ptr("0 9 * * *"), + MessageTTL: to.Ptr("P2D"), + SyncWindow: to.Ptr("PT3H"), + }, + }, + ClientTokenIDs: []*string{ + to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/client1Token"), + }, + NotificationsList: []*string{ + to.Ptr("hello-world:*:*"), + to.Ptr("sample/repo/*:1.0:*"), + }, + GarbageCollection: &armcontainerregistry.GarbageCollectionProperties{ + Enabled: to.Ptr(true), + Schedule: to.Ptr("0 5 * * *"), + }, + }, + }, nil) if err != nil { - log.Fatalf("failed to create client: %v", err) + log.Fatalf("failed to finish the request: %v", err) } - res, err := clientFactory.NewConnectedRegistriesClient().Get(ctx, "myResourceGroup", "myRegistry", "myConnectedRegistry", nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to finish the request: %v", err) + log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ConnectedRegistry = armcontainerregistry.ConnectedRegistry{ - // Name: to.Ptr("myConnectedRegistry"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/connectedRegistries"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/connectedRegistries/myConnectedRegistry"), - // Properties: &armcontainerregistry.ConnectedRegistryProperties{ - // Activation: &armcontainerregistry.ActivationProperties{ - // Status: to.Ptr(armcontainerregistry.ActivationStatusInactive), - // }, - // ClientTokenIDs: []*string{ - // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/client1Token")}, - // GarbageCollection: &armcontainerregistry.GarbageCollectionProperties{ - // Enabled: to.Ptr(true), - // Schedule: to.Ptr("0 5 * * *"), + // res = armcontainerregistry.ConnectedRegistriesClientCreateResponse{ + // ConnectedRegistry: &armcontainerregistry.ConnectedRegistry{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/connectedRegistries/myConnectedRegistry"), + // Name: to.Ptr("myConnectedRegistry"), + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/connectedRegistries"), + // Properties: &armcontainerregistry.ConnectedRegistryProperties{ + // Mode: to.Ptr(armcontainerregistry.ConnectedRegistryModeReadWrite), + // Activation: &armcontainerregistry.ActivationProperties{ + // Status: to.Ptr(armcontainerregistry.ActivationStatusInactive), + // }, + // Parent: &armcontainerregistry.ParentProperties{ + // SyncProperties: &armcontainerregistry.SyncProperties{ + // TokenID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/syncToken"), + // Schedule: to.Ptr("0 9 * * *"), + // MessageTTL: to.Ptr("P2D"), + // SyncWindow: to.Ptr("PT3H"), + // }, + // }, + // ClientTokenIDs: []*string{ + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/client1Token"), // }, // Logging: &armcontainerregistry.LoggingProperties{ - // AuditLogStatus: to.Ptr(armcontainerregistry.AuditLogStatusDisabled), // LogLevel: to.Ptr(armcontainerregistry.LogLevelInformation), + // AuditLogStatus: to.Ptr(armcontainerregistry.AuditLogStatusDisabled), // }, - // Mode: to.Ptr(armcontainerregistry.ConnectedRegistryModeReadWrite), // NotificationsList: []*string{ // to.Ptr("hello-world:*:*"), - // to.Ptr("sample/repo/*:1.0:*")}, - // Parent: &armcontainerregistry.ParentProperties{ - // SyncProperties: &armcontainerregistry.SyncProperties{ - // MessageTTL: to.Ptr("P2D"), - // Schedule: to.Ptr("0 9 * * *"), - // SyncWindow: to.Ptr("PT3H"), - // TokenID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/syncToken"), - // }, - // }, + // to.Ptr("sample/repo/*:1.0:*"), + // }, + // GarbageCollection: &armcontainerregistry.GarbageCollectionProperties{ + // Enabled: to.Ptr(true), + // Schedule: to.Ptr("0 5 * * *"), // }, - // } + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/ConnectedRegistryCreate.json -func ExampleConnectedRegistriesClient_BeginCreate() { +// Generated from example definition: 2025-11-01/ConnectedRegistryDeactivate.json +func ExampleConnectedRegistriesClient_BeginDeactivate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewConnectedRegistriesClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", "myConnectedRegistry", armcontainerregistry.ConnectedRegistry{ - Properties: &armcontainerregistry.ConnectedRegistryProperties{ - ClientTokenIDs: []*string{ - to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/client1Token")}, - GarbageCollection: &armcontainerregistry.GarbageCollectionProperties{ - Enabled: to.Ptr(true), - Schedule: to.Ptr("0 5 * * *"), - }, - Mode: to.Ptr(armcontainerregistry.ConnectedRegistryModeReadWrite), - NotificationsList: []*string{ - to.Ptr("hello-world:*:*"), - to.Ptr("sample/repo/*:1.0:*")}, - Parent: &armcontainerregistry.ParentProperties{ - SyncProperties: &armcontainerregistry.SyncProperties{ - MessageTTL: to.Ptr("P2D"), - Schedule: to.Ptr("0 9 * * *"), - SyncWindow: to.Ptr("PT3H"), - TokenID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/syncToken"), - }, - }, - }, - }, nil) + poller, err := clientFactory.NewConnectedRegistriesClient().BeginDeactivate(ctx, "myResourceGroup", "myRegistry", "myConnectedRegistry", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -170,74 +117,22 @@ func ExampleConnectedRegistriesClient_BeginCreate() { // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ConnectedRegistry = armcontainerregistry.ConnectedRegistry{ - // Name: to.Ptr("myConnectedRegistry"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/connectedRegistries"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/connectedRegistries/myConnectedRegistry"), - // Properties: &armcontainerregistry.ConnectedRegistryProperties{ - // Activation: &armcontainerregistry.ActivationProperties{ - // Status: to.Ptr(armcontainerregistry.ActivationStatusInactive), - // }, - // ClientTokenIDs: []*string{ - // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/client1Token")}, - // GarbageCollection: &armcontainerregistry.GarbageCollectionProperties{ - // Enabled: to.Ptr(true), - // Schedule: to.Ptr("0 5 * * *"), - // }, - // Logging: &armcontainerregistry.LoggingProperties{ - // AuditLogStatus: to.Ptr(armcontainerregistry.AuditLogStatusDisabled), - // LogLevel: to.Ptr(armcontainerregistry.LogLevelInformation), - // }, - // Mode: to.Ptr(armcontainerregistry.ConnectedRegistryModeReadWrite), - // NotificationsList: []*string{ - // to.Ptr("hello-world:*:*"), - // to.Ptr("sample/repo/*:1.0:*")}, - // Parent: &armcontainerregistry.ParentProperties{ - // SyncProperties: &armcontainerregistry.SyncProperties{ - // MessageTTL: to.Ptr("P2D"), - // Schedule: to.Ptr("0 9 * * *"), - // SyncWindow: to.Ptr("PT3H"), - // TokenID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/syncToken"), - // }, - // }, - // }, - // } + // res = armcontainerregistry.ConnectedRegistriesClientDeactivateResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/ConnectedRegistryUpdate.json -func ExampleConnectedRegistriesClient_BeginUpdate() { +// Generated from example definition: 2025-11-01/ConnectedRegistryDelete.json +func ExampleConnectedRegistriesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewConnectedRegistriesClient().BeginUpdate(ctx, "myResourceGroup", "myRegistry", "myScopeMap", armcontainerregistry.ConnectedRegistryUpdateParameters{ - Properties: &armcontainerregistry.ConnectedRegistryUpdateProperties{ - ClientTokenIDs: []*string{ - to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/client1Token"), - to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/client2Token")}, - GarbageCollection: &armcontainerregistry.GarbageCollectionProperties{ - Enabled: to.Ptr(true), - Schedule: to.Ptr("0 5 * * *"), - }, - Logging: &armcontainerregistry.LoggingProperties{ - AuditLogStatus: to.Ptr(armcontainerregistry.AuditLogStatusEnabled), - LogLevel: to.Ptr(armcontainerregistry.LogLevelDebug), - }, - NotificationsList: []*string{ - to.Ptr("hello-world:*:*"), - to.Ptr("sample/repo/*:1.0:*")}, - SyncProperties: &armcontainerregistry.SyncUpdateProperties{ - MessageTTL: to.Ptr("P30D"), - Schedule: to.Ptr("0 0 */10 * *"), - SyncWindow: to.Ptr("P2D"), - }, - }, - }, nil) + poller, err := clientFactory.NewConnectedRegistriesClient().BeginDelete(ctx, "myResourceGroup", "myRegistry", "myConnectedRegistry", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -248,76 +143,209 @@ func ExampleConnectedRegistriesClient_BeginUpdate() { // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ConnectedRegistry = armcontainerregistry.ConnectedRegistry{ - // Name: to.Ptr("myConnectedRegistry"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/connectedRegistries"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/connectedRegistries/myConnectedRegistry"), - // Properties: &armcontainerregistry.ConnectedRegistryProperties{ - // ClientTokenIDs: []*string{ - // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/client1Token"), - // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/client2Token")}, - // GarbageCollection: &armcontainerregistry.GarbageCollectionProperties{ - // Enabled: to.Ptr(true), - // Schedule: to.Ptr("0 5 * * *"), + // res = armcontainerregistry.ConnectedRegistriesClientDeleteResponse{ + // } +} + +// Generated from example definition: 2025-11-01/ConnectedRegistryGet.json +func ExampleConnectedRegistriesClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewConnectedRegistriesClient().Get(ctx, "myResourceGroup", "myRegistry", "myConnectedRegistry", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armcontainerregistry.ConnectedRegistriesClientGetResponse{ + // ConnectedRegistry: &armcontainerregistry.ConnectedRegistry{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/connectedRegistries/myConnectedRegistry"), + // Name: to.Ptr("myConnectedRegistry"), + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/connectedRegistries"), + // Properties: &armcontainerregistry.ConnectedRegistryProperties{ + // Mode: to.Ptr(armcontainerregistry.ConnectedRegistryModeReadWrite), + // Activation: &armcontainerregistry.ActivationProperties{ + // Status: to.Ptr(armcontainerregistry.ActivationStatusInactive), + // }, + // Parent: &armcontainerregistry.ParentProperties{ + // SyncProperties: &armcontainerregistry.SyncProperties{ + // TokenID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/syncToken"), + // Schedule: to.Ptr("0 9 * * *"), + // MessageTTL: to.Ptr("P2D"), + // SyncWindow: to.Ptr("PT3H"), + // }, + // }, + // ClientTokenIDs: []*string{ + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/client1Token"), // }, // Logging: &armcontainerregistry.LoggingProperties{ - // AuditLogStatus: to.Ptr(armcontainerregistry.AuditLogStatusEnabled), - // LogLevel: to.Ptr(armcontainerregistry.LogLevelDebug), + // LogLevel: to.Ptr(armcontainerregistry.LogLevelInformation), + // AuditLogStatus: to.Ptr(armcontainerregistry.AuditLogStatusDisabled), // }, - // Mode: to.Ptr(armcontainerregistry.ConnectedRegistryModeReadWrite), // NotificationsList: []*string{ // to.Ptr("hello-world:*:*"), - // to.Ptr("sample/repo/*:1.0:*")}, - // Parent: &armcontainerregistry.ParentProperties{ - // SyncProperties: &armcontainerregistry.SyncProperties{ - // MessageTTL: to.Ptr("P30D"), - // Schedule: to.Ptr("0 0 */10 * *"), - // SyncWindow: to.Ptr("P2D"), - // TokenID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/syncToken"), - // }, - // }, + // to.Ptr("sample/repo/*:1.0:*"), + // }, + // GarbageCollection: &armcontainerregistry.GarbageCollectionProperties{ + // Enabled: to.Ptr(true), + // Schedule: to.Ptr("0 5 * * *"), // }, - // } + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/ConnectedRegistryDelete.json -func ExampleConnectedRegistriesClient_BeginDelete() { +// Generated from example definition: 2025-11-01/ConnectedRegistryList.json +func ExampleConnectedRegistriesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewConnectedRegistriesClient().BeginDelete(ctx, "myResourceGroup", "myRegistry", "myConnectedRegistry", 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) + pager := clientFactory.NewConnectedRegistriesClient().NewListPager("myResourceGroup", "myRegistry", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page = armcontainerregistry.ConnectedRegistriesClientListResponse{ + // ConnectedRegistryListResult: armcontainerregistry.ConnectedRegistryListResult{ + // Value: []*armcontainerregistry.ConnectedRegistry{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/connectedRegistries/myConnectedRegistry"), + // Name: to.Ptr("myConnectedRegistry"), + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/connectedRegistries"), + // Properties: &armcontainerregistry.ConnectedRegistryProperties{ + // Mode: to.Ptr(armcontainerregistry.ConnectedRegistryModeReadWrite), + // Activation: &armcontainerregistry.ActivationProperties{ + // Status: to.Ptr(armcontainerregistry.ActivationStatusInactive), + // }, + // Parent: &armcontainerregistry.ParentProperties{ + // SyncProperties: &armcontainerregistry.SyncProperties{ + // TokenID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/syncToken"), + // Schedule: to.Ptr("0 9 * * *"), + // MessageTTL: to.Ptr("P2D"), + // SyncWindow: to.Ptr("PT3H"), + // }, + // }, + // ClientTokenIDs: []*string{ + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/client1Token"), + // }, + // Logging: &armcontainerregistry.LoggingProperties{ + // LogLevel: to.Ptr(armcontainerregistry.LogLevelInformation), + // AuditLogStatus: to.Ptr(armcontainerregistry.AuditLogStatusDisabled), + // }, + // NotificationsList: []*string{ + // to.Ptr("hello-world:*:*"), + // to.Ptr("sample/repo/*:1.0:*"), + // }, + // GarbageCollection: &armcontainerregistry.GarbageCollectionProperties{ + // Enabled: to.Ptr(true), + // Schedule: to.Ptr("0 5 * * *"), + // }, + // }, + // }, + // }, + // }, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/ConnectedRegistryDeactivate.json -func ExampleConnectedRegistriesClient_BeginDeactivate() { +// Generated from example definition: 2025-11-01/ConnectedRegistryUpdate.json +func ExampleConnectedRegistriesClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewConnectedRegistriesClient().BeginDeactivate(ctx, "myResourceGroup", "myRegistry", "myConnectedRegistry", nil) + poller, err := clientFactory.NewConnectedRegistriesClient().BeginUpdate(ctx, "myResourceGroup", "myRegistry", "myScopeMap", armcontainerregistry.ConnectedRegistryUpdateParameters{ + Properties: &armcontainerregistry.ConnectedRegistryUpdateProperties{ + SyncProperties: &armcontainerregistry.SyncUpdateProperties{ + Schedule: to.Ptr("0 0 */10 * *"), + MessageTTL: to.Ptr("P30D"), + SyncWindow: to.Ptr("P2D"), + }, + Logging: &armcontainerregistry.LoggingProperties{ + LogLevel: to.Ptr(armcontainerregistry.LogLevelDebug), + AuditLogStatus: to.Ptr(armcontainerregistry.AuditLogStatusEnabled), + }, + ClientTokenIDs: []*string{ + to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/client1Token"), + to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/client2Token"), + }, + NotificationsList: []*string{ + to.Ptr("hello-world:*:*"), + to.Ptr("sample/repo/*:1.0:*"), + }, + GarbageCollection: &armcontainerregistry.GarbageCollectionProperties{ + Enabled: to.Ptr(true), + Schedule: to.Ptr("0 5 * * *"), + }, + }, + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armcontainerregistry.ConnectedRegistriesClientUpdateResponse{ + // ConnectedRegistry: &armcontainerregistry.ConnectedRegistry{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/connectedRegistries/myConnectedRegistry"), + // Name: to.Ptr("myConnectedRegistry"), + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/connectedRegistries"), + // Properties: &armcontainerregistry.ConnectedRegistryProperties{ + // Mode: to.Ptr(armcontainerregistry.ConnectedRegistryModeReadWrite), + // Parent: &armcontainerregistry.ParentProperties{ + // SyncProperties: &armcontainerregistry.SyncProperties{ + // TokenID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/syncToken"), + // Schedule: to.Ptr("0 0 */10 * *"), + // MessageTTL: to.Ptr("P30D"), + // SyncWindow: to.Ptr("P2D"), + // }, + // }, + // ClientTokenIDs: []*string{ + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/client1Token"), + // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/client2Token"), + // }, + // Logging: &armcontainerregistry.LoggingProperties{ + // LogLevel: to.Ptr(armcontainerregistry.LogLevelDebug), + // AuditLogStatus: to.Ptr(armcontainerregistry.AuditLogStatusEnabled), + // }, + // NotificationsList: []*string{ + // to.Ptr("hello-world:*:*"), + // to.Ptr("sample/repo/*:1.0:*"), + // }, + // GarbageCollection: &armcontainerregistry.GarbageCollectionProperties{ + // Enabled: to.Ptr(true), + // Schedule: to.Ptr("0 5 * * *"), + // }, + // }, + // }, + // } } diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/constants.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/constants.go index 1ae079ee0f78..ab538e79d2b1 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/constants.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/constants.go @@ -1,7 +1,6 @@ // 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armcontainerregistry @@ -51,28 +50,6 @@ func PossibleActivationStatusValues() []ActivationStatus { } } -// Architecture - The OS architecture. -type Architecture string - -const ( - ArchitectureAmd64 Architecture = "amd64" - ArchitectureArm Architecture = "arm" - ArchitectureArm64 Architecture = "arm64" - ArchitectureThreeHundredEightySix Architecture = "386" - ArchitectureX86 Architecture = "x86" -) - -// PossibleArchitectureValues returns the possible values for the Architecture const type. -func PossibleArchitectureValues() []Architecture { - return []Architecture{ - ArchitectureAmd64, - ArchitectureArm, - ArchitectureArm64, - ArchitectureThreeHundredEightySix, - ArchitectureX86, - } -} - // AuditLogStatus - Indicates whether audit logs are enabled on the connected registry. type AuditLogStatus string @@ -89,29 +66,6 @@ func PossibleAuditLogStatusValues() []AuditLogStatus { } } -// AutoGeneratedDomainNameLabelScope - The auto generated domain name label of the container registry. This value defaults -// to "Unsecure". -type AutoGeneratedDomainNameLabelScope string - -const ( - AutoGeneratedDomainNameLabelScopeNoReuse AutoGeneratedDomainNameLabelScope = "NoReuse" - AutoGeneratedDomainNameLabelScopeResourceGroupReuse AutoGeneratedDomainNameLabelScope = "ResourceGroupReuse" - AutoGeneratedDomainNameLabelScopeSubscriptionReuse AutoGeneratedDomainNameLabelScope = "SubscriptionReuse" - AutoGeneratedDomainNameLabelScopeTenantReuse AutoGeneratedDomainNameLabelScope = "TenantReuse" - AutoGeneratedDomainNameLabelScopeUnsecure AutoGeneratedDomainNameLabelScope = "Unsecure" -) - -// PossibleAutoGeneratedDomainNameLabelScopeValues returns the possible values for the AutoGeneratedDomainNameLabelScope const type. -func PossibleAutoGeneratedDomainNameLabelScopeValues() []AutoGeneratedDomainNameLabelScope { - return []AutoGeneratedDomainNameLabelScope{ - AutoGeneratedDomainNameLabelScopeNoReuse, - AutoGeneratedDomainNameLabelScopeResourceGroupReuse, - AutoGeneratedDomainNameLabelScopeSubscriptionReuse, - AutoGeneratedDomainNameLabelScopeTenantReuse, - AutoGeneratedDomainNameLabelScopeUnsecure, - } -} - // AzureADAuthenticationAsArmPolicyStatus - The value that indicates whether the policy is enabled or not. type AzureADAuthenticationAsArmPolicyStatus string @@ -128,38 +82,6 @@ func PossibleAzureADAuthenticationAsArmPolicyStatusValues() []AzureADAuthenticat } } -// BaseImageDependencyType - The type of the base image dependency. -type BaseImageDependencyType string - -const ( - BaseImageDependencyTypeBuildTime BaseImageDependencyType = "BuildTime" - BaseImageDependencyTypeRunTime BaseImageDependencyType = "RunTime" -) - -// PossibleBaseImageDependencyTypeValues returns the possible values for the BaseImageDependencyType const type. -func PossibleBaseImageDependencyTypeValues() []BaseImageDependencyType { - return []BaseImageDependencyType{ - BaseImageDependencyTypeBuildTime, - BaseImageDependencyTypeRunTime, - } -} - -// BaseImageTriggerType - The type of the auto trigger for base image dependency updates. -type BaseImageTriggerType string - -const ( - BaseImageTriggerTypeAll BaseImageTriggerType = "All" - BaseImageTriggerTypeRuntime BaseImageTriggerType = "Runtime" -) - -// PossibleBaseImageTriggerTypeValues returns the possible values for the BaseImageTriggerType const type. -func PossibleBaseImageTriggerTypeValues() []BaseImageTriggerType { - return []BaseImageTriggerType{ - BaseImageTriggerTypeAll, - BaseImageTriggerTypeRuntime, - } -} - // CertificateType - The type of certificate location. type CertificateType string @@ -234,14 +156,18 @@ func PossibleConnectionStatusValues() []ConnectionStatus { } } -// CreatedByType - The type of identity that created the resource. +// CreatedByType - The kind of entity that created the resource. type CreatedByType string const ( - CreatedByTypeApplication CreatedByType = "Application" - CreatedByTypeKey CreatedByType = "Key" + // CreatedByTypeApplication - The entity was created by an application. + CreatedByTypeApplication CreatedByType = "Application" + // CreatedByTypeKey - The entity was created by a key. + CreatedByTypeKey CreatedByType = "Key" + // CreatedByTypeManagedIdentity - The entity was created by a managed identity. CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" - CreatedByTypeUser CreatedByType = "User" + // CreatedByTypeUser - The entity was created by a user. + CreatedByTypeUser CreatedByType = "User" ) // PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type. @@ -387,22 +313,6 @@ func PossibleNetworkRuleBypassOptionsValues() []NetworkRuleBypassOptions { } } -// OS - The OS of agent machine -type OS string - -const ( - OSLinux OS = "Linux" - OSWindows OS = "Windows" -) - -// PossibleOSValues returns the possible values for the OS const type. -func PossibleOSValues() []OS { - return []OS{ - OSLinux, - OSWindows, - } -} - // PasswordName - The password name. type PasswordName string @@ -435,7 +345,7 @@ func PossiblePolicyStatusValues() []PolicyStatus { } } -// ProvisioningState - The provisioning state of this agent pool +// ProvisioningState - The provisioning state of the archive at the time the operation was called. type ProvisioningState string const ( @@ -527,54 +437,6 @@ func PossibleRoleAssignmentModeValues() []RoleAssignmentMode { } } -// RunStatus - The current status of the run. -type RunStatus string - -const ( - RunStatusCanceled RunStatus = "Canceled" - RunStatusError RunStatus = "Error" - RunStatusFailed RunStatus = "Failed" - RunStatusQueued RunStatus = "Queued" - RunStatusRunning RunStatus = "Running" - RunStatusStarted RunStatus = "Started" - RunStatusSucceeded RunStatus = "Succeeded" - RunStatusTimeout RunStatus = "Timeout" -) - -// PossibleRunStatusValues returns the possible values for the RunStatus const type. -func PossibleRunStatusValues() []RunStatus { - return []RunStatus{ - RunStatusCanceled, - RunStatusError, - RunStatusFailed, - RunStatusQueued, - RunStatusRunning, - RunStatusStarted, - RunStatusSucceeded, - RunStatusTimeout, - } -} - -// RunType - The type of run. -type RunType string - -const ( - RunTypeAutoBuild RunType = "AutoBuild" - RunTypeAutoRun RunType = "AutoRun" - RunTypeQuickBuild RunType = "QuickBuild" - RunTypeQuickRun RunType = "QuickRun" -) - -// PossibleRunTypeValues returns the possible values for the RunType const type. -func PossibleRunTypeValues() []RunType { - return []RunType{ - RunTypeAutoBuild, - RunTypeAutoRun, - RunTypeQuickBuild, - RunTypeQuickRun, - } -} - // SKUName - The SKU name of the container registry. Required for registry creation. type SKUName string @@ -615,89 +477,6 @@ func PossibleSKUTierValues() []SKUTier { } } -// SecretObjectType - The type of the secret object which determines how the value of the secret object has to be interpreted. -type SecretObjectType string - -const ( - SecretObjectTypeOpaque SecretObjectType = "Opaque" - SecretObjectTypeVaultsecret SecretObjectType = "Vaultsecret" -) - -// PossibleSecretObjectTypeValues returns the possible values for the SecretObjectType const type. -func PossibleSecretObjectTypeValues() []SecretObjectType { - return []SecretObjectType{ - SecretObjectTypeOpaque, - SecretObjectTypeVaultsecret, - } -} - -// SourceControlType - The type of source control service. -type SourceControlType string - -const ( - SourceControlTypeGithub SourceControlType = "Github" - SourceControlTypeVisualStudioTeamService SourceControlType = "VisualStudioTeamService" -) - -// PossibleSourceControlTypeValues returns the possible values for the SourceControlType const type. -func PossibleSourceControlTypeValues() []SourceControlType { - return []SourceControlType{ - SourceControlTypeGithub, - SourceControlTypeVisualStudioTeamService, - } -} - -// SourceRegistryLoginMode - The authentication mode which determines the source registry login scope. The credentials for -// the source registry will be generated using the given scope. These credentials will be used to login to -// the source registry during the run. -type SourceRegistryLoginMode string - -const ( - SourceRegistryLoginModeDefault SourceRegistryLoginMode = "Default" - SourceRegistryLoginModeNone SourceRegistryLoginMode = "None" -) - -// PossibleSourceRegistryLoginModeValues returns the possible values for the SourceRegistryLoginMode const type. -func PossibleSourceRegistryLoginModeValues() []SourceRegistryLoginMode { - return []SourceRegistryLoginMode{ - SourceRegistryLoginModeDefault, - SourceRegistryLoginModeNone, - } -} - -type SourceTriggerEvent string - -const ( - SourceTriggerEventCommit SourceTriggerEvent = "commit" - SourceTriggerEventPullrequest SourceTriggerEvent = "pullrequest" -) - -// PossibleSourceTriggerEventValues returns the possible values for the SourceTriggerEvent const type. -func PossibleSourceTriggerEventValues() []SourceTriggerEvent { - return []SourceTriggerEvent{ - SourceTriggerEventCommit, - SourceTriggerEventPullrequest, - } -} - -// StepType - The type of the step. -type StepType string - -const ( - StepTypeDocker StepType = "Docker" - StepTypeEncodedTask StepType = "EncodedTask" - StepTypeFileTask StepType = "FileTask" -) - -// PossibleStepTypeValues returns the possible values for the StepType const type. -func PossibleStepTypeValues() []StepType { - return []StepType{ - StepTypeDocker, - StepTypeEncodedTask, - StepTypeFileTask, - } -} - // TLSStatus - Indicates whether HTTPS is enabled for the login server. type TLSStatus string @@ -714,22 +493,6 @@ func PossibleTLSStatusValues() []TLSStatus { } } -// TaskStatus - The current status of task. -type TaskStatus string - -const ( - TaskStatusDisabled TaskStatus = "Disabled" - TaskStatusEnabled TaskStatus = "Enabled" -) - -// PossibleTaskStatusValues returns the possible values for the TaskStatus const type. -func PossibleTaskStatusValues() []TaskStatus { - return []TaskStatus{ - TaskStatusDisabled, - TaskStatusEnabled, - } -} - type TokenCertificateName string const ( @@ -777,38 +540,6 @@ func PossibleTokenStatusValues() []TokenStatus { } } -// TokenType - The type of Auth token. -type TokenType string - -const ( - TokenTypeOAuth TokenType = "OAuth" - TokenTypePAT TokenType = "PAT" -) - -// PossibleTokenTypeValues returns the possible values for the TokenType const type. -func PossibleTokenTypeValues() []TokenType { - return []TokenType{ - TokenTypeOAuth, - TokenTypePAT, - } -} - -// TriggerStatus - The current status of trigger. -type TriggerStatus string - -const ( - TriggerStatusDisabled TriggerStatus = "Disabled" - TriggerStatusEnabled TriggerStatus = "Enabled" -) - -// PossibleTriggerStatusValues returns the possible values for the TriggerStatus const type. -func PossibleTriggerStatusValues() []TriggerStatus { - return []TriggerStatus{ - TriggerStatusDisabled, - TriggerStatusEnabled, - } -} - // TrustPolicyType - The type of trust policy. type TrustPolicyType string @@ -823,40 +554,6 @@ func PossibleTrustPolicyTypeValues() []TrustPolicyType { } } -// UpdateTriggerPayloadType - Type of Payload body for Base image update triggers. -type UpdateTriggerPayloadType string - -const ( - UpdateTriggerPayloadTypeDefault UpdateTriggerPayloadType = "Default" - UpdateTriggerPayloadTypeToken UpdateTriggerPayloadType = "Token" -) - -// PossibleUpdateTriggerPayloadTypeValues returns the possible values for the UpdateTriggerPayloadType const type. -func PossibleUpdateTriggerPayloadTypeValues() []UpdateTriggerPayloadType { - return []UpdateTriggerPayloadType{ - UpdateTriggerPayloadTypeDefault, - UpdateTriggerPayloadTypeToken, - } -} - -// Variant - Variant of the CPU. -type Variant string - -const ( - VariantV6 Variant = "v6" - VariantV7 Variant = "v7" - VariantV8 Variant = "v8" -) - -// PossibleVariantValues returns the possible values for the Variant const type. -func PossibleVariantValues() []Variant { - return []Variant{ - VariantV6, - VariantV7, - VariantV8, - } -} - type WebhookAction string const ( diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/credentialsets_client.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/credentialsets_client.go index 74e9db01836d..eda32a92e145 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/credentialsets_client.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/credentialsets_client.go @@ -1,7 +1,6 @@ // 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armcontainerregistry @@ -57,8 +56,7 @@ func (client *CredentialSetsClient) BeginCreate(ctx context.Context, resourceGro return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CredentialSetsClientCreateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -120,6 +118,7 @@ func (client *CredentialSetsClient) createCreateRequest(ctx context.Context, res reqQP.Set("api-version", "2025-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, credentialSetCreateParameters); err != nil { return nil, err } @@ -142,8 +141,7 @@ func (client *CredentialSetsClient) BeginDelete(ctx context.Context, resourceGro return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CredentialSetsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -204,7 +202,6 @@ func (client *CredentialSetsClient) deleteCreateRequest(ctx context.Context, res reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2025-11-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -358,8 +355,7 @@ func (client *CredentialSetsClient) BeginUpdate(ctx context.Context, resourceGro return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CredentialSetsClientUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -421,6 +417,7 @@ func (client *CredentialSetsClient) updateCreateRequest(ctx context.Context, res reqQP.Set("api-version", "2025-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, credentialSetUpdateParameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/credentialsets_client_example_test.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/credentialsets_client_example_test.go index fb3d88ed1a40..d0ce84c6592f 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/credentialsets_client_example_test.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/credentialsets_client_example_test.go @@ -1,185 +1,214 @@ // 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. -// DO NOT EDIT. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armcontainerregistry_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/containerregistry/armcontainerregistry/v3" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/CredentialSetList.json -func ExampleCredentialSetsClient_NewListPager() { +// Generated from example definition: 2025-11-01/CredentialSetCreate.json +func ExampleCredentialSetsClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewCredentialSetsClient().NewListPager("myResourceGroup", "myRegistry", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CredentialSetListResult = armcontainerregistry.CredentialSetListResult{ - // Value: []*armcontainerregistry.CredentialSet{ - // { - // Name: to.Ptr("myCredentialSet"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/credentialSets"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet"), - // Identity: &armcontainerregistry.IdentityProperties{ - // Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // Properties: &armcontainerregistry.CredentialSetProperties{ - // AuthCredentials: []*armcontainerregistry.AuthCredential{ - // { - // Name: to.Ptr(armcontainerregistry.CredentialNameCredential1), - // CredentialHealth: &armcontainerregistry.CredentialHealth{ - // Status: to.Ptr(armcontainerregistry.CredentialHealthStatusHealthy), - // }, - // PasswordSecretIdentifier: to.Ptr("https://myvault.vault.azure.net/secrets/password"), - // UsernameSecretIdentifier: to.Ptr("https://myvault.vault.azure.net/secrets/username"), - // }}, - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-07T18:20:08.012Z"); return t}()), - // LoginServer: to.Ptr("docker.io"), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // }, - // }}, - // } + poller, err := clientFactory.NewCredentialSetsClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", "myCredentialSet", armcontainerregistry.CredentialSet{ + Properties: &armcontainerregistry.CredentialSetProperties{ + LoginServer: to.Ptr("docker.io"), + AuthCredentials: []*armcontainerregistry.AuthCredential{ + { + Name: to.Ptr(armcontainerregistry.CredentialNameCredential1), + UsernameSecretIdentifier: to.Ptr("https://myvault.vault.azure.net/secrets/username"), + PasswordSecretIdentifier: to.Ptr("https://myvault.vault.azure.net/secrets/password"), + }, + }, + }, + Identity: &armcontainerregistry.IdentityProperties{ + Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssigned), + }, + }, 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) } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armcontainerregistry.CredentialSetsClientCreateResponse{ + // CredentialSet: &armcontainerregistry.CredentialSet{ + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/credentialSets"), + // Identity: &armcontainerregistry.IdentityProperties{ + // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssigned), + // }, + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet"), + // Name: to.Ptr("myCredentialSet"), + // Properties: &armcontainerregistry.CredentialSetProperties{ + // LoginServer: to.Ptr("docker.io"), + // AuthCredentials: []*armcontainerregistry.AuthCredential{ + // { + // Name: to.Ptr(armcontainerregistry.CredentialNameCredential1), + // UsernameSecretIdentifier: to.Ptr("https://myvault.vault.azure.net/secrets/username"), + // PasswordSecretIdentifier: to.Ptr("https://myvault.vault.azure.net/secrets/password"), + // CredentialHealth: &armcontainerregistry.CredentialHealth{ + // Status: to.Ptr(armcontainerregistry.CredentialHealthStatusHealthy), + // }, + // }, + // }, + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-07T18:20:08.012276+00:00"); return t}()), + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/CredentialSetGet.json -func ExampleCredentialSetsClient_Get() { +// Generated from example definition: 2025-11-01/CredentialSetDelete.json +func ExampleCredentialSetsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewCredentialSetsClient().Get(ctx, "myResourceGroup", "myRegistry", "myCredentialSet", nil) + poller, err := clientFactory.NewCredentialSetsClient().BeginDelete(ctx, "myResourceGroup", "myRegistry", "myCredentialSet", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CredentialSet = armcontainerregistry.CredentialSet{ - // Name: to.Ptr("myCredentialSet"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/credentialSets"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet"), - // Identity: &armcontainerregistry.IdentityProperties{ - // Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // Properties: &armcontainerregistry.CredentialSetProperties{ - // AuthCredentials: []*armcontainerregistry.AuthCredential{ - // { - // Name: to.Ptr(armcontainerregistry.CredentialNameCredential1), - // CredentialHealth: &armcontainerregistry.CredentialHealth{ - // Status: to.Ptr(armcontainerregistry.CredentialHealthStatusHealthy), - // }, - // PasswordSecretIdentifier: to.Ptr("https://myvault.vault.azure.net/secrets/password"), - // UsernameSecretIdentifier: to.Ptr("https://myvault.vault.azure.net/secrets/username"), - // }}, - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-07T18:20:08.012Z"); return t}()), - // LoginServer: to.Ptr("docker.io"), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // }, - // } + _, 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/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/CredentialSetCreate.json -func ExampleCredentialSetsClient_BeginCreate() { +// Generated from example definition: 2025-11-01/CredentialSetGet.json +func ExampleCredentialSetsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewCredentialSetsClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", "myCredentialSet", armcontainerregistry.CredentialSet{ - Identity: &armcontainerregistry.IdentityProperties{ - Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssigned), - }, - Properties: &armcontainerregistry.CredentialSetProperties{ - AuthCredentials: []*armcontainerregistry.AuthCredential{ - { - Name: to.Ptr(armcontainerregistry.CredentialNameCredential1), - PasswordSecretIdentifier: to.Ptr("https://myvault.vault.azure.net/secrets/password"), - UsernameSecretIdentifier: to.Ptr("https://myvault.vault.azure.net/secrets/username"), - }}, - LoginServer: to.Ptr("docker.io"), - }, - }, nil) + res, err := clientFactory.NewCredentialSetsClient().Get(ctx, "myResourceGroup", "myRegistry", "myCredentialSet", 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) - } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CredentialSet = armcontainerregistry.CredentialSet{ - // Name: to.Ptr("myCredentialSet"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/credentialSets"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet"), - // Identity: &armcontainerregistry.IdentityProperties{ - // Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // Properties: &armcontainerregistry.CredentialSetProperties{ - // AuthCredentials: []*armcontainerregistry.AuthCredential{ - // { - // Name: to.Ptr(armcontainerregistry.CredentialNameCredential1), - // CredentialHealth: &armcontainerregistry.CredentialHealth{ - // Status: to.Ptr(armcontainerregistry.CredentialHealthStatusHealthy), + // res = armcontainerregistry.CredentialSetsClientGetResponse{ + // CredentialSet: &armcontainerregistry.CredentialSet{ + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/credentialSets"), + // Identity: &armcontainerregistry.IdentityProperties{ + // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssigned), + // }, + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet"), + // Name: to.Ptr("myCredentialSet"), + // Properties: &armcontainerregistry.CredentialSetProperties{ + // LoginServer: to.Ptr("docker.io"), + // AuthCredentials: []*armcontainerregistry.AuthCredential{ + // { + // Name: to.Ptr(armcontainerregistry.CredentialNameCredential1), + // UsernameSecretIdentifier: to.Ptr("https://myvault.vault.azure.net/secrets/username"), + // PasswordSecretIdentifier: to.Ptr("https://myvault.vault.azure.net/secrets/password"), + // CredentialHealth: &armcontainerregistry.CredentialHealth{ + // Status: to.Ptr(armcontainerregistry.CredentialHealthStatusHealthy), + // }, // }, - // PasswordSecretIdentifier: to.Ptr("https://myvault.vault.azure.net/secrets/password"), - // UsernameSecretIdentifier: to.Ptr("https://myvault.vault.azure.net/secrets/username"), - // }}, - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-07T18:20:08.012Z"); return t}()), - // LoginServer: to.Ptr("docker.io"), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // }, + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-07T18:20:08.012276+00:00"); return t}()), + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/CredentialSetUpdate.json +// Generated from example definition: 2025-11-01/CredentialSetList.json +func ExampleCredentialSetsClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewCredentialSetsClient().NewListPager("myResourceGroup", "myRegistry", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page = armcontainerregistry.CredentialSetsClientListResponse{ + // CredentialSetListResult: armcontainerregistry.CredentialSetListResult{ + // Value: []*armcontainerregistry.CredentialSet{ + // { + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/credentialSets"), + // Identity: &armcontainerregistry.IdentityProperties{ + // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssigned), + // }, + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet"), + // Name: to.Ptr("myCredentialSet"), + // Properties: &armcontainerregistry.CredentialSetProperties{ + // LoginServer: to.Ptr("docker.io"), + // AuthCredentials: []*armcontainerregistry.AuthCredential{ + // { + // Name: to.Ptr(armcontainerregistry.CredentialNameCredential1), + // UsernameSecretIdentifier: to.Ptr("https://myvault.vault.azure.net/secrets/username"), + // PasswordSecretIdentifier: to.Ptr("https://myvault.vault.azure.net/secrets/password"), + // CredentialHealth: &armcontainerregistry.CredentialHealth{ + // Status: to.Ptr(armcontainerregistry.CredentialHealthStatusHealthy), + // }, + // }, + // }, + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-07T18:20:08.012276+00:00"); return t}()), + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // }, + // }, + // }, + // }, + // } + } +} + +// Generated from example definition: 2025-11-01/CredentialSetUpdate.json func ExampleCredentialSetsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -188,9 +217,10 @@ func ExampleCredentialSetsClient_BeginUpdate() { AuthCredentials: []*armcontainerregistry.AuthCredential{ { Name: to.Ptr(armcontainerregistry.CredentialNameCredential1), - PasswordSecretIdentifier: to.Ptr("https://myvault.vault.azure.net/secrets/password2"), UsernameSecretIdentifier: to.Ptr("https://myvault.vault.azure.net/secrets/username2"), - }}, + PasswordSecretIdentifier: to.Ptr("https://myvault.vault.azure.net/secrets/password2"), + }, + }, }, }, nil) if err != nil { @@ -203,49 +233,31 @@ func ExampleCredentialSetsClient_BeginUpdate() { // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CredentialSet = armcontainerregistry.CredentialSet{ - // Name: to.Ptr("myCredentialSet"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/credentialSets"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet"), - // Identity: &armcontainerregistry.IdentityProperties{ - // Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // Properties: &armcontainerregistry.CredentialSetProperties{ - // AuthCredentials: []*armcontainerregistry.AuthCredential{ - // { - // Name: to.Ptr(armcontainerregistry.CredentialNameCredential1), - // CredentialHealth: &armcontainerregistry.CredentialHealth{ - // Status: to.Ptr(armcontainerregistry.CredentialHealthStatusHealthy), + // res = armcontainerregistry.CredentialSetsClientUpdateResponse{ + // CredentialSet: &armcontainerregistry.CredentialSet{ + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/credentialSets"), + // Identity: &armcontainerregistry.IdentityProperties{ + // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssigned), + // }, + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet"), + // Name: to.Ptr("myCredentialSet"), + // Properties: &armcontainerregistry.CredentialSetProperties{ + // LoginServer: to.Ptr("docker.io"), + // AuthCredentials: []*armcontainerregistry.AuthCredential{ + // { + // Name: to.Ptr(armcontainerregistry.CredentialNameCredential1), + // UsernameSecretIdentifier: to.Ptr("https://myvault.vault.azure.net/secrets/username2"), + // PasswordSecretIdentifier: to.Ptr("https://myvault.vault.azure.net/secrets/password2"), + // CredentialHealth: &armcontainerregistry.CredentialHealth{ + // Status: to.Ptr(armcontainerregistry.CredentialHealthStatusHealthy), + // }, // }, - // PasswordSecretIdentifier: to.Ptr("https://myvault.vault.azure.net/secrets/password2"), - // UsernameSecretIdentifier: to.Ptr("https://myvault.vault.azure.net/secrets/username2"), - // }}, - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-07T18:20:08.012Z"); return t}()), - // LoginServer: to.Ptr("docker.io"), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // }, + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-07T18:20:08.012276+00:00"); return t}()), + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // }, // }, // } } - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/CredentialSetDelete.json -func ExampleCredentialSetsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCredentialSetsClient().BeginDelete(ctx, "myResourceGroup", "myRegistry", "myCredentialSet", 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/containerregistry/armcontainerregistry/fake/agentpools_server.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/agentpools_server.go deleted file mode 100644 index 8c42a2480eac..000000000000 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/agentpools_server.go +++ /dev/null @@ -1,397 +0,0 @@ -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry/v3" - "net/http" - "net/url" - "regexp" -) - -// AgentPoolsServer is a fake server for instances of the armcontainerregistry.AgentPoolsClient type. -type AgentPoolsServer struct { - // BeginCreate is the fake for method AgentPoolsClient.BeginCreate - // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated - BeginCreate func(ctx context.Context, resourceGroupName string, registryName string, agentPoolName string, agentPool armcontainerregistry.AgentPool, options *armcontainerregistry.AgentPoolsClientBeginCreateOptions) (resp azfake.PollerResponder[armcontainerregistry.AgentPoolsClientCreateResponse], errResp azfake.ErrorResponder) - - // BeginDelete is the fake for method AgentPoolsClient.BeginDelete - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent - BeginDelete func(ctx context.Context, resourceGroupName string, registryName string, agentPoolName string, options *armcontainerregistry.AgentPoolsClientBeginDeleteOptions) (resp azfake.PollerResponder[armcontainerregistry.AgentPoolsClientDeleteResponse], errResp azfake.ErrorResponder) - - // Get is the fake for method AgentPoolsClient.Get - // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, registryName string, agentPoolName string, options *armcontainerregistry.AgentPoolsClientGetOptions) (resp azfake.Responder[armcontainerregistry.AgentPoolsClientGetResponse], errResp azfake.ErrorResponder) - - // GetQueueStatus is the fake for method AgentPoolsClient.GetQueueStatus - // HTTP status codes to indicate success: http.StatusOK - GetQueueStatus func(ctx context.Context, resourceGroupName string, registryName string, agentPoolName string, options *armcontainerregistry.AgentPoolsClientGetQueueStatusOptions) (resp azfake.Responder[armcontainerregistry.AgentPoolsClientGetQueueStatusResponse], errResp azfake.ErrorResponder) - - // NewListPager is the fake for method AgentPoolsClient.NewListPager - // HTTP status codes to indicate success: http.StatusOK - NewListPager func(resourceGroupName string, registryName string, options *armcontainerregistry.AgentPoolsClientListOptions) (resp azfake.PagerResponder[armcontainerregistry.AgentPoolsClientListResponse]) - - // BeginUpdate is the fake for method AgentPoolsClient.BeginUpdate - // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated - BeginUpdate func(ctx context.Context, resourceGroupName string, registryName string, agentPoolName string, updateParameters armcontainerregistry.AgentPoolUpdateParameters, options *armcontainerregistry.AgentPoolsClientBeginUpdateOptions) (resp azfake.PollerResponder[armcontainerregistry.AgentPoolsClientUpdateResponse], errResp azfake.ErrorResponder) -} - -// NewAgentPoolsServerTransport creates a new instance of AgentPoolsServerTransport with the provided implementation. -// The returned AgentPoolsServerTransport instance is connected to an instance of armcontainerregistry.AgentPoolsClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewAgentPoolsServerTransport(srv *AgentPoolsServer) *AgentPoolsServerTransport { - return &AgentPoolsServerTransport{ - srv: srv, - beginCreate: newTracker[azfake.PollerResponder[armcontainerregistry.AgentPoolsClientCreateResponse]](), - beginDelete: newTracker[azfake.PollerResponder[armcontainerregistry.AgentPoolsClientDeleteResponse]](), - newListPager: newTracker[azfake.PagerResponder[armcontainerregistry.AgentPoolsClientListResponse]](), - beginUpdate: newTracker[azfake.PollerResponder[armcontainerregistry.AgentPoolsClientUpdateResponse]](), - } -} - -// AgentPoolsServerTransport connects instances of armcontainerregistry.AgentPoolsClient to instances of AgentPoolsServer. -// Don't use this type directly, use NewAgentPoolsServerTransport instead. -type AgentPoolsServerTransport struct { - srv *AgentPoolsServer - beginCreate *tracker[azfake.PollerResponder[armcontainerregistry.AgentPoolsClientCreateResponse]] - beginDelete *tracker[azfake.PollerResponder[armcontainerregistry.AgentPoolsClientDeleteResponse]] - newListPager *tracker[azfake.PagerResponder[armcontainerregistry.AgentPoolsClientListResponse]] - beginUpdate *tracker[azfake.PollerResponder[armcontainerregistry.AgentPoolsClientUpdateResponse]] -} - -// Do implements the policy.Transporter interface for AgentPoolsServerTransport. -func (a *AgentPoolsServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - return a.dispatchToMethodFake(req, method) -} - -func (a *AgentPoolsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - - go func() { - var intercepted bool - var res result - if agentPoolsServerTransportInterceptor != nil { - res.resp, res.err, intercepted = agentPoolsServerTransportInterceptor.Do(req) - } - if !intercepted { - switch method { - case "AgentPoolsClient.BeginCreate": - res.resp, res.err = a.dispatchBeginCreate(req) - case "AgentPoolsClient.BeginDelete": - res.resp, res.err = a.dispatchBeginDelete(req) - case "AgentPoolsClient.Get": - res.resp, res.err = a.dispatchGet(req) - case "AgentPoolsClient.GetQueueStatus": - res.resp, res.err = a.dispatchGetQueueStatus(req) - case "AgentPoolsClient.NewListPager": - res.resp, res.err = a.dispatchNewListPager(req) - case "AgentPoolsClient.BeginUpdate": - res.resp, res.err = a.dispatchBeginUpdate(req) - default: - res.err = fmt.Errorf("unhandled API %s", method) - } - - } - select { - case resultChan <- res: - case <-req.Context().Done(): - } - }() - - select { - case <-req.Context().Done(): - return nil, req.Context().Err() - case res := <-resultChan: - return res.resp, res.err - } -} - -func (a *AgentPoolsServerTransport) dispatchBeginCreate(req *http.Request) (*http.Response, error) { - if a.srv.BeginCreate == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginCreate not implemented")} - } - beginCreate := a.beginCreate.get(req) - if beginCreate == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerRegistry/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/agentPools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if len(matches) < 5 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armcontainerregistry.AgentPool](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) - if err != nil { - return nil, err - } - agentPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("agentPoolName")]) - if err != nil { - return nil, err - } - respr, errRespr := a.srv.BeginCreate(req.Context(), resourceGroupNameParam, registryNameParam, agentPoolNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginCreate = &respr - a.beginCreate.add(req, beginCreate) - } - - resp, err := server.PollerResponderNext(beginCreate, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { - a.beginCreate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} - } - if !server.PollerResponderMore(beginCreate) { - a.beginCreate.remove(req) - } - - return resp, nil -} - -func (a *AgentPoolsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { - if a.srv.BeginDelete == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} - } - beginDelete := a.beginDelete.get(req) - if beginDelete == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerRegistry/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/agentPools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if len(matches) < 5 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) - if err != nil { - return nil, err - } - agentPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("agentPoolName")]) - if err != nil { - return nil, err - } - respr, errRespr := a.srv.BeginDelete(req.Context(), resourceGroupNameParam, registryNameParam, agentPoolNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginDelete = &respr - a.beginDelete.add(req, beginDelete) - } - - resp, err := server.PollerResponderNext(beginDelete, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { - a.beginDelete.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} - } - if !server.PollerResponderMore(beginDelete) { - a.beginDelete.remove(req) - } - - return resp, nil -} - -func (a *AgentPoolsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { - if a.srv.Get == nil { - return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerRegistry/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/agentPools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if len(matches) < 5 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) - if err != nil { - return nil, err - } - agentPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("agentPoolName")]) - if err != nil { - return nil, err - } - respr, errRespr := a.srv.Get(req.Context(), resourceGroupNameParam, registryNameParam, agentPoolNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).AgentPool, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (a *AgentPoolsServerTransport) dispatchGetQueueStatus(req *http.Request) (*http.Response, error) { - if a.srv.GetQueueStatus == nil { - return nil, &nonRetriableError{errors.New("fake for method GetQueueStatus not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerRegistry/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/agentPools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/listQueueStatus` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if len(matches) < 5 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) - if err != nil { - return nil, err - } - agentPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("agentPoolName")]) - if err != nil { - return nil, err - } - respr, errRespr := a.srv.GetQueueStatus(req.Context(), resourceGroupNameParam, registryNameParam, agentPoolNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).AgentPoolQueueStatus, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (a *AgentPoolsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { - if a.srv.NewListPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} - } - newListPager := a.newListPager.get(req) - if newListPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerRegistry/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/agentPools` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) - if err != nil { - return nil, err - } - resp := a.srv.NewListPager(resourceGroupNameParam, registryNameParam, nil) - newListPager = &resp - a.newListPager.add(req, newListPager) - server.PagerResponderInjectNextLinks(newListPager, req, func(page *armcontainerregistry.AgentPoolsClientListResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newListPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - a.newListPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListPager) { - a.newListPager.remove(req) - } - return resp, nil -} - -func (a *AgentPoolsServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) { - if a.srv.BeginUpdate == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} - } - beginUpdate := a.beginUpdate.get(req) - if beginUpdate == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerRegistry/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/agentPools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if len(matches) < 5 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armcontainerregistry.AgentPoolUpdateParameters](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) - if err != nil { - return nil, err - } - agentPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("agentPoolName")]) - if err != nil { - return nil, err - } - respr, errRespr := a.srv.BeginUpdate(req.Context(), resourceGroupNameParam, registryNameParam, agentPoolNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginUpdate = &respr - a.beginUpdate.add(req, beginUpdate) - } - - resp, err := server.PollerResponderNext(beginUpdate, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { - a.beginUpdate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} - } - if !server.PollerResponderMore(beginUpdate) { - a.beginUpdate.remove(req) - } - - return resp, nil -} - -// set this to conditionally intercept incoming requests to AgentPoolsServerTransport -var agentPoolsServerTransportInterceptor interface { - // Do returns true if the server transport should use the returned response/error - Do(*http.Request) (*http.Response, error, bool) -} diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/cacherules_server.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/cacherules_server.go index eae6c1ea222e..570a0f66cd54 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/cacherules_server.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/cacherules_server.go @@ -1,7 +1,6 @@ // 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/connectedregistries_server.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/connectedregistries_server.go index 1950fd6bccff..7d4a9defb8ae 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/connectedregistries_server.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/connectedregistries_server.go @@ -1,7 +1,6 @@ // 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/credentialsets_server.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/credentialsets_server.go index 72bb40b16ea4..0bc5860f41b8 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/credentialsets_server.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/credentialsets_server.go @@ -1,7 +1,6 @@ // 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/internal.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/internal.go index 8c769d402536..d768e4760998 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/internal.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/internal.go @@ -1,13 +1,11 @@ // 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "io" "net/http" "reflect" "sync" @@ -42,29 +40,6 @@ func getOptional[T any](v T) *T { return &v } -func parseOptional[T any](v string, parse func(v string) (T, error)) (*T, error) { - if v == "" { - return nil, nil - } - t, err := parse(v) - if err != nil { - return nil, err - } - return &t, err -} - -func readRequestBody(req *http.Request) ([]byte, error) { - if req.Body == nil { - return nil, nil - } - body, err := io.ReadAll(req.Body) - if err != nil { - return nil, err - } - req.Body.Close() - return body, nil -} - func newTracker[T any]() *tracker[T] { return &tracker[T]{ items: map[string]*T{}, diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/operations_server.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/operations_server.go index 88dd83337c97..e215554c9899 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/operations_server.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/operations_server.go @@ -1,7 +1,6 @@ // 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/polymorphic_helpers.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/polymorphic_helpers.go deleted file mode 100644 index b28bf6d0c029..000000000000 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/polymorphic_helpers.go +++ /dev/null @@ -1,38 +0,0 @@ -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "encoding/json" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry/v3" -) - -func unmarshalRunRequestClassification(rawMsg json.RawMessage) (armcontainerregistry.RunRequestClassification, error) { - if rawMsg == nil || string(rawMsg) == "null" { - return nil, nil - } - var m map[string]any - if err := json.Unmarshal(rawMsg, &m); err != nil { - return nil, err - } - var b armcontainerregistry.RunRequestClassification - switch m["type"] { - case "DockerBuildRequest": - b = &armcontainerregistry.DockerBuildRequest{} - case "EncodedTaskRunRequest": - b = &armcontainerregistry.EncodedTaskRunRequest{} - case "FileTaskRunRequest": - b = &armcontainerregistry.FileTaskRunRequest{} - case "TaskRunRequest": - b = &armcontainerregistry.TaskRunRequest{} - default: - b = &armcontainerregistry.RunRequest{} - } - if err := json.Unmarshal(rawMsg, b); err != nil { - return nil, err - } - return b, nil -} diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/privateendpointconnections_server.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/privateendpointconnections_server.go index b862d16f9bf3..1c8cd0473bc2 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/privateendpointconnections_server.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/privateendpointconnections_server.go @@ -1,7 +1,6 @@ // 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/registries_server.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/registries_server.go index 6128544d2d8b..c0a4f0b264c6 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/registries_server.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/registries_server.go @@ -1,7 +1,6 @@ // 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -41,10 +40,6 @@ type RegistriesServer struct { // HTTP status codes to indicate success: http.StatusOK Get func(ctx context.Context, resourceGroupName string, registryName string, options *armcontainerregistry.RegistriesClientGetOptions) (resp azfake.Responder[armcontainerregistry.RegistriesClientGetResponse], errResp azfake.ErrorResponder) - // GetBuildSourceUploadURL is the fake for method RegistriesClient.GetBuildSourceUploadURL - // HTTP status codes to indicate success: http.StatusOK - GetBuildSourceUploadURL func(ctx context.Context, resourceGroupName string, registryName string, options *armcontainerregistry.RegistriesClientGetBuildSourceUploadURLOptions) (resp azfake.Responder[armcontainerregistry.RegistriesClientGetBuildSourceUploadURLResponse], errResp azfake.ErrorResponder) - // GetPrivateLinkResource is the fake for method RegistriesClient.GetPrivateLinkResource // HTTP status codes to indicate success: http.StatusOK GetPrivateLinkResource func(ctx context.Context, resourceGroupName string, registryName string, groupName string, options *armcontainerregistry.RegistriesClientGetPrivateLinkResourceOptions) (resp azfake.Responder[armcontainerregistry.RegistriesClientGetPrivateLinkResourceResponse], errResp azfake.ErrorResponder) @@ -77,10 +72,6 @@ type RegistriesServer struct { // HTTP status codes to indicate success: http.StatusOK RegenerateCredential func(ctx context.Context, resourceGroupName string, registryName string, regenerateCredentialParameters armcontainerregistry.RegenerateCredentialParameters, options *armcontainerregistry.RegistriesClientRegenerateCredentialOptions) (resp azfake.Responder[armcontainerregistry.RegistriesClientRegenerateCredentialResponse], errResp azfake.ErrorResponder) - // ScheduleRun is the fake for method RegistriesClient.ScheduleRun - // HTTP status codes to indicate success: http.StatusOK - ScheduleRun func(ctx context.Context, resourceGroupName string, registryName string, runRequest armcontainerregistry.RunRequestClassification, options *armcontainerregistry.RegistriesClientScheduleRunOptions) (resp azfake.Responder[armcontainerregistry.RegistriesClientScheduleRunResponse], errResp azfake.ErrorResponder) - // BeginUpdate is the fake for method RegistriesClient.BeginUpdate // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated BeginUpdate func(ctx context.Context, resourceGroupName string, registryName string, registryUpdateParameters armcontainerregistry.RegistryUpdateParameters, options *armcontainerregistry.RegistriesClientBeginUpdateOptions) (resp azfake.PollerResponder[armcontainerregistry.RegistriesClientUpdateResponse], errResp azfake.ErrorResponder) @@ -150,8 +141,6 @@ func (r *RegistriesServerTransport) dispatchToMethodFake(req *http.Request, meth res.resp, res.err = r.dispatchBeginGenerateCredentials(req) case "RegistriesClient.Get": res.resp, res.err = r.dispatchGet(req) - case "RegistriesClient.GetBuildSourceUploadURL": - res.resp, res.err = r.dispatchGetBuildSourceUploadURL(req) case "RegistriesClient.GetPrivateLinkResource": res.resp, res.err = r.dispatchGetPrivateLinkResource(req) case "RegistriesClient.BeginImportImage": @@ -168,8 +157,6 @@ func (r *RegistriesServerTransport) dispatchToMethodFake(req *http.Request, meth res.resp, res.err = r.dispatchListUsages(req) case "RegistriesClient.RegenerateCredential": res.resp, res.err = r.dispatchRegenerateCredential(req) - case "RegistriesClient.ScheduleRun": - res.resp, res.err = r.dispatchScheduleRun(req) case "RegistriesClient.BeginUpdate": res.resp, res.err = r.dispatchBeginUpdate(req) default: @@ -393,39 +380,6 @@ func (r *RegistriesServerTransport) dispatchGet(req *http.Request) (*http.Respon return resp, nil } -func (r *RegistriesServerTransport) dispatchGetBuildSourceUploadURL(req *http.Request) (*http.Response, error) { - if r.srv.GetBuildSourceUploadURL == nil { - return nil, &nonRetriableError{errors.New("fake for method GetBuildSourceUploadURL not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerRegistry/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/listBuildSourceUploadUrl` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) - if err != nil { - return nil, err - } - respr, errRespr := r.srv.GetBuildSourceUploadURL(req.Context(), resourceGroupNameParam, registryNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).SourceUploadDefinition, req) - if err != nil { - return nil, err - } - return resp, nil -} - func (r *RegistriesServerTransport) dispatchGetPrivateLinkResource(req *http.Request) (*http.Response, error) { if r.srv.GetPrivateLinkResource == nil { return nil, &nonRetriableError{errors.New("fake for method GetPrivateLinkResource not implemented")} @@ -725,47 +679,6 @@ func (r *RegistriesServerTransport) dispatchRegenerateCredential(req *http.Reque return resp, nil } -func (r *RegistriesServerTransport) dispatchScheduleRun(req *http.Request) (*http.Response, error) { - if r.srv.ScheduleRun == nil { - return nil, &nonRetriableError{errors.New("fake for method ScheduleRun not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerRegistry/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/scheduleRun` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - raw, err := readRequestBody(req) - if err != nil { - return nil, err - } - body, err := unmarshalRunRequestClassification(raw) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) - if err != nil { - return nil, err - } - respr, errRespr := r.srv.ScheduleRun(req.Context(), resourceGroupNameParam, registryNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Run, req) - if err != nil { - return nil, err - } - return resp, nil -} - func (r *RegistriesServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) { if r.srv.BeginUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/replications_server.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/replications_server.go index 0f7e313a035f..f93bd6b77f8b 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/replications_server.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/replications_server.go @@ -1,7 +1,6 @@ // 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/runs_server.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/runs_server.go deleted file mode 100644 index df7be3b5657c..000000000000 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/runs_server.go +++ /dev/null @@ -1,339 +0,0 @@ -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry/v3" - "net/http" - "net/url" - "regexp" - "strconv" -) - -// RunsServer is a fake server for instances of the armcontainerregistry.RunsClient type. -type RunsServer struct { - // Cancel is the fake for method RunsClient.Cancel - // HTTP status codes to indicate success: http.StatusOK - Cancel func(ctx context.Context, resourceGroupName string, registryName string, runID string, options *armcontainerregistry.RunsClientCancelOptions) (resp azfake.Responder[armcontainerregistry.RunsClientCancelResponse], errResp azfake.ErrorResponder) - - // Get is the fake for method RunsClient.Get - // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, registryName string, runID string, options *armcontainerregistry.RunsClientGetOptions) (resp azfake.Responder[armcontainerregistry.RunsClientGetResponse], errResp azfake.ErrorResponder) - - // GetLogSasURL is the fake for method RunsClient.GetLogSasURL - // HTTP status codes to indicate success: http.StatusOK - GetLogSasURL func(ctx context.Context, resourceGroupName string, registryName string, runID string, options *armcontainerregistry.RunsClientGetLogSasURLOptions) (resp azfake.Responder[armcontainerregistry.RunsClientGetLogSasURLResponse], errResp azfake.ErrorResponder) - - // NewListPager is the fake for method RunsClient.NewListPager - // HTTP status codes to indicate success: http.StatusOK - NewListPager func(resourceGroupName string, registryName string, options *armcontainerregistry.RunsClientListOptions) (resp azfake.PagerResponder[armcontainerregistry.RunsClientListResponse]) - - // Update is the fake for method RunsClient.Update - // HTTP status codes to indicate success: http.StatusOK - Update func(ctx context.Context, resourceGroupName string, registryName string, runID string, runUpdateParameters armcontainerregistry.RunUpdateParameters, options *armcontainerregistry.RunsClientUpdateOptions) (resp azfake.Responder[armcontainerregistry.RunsClientUpdateResponse], errResp azfake.ErrorResponder) -} - -// NewRunsServerTransport creates a new instance of RunsServerTransport with the provided implementation. -// The returned RunsServerTransport instance is connected to an instance of armcontainerregistry.RunsClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewRunsServerTransport(srv *RunsServer) *RunsServerTransport { - return &RunsServerTransport{ - srv: srv, - newListPager: newTracker[azfake.PagerResponder[armcontainerregistry.RunsClientListResponse]](), - } -} - -// RunsServerTransport connects instances of armcontainerregistry.RunsClient to instances of RunsServer. -// Don't use this type directly, use NewRunsServerTransport instead. -type RunsServerTransport struct { - srv *RunsServer - newListPager *tracker[azfake.PagerResponder[armcontainerregistry.RunsClientListResponse]] -} - -// Do implements the policy.Transporter interface for RunsServerTransport. -func (r *RunsServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - return r.dispatchToMethodFake(req, method) -} - -func (r *RunsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - - go func() { - var intercepted bool - var res result - if runsServerTransportInterceptor != nil { - res.resp, res.err, intercepted = runsServerTransportInterceptor.Do(req) - } - if !intercepted { - switch method { - case "RunsClient.Cancel": - res.resp, res.err = r.dispatchCancel(req) - case "RunsClient.Get": - res.resp, res.err = r.dispatchGet(req) - case "RunsClient.GetLogSasURL": - res.resp, res.err = r.dispatchGetLogSasURL(req) - case "RunsClient.NewListPager": - res.resp, res.err = r.dispatchNewListPager(req) - case "RunsClient.Update": - res.resp, res.err = r.dispatchUpdate(req) - default: - res.err = fmt.Errorf("unhandled API %s", method) - } - - } - select { - case resultChan <- res: - case <-req.Context().Done(): - } - }() - - select { - case <-req.Context().Done(): - return nil, req.Context().Err() - case res := <-resultChan: - return res.resp, res.err - } -} - -func (r *RunsServerTransport) dispatchCancel(req *http.Request) (*http.Response, error) { - if r.srv.Cancel == nil { - return nil, &nonRetriableError{errors.New("fake for method Cancel not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerRegistry/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/runs/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/cancel` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if len(matches) < 5 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) - if err != nil { - return nil, err - } - runIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("runId")]) - if err != nil { - return nil, err - } - respr, errRespr := r.srv.Cancel(req.Context(), resourceGroupNameParam, registryNameParam, runIDParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.NewResponse(respContent, req, nil) - if err != nil { - return nil, err - } - return resp, nil -} - -func (r *RunsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { - if r.srv.Get == nil { - return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerRegistry/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/runs/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if len(matches) < 5 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) - if err != nil { - return nil, err - } - runIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("runId")]) - if err != nil { - return nil, err - } - respr, errRespr := r.srv.Get(req.Context(), resourceGroupNameParam, registryNameParam, runIDParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Run, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (r *RunsServerTransport) dispatchGetLogSasURL(req *http.Request) (*http.Response, error) { - if r.srv.GetLogSasURL == nil { - return nil, &nonRetriableError{errors.New("fake for method GetLogSasURL not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerRegistry/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/runs/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/listLogSasUrl` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if len(matches) < 5 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) - if err != nil { - return nil, err - } - runIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("runId")]) - if err != nil { - return nil, err - } - respr, errRespr := r.srv.GetLogSasURL(req.Context(), resourceGroupNameParam, registryNameParam, runIDParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).RunGetLogResult, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (r *RunsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { - if r.srv.NewListPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} - } - newListPager := r.newListPager.get(req) - if newListPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerRegistry/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/runs` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - qp := req.URL.Query() - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) - if err != nil { - return nil, err - } - filterUnescaped, err := url.QueryUnescape(qp.Get("$filter")) - if err != nil { - return nil, err - } - filterParam := getOptional(filterUnescaped) - topUnescaped, err := url.QueryUnescape(qp.Get("$top")) - if err != nil { - return nil, err - } - topParam, err := parseOptional(topUnescaped, func(v string) (int32, error) { - p, parseErr := strconv.ParseInt(v, 10, 32) - if parseErr != nil { - return 0, parseErr - } - return int32(p), nil - }) - if err != nil { - return nil, err - } - var options *armcontainerregistry.RunsClientListOptions - if filterParam != nil || topParam != nil { - options = &armcontainerregistry.RunsClientListOptions{ - Filter: filterParam, - Top: topParam, - } - } - resp := r.srv.NewListPager(resourceGroupNameParam, registryNameParam, options) - newListPager = &resp - r.newListPager.add(req, newListPager) - server.PagerResponderInjectNextLinks(newListPager, req, func(page *armcontainerregistry.RunsClientListResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newListPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - r.newListPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListPager) { - r.newListPager.remove(req) - } - return resp, nil -} - -func (r *RunsServerTransport) dispatchUpdate(req *http.Request) (*http.Response, error) { - if r.srv.Update == nil { - return nil, &nonRetriableError{errors.New("fake for method Update not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerRegistry/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/runs/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if len(matches) < 5 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armcontainerregistry.RunUpdateParameters](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) - if err != nil { - return nil, err - } - runIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("runId")]) - if err != nil { - return nil, err - } - respr, errRespr := r.srv.Update(req.Context(), resourceGroupNameParam, registryNameParam, runIDParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Run, req) - if err != nil { - return nil, err - } - return resp, nil -} - -// set this to conditionally intercept incoming requests to RunsServerTransport -var runsServerTransportInterceptor interface { - // Do returns true if the server transport should use the returned response/error - Do(*http.Request) (*http.Response, error, bool) -} diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/scopemaps_server.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/scopemaps_server.go index c685581b714f..b80c8284c72b 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/scopemaps_server.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/scopemaps_server.go @@ -1,7 +1,6 @@ // 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/server_factory.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/server_factory.go index 9c2f6b3f18b7..4df7a1ef45df 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/server_factory.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/server_factory.go @@ -1,7 +1,6 @@ // 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -16,9 +15,6 @@ import ( // ServerFactory is a fake server for instances of the armcontainerregistry.ClientFactory type. type ServerFactory struct { - // AgentPoolsServer contains the fakes for client AgentPoolsClient - AgentPoolsServer AgentPoolsServer - // CacheRulesServer contains the fakes for client CacheRulesClient CacheRulesServer CacheRulesServer @@ -40,18 +36,9 @@ type ServerFactory struct { // ReplicationsServer contains the fakes for client ReplicationsClient ReplicationsServer ReplicationsServer - // RunsServer contains the fakes for client RunsClient - RunsServer RunsServer - // ScopeMapsServer contains the fakes for client ScopeMapsClient ScopeMapsServer ScopeMapsServer - // TaskRunsServer contains the fakes for client TaskRunsClient - TaskRunsServer TaskRunsServer - - // TasksServer contains the fakes for client TasksClient - TasksServer TasksServer - // TokensServer contains the fakes for client TokensClient TokensServer TokensServer @@ -73,7 +60,6 @@ func NewServerFactoryTransport(srv *ServerFactory) *ServerFactoryTransport { type ServerFactoryTransport struct { srv *ServerFactory trMu sync.Mutex - trAgentPoolsServer *AgentPoolsServerTransport trCacheRulesServer *CacheRulesServerTransport trConnectedRegistriesServer *ConnectedRegistriesServerTransport trCredentialSetsServer *CredentialSetsServerTransport @@ -81,10 +67,7 @@ type ServerFactoryTransport struct { trPrivateEndpointConnectionsServer *PrivateEndpointConnectionsServerTransport trRegistriesServer *RegistriesServerTransport trReplicationsServer *ReplicationsServerTransport - trRunsServer *RunsServerTransport trScopeMapsServer *ScopeMapsServerTransport - trTaskRunsServer *TaskRunsServerTransport - trTasksServer *TasksServerTransport trTokensServer *TokensServerTransport trWebhooksServer *WebhooksServerTransport } @@ -102,9 +85,6 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { var err error switch client { - case "AgentPoolsClient": - initServer(s, &s.trAgentPoolsServer, func() *AgentPoolsServerTransport { return NewAgentPoolsServerTransport(&s.srv.AgentPoolsServer) }) - resp, err = s.trAgentPoolsServer.Do(req) case "CacheRulesClient": initServer(s, &s.trCacheRulesServer, func() *CacheRulesServerTransport { return NewCacheRulesServerTransport(&s.srv.CacheRulesServer) }) resp, err = s.trCacheRulesServer.Do(req) @@ -132,18 +112,9 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { case "ReplicationsClient": initServer(s, &s.trReplicationsServer, func() *ReplicationsServerTransport { return NewReplicationsServerTransport(&s.srv.ReplicationsServer) }) resp, err = s.trReplicationsServer.Do(req) - case "RunsClient": - initServer(s, &s.trRunsServer, func() *RunsServerTransport { return NewRunsServerTransport(&s.srv.RunsServer) }) - resp, err = s.trRunsServer.Do(req) case "ScopeMapsClient": initServer(s, &s.trScopeMapsServer, func() *ScopeMapsServerTransport { return NewScopeMapsServerTransport(&s.srv.ScopeMapsServer) }) resp, err = s.trScopeMapsServer.Do(req) - case "TaskRunsClient": - initServer(s, &s.trTaskRunsServer, func() *TaskRunsServerTransport { return NewTaskRunsServerTransport(&s.srv.TaskRunsServer) }) - resp, err = s.trTaskRunsServer.Do(req) - case "TasksClient": - initServer(s, &s.trTasksServer, func() *TasksServerTransport { return NewTasksServerTransport(&s.srv.TasksServer) }) - resp, err = s.trTasksServer.Do(req) case "TokensClient": initServer(s, &s.trTokensServer, func() *TokensServerTransport { return NewTokensServerTransport(&s.srv.TokensServer) }) resp, err = s.trTokensServer.Do(req) diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/taskruns_server.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/taskruns_server.go deleted file mode 100644 index 8f78e92a9055..000000000000 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/taskruns_server.go +++ /dev/null @@ -1,384 +0,0 @@ -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry/v3" - "net/http" - "net/url" - "regexp" -) - -// TaskRunsServer is a fake server for instances of the armcontainerregistry.TaskRunsClient type. -type TaskRunsServer struct { - // BeginCreate is the fake for method TaskRunsClient.BeginCreate - // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated - BeginCreate func(ctx context.Context, resourceGroupName string, registryName string, taskRunName string, taskRun armcontainerregistry.TaskRun, options *armcontainerregistry.TaskRunsClientBeginCreateOptions) (resp azfake.PollerResponder[armcontainerregistry.TaskRunsClientCreateResponse], errResp azfake.ErrorResponder) - - // Delete is the fake for method TaskRunsClient.Delete - // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent - Delete func(ctx context.Context, resourceGroupName string, registryName string, taskRunName string, options *armcontainerregistry.TaskRunsClientDeleteOptions) (resp azfake.Responder[armcontainerregistry.TaskRunsClientDeleteResponse], errResp azfake.ErrorResponder) - - // Get is the fake for method TaskRunsClient.Get - // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, registryName string, taskRunName string, options *armcontainerregistry.TaskRunsClientGetOptions) (resp azfake.Responder[armcontainerregistry.TaskRunsClientGetResponse], errResp azfake.ErrorResponder) - - // GetDetails is the fake for method TaskRunsClient.GetDetails - // HTTP status codes to indicate success: http.StatusOK - GetDetails func(ctx context.Context, resourceGroupName string, registryName string, taskRunName string, options *armcontainerregistry.TaskRunsClientGetDetailsOptions) (resp azfake.Responder[armcontainerregistry.TaskRunsClientGetDetailsResponse], errResp azfake.ErrorResponder) - - // NewListPager is the fake for method TaskRunsClient.NewListPager - // HTTP status codes to indicate success: http.StatusOK - NewListPager func(resourceGroupName string, registryName string, options *armcontainerregistry.TaskRunsClientListOptions) (resp azfake.PagerResponder[armcontainerregistry.TaskRunsClientListResponse]) - - // BeginUpdate is the fake for method TaskRunsClient.BeginUpdate - // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated - BeginUpdate func(ctx context.Context, resourceGroupName string, registryName string, taskRunName string, updateParameters armcontainerregistry.TaskRunUpdateParameters, options *armcontainerregistry.TaskRunsClientBeginUpdateOptions) (resp azfake.PollerResponder[armcontainerregistry.TaskRunsClientUpdateResponse], errResp azfake.ErrorResponder) -} - -// NewTaskRunsServerTransport creates a new instance of TaskRunsServerTransport with the provided implementation. -// The returned TaskRunsServerTransport instance is connected to an instance of armcontainerregistry.TaskRunsClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewTaskRunsServerTransport(srv *TaskRunsServer) *TaskRunsServerTransport { - return &TaskRunsServerTransport{ - srv: srv, - beginCreate: newTracker[azfake.PollerResponder[armcontainerregistry.TaskRunsClientCreateResponse]](), - newListPager: newTracker[azfake.PagerResponder[armcontainerregistry.TaskRunsClientListResponse]](), - beginUpdate: newTracker[azfake.PollerResponder[armcontainerregistry.TaskRunsClientUpdateResponse]](), - } -} - -// TaskRunsServerTransport connects instances of armcontainerregistry.TaskRunsClient to instances of TaskRunsServer. -// Don't use this type directly, use NewTaskRunsServerTransport instead. -type TaskRunsServerTransport struct { - srv *TaskRunsServer - beginCreate *tracker[azfake.PollerResponder[armcontainerregistry.TaskRunsClientCreateResponse]] - newListPager *tracker[azfake.PagerResponder[armcontainerregistry.TaskRunsClientListResponse]] - beginUpdate *tracker[azfake.PollerResponder[armcontainerregistry.TaskRunsClientUpdateResponse]] -} - -// Do implements the policy.Transporter interface for TaskRunsServerTransport. -func (t *TaskRunsServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - return t.dispatchToMethodFake(req, method) -} - -func (t *TaskRunsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - - go func() { - var intercepted bool - var res result - if taskRunsServerTransportInterceptor != nil { - res.resp, res.err, intercepted = taskRunsServerTransportInterceptor.Do(req) - } - if !intercepted { - switch method { - case "TaskRunsClient.BeginCreate": - res.resp, res.err = t.dispatchBeginCreate(req) - case "TaskRunsClient.Delete": - res.resp, res.err = t.dispatchDelete(req) - case "TaskRunsClient.Get": - res.resp, res.err = t.dispatchGet(req) - case "TaskRunsClient.GetDetails": - res.resp, res.err = t.dispatchGetDetails(req) - case "TaskRunsClient.NewListPager": - res.resp, res.err = t.dispatchNewListPager(req) - case "TaskRunsClient.BeginUpdate": - res.resp, res.err = t.dispatchBeginUpdate(req) - default: - res.err = fmt.Errorf("unhandled API %s", method) - } - - } - select { - case resultChan <- res: - case <-req.Context().Done(): - } - }() - - select { - case <-req.Context().Done(): - return nil, req.Context().Err() - case res := <-resultChan: - return res.resp, res.err - } -} - -func (t *TaskRunsServerTransport) dispatchBeginCreate(req *http.Request) (*http.Response, error) { - if t.srv.BeginCreate == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginCreate not implemented")} - } - beginCreate := t.beginCreate.get(req) - if beginCreate == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerRegistry/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/taskRuns/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if len(matches) < 5 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armcontainerregistry.TaskRun](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) - if err != nil { - return nil, err - } - taskRunNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("taskRunName")]) - if err != nil { - return nil, err - } - respr, errRespr := t.srv.BeginCreate(req.Context(), resourceGroupNameParam, registryNameParam, taskRunNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginCreate = &respr - t.beginCreate.add(req, beginCreate) - } - - resp, err := server.PollerResponderNext(beginCreate, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { - t.beginCreate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} - } - if !server.PollerResponderMore(beginCreate) { - t.beginCreate.remove(req) - } - - return resp, nil -} - -func (t *TaskRunsServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { - if t.srv.Delete == nil { - return nil, &nonRetriableError{errors.New("fake for method Delete not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerRegistry/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/taskRuns/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if len(matches) < 5 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) - if err != nil { - return nil, err - } - taskRunNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("taskRunName")]) - if err != nil { - return nil, err - } - respr, errRespr := t.srv.Delete(req.Context(), resourceGroupNameParam, registryNameParam, taskRunNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} - } - resp, err := server.NewResponse(respContent, req, nil) - if err != nil { - return nil, err - } - return resp, nil -} - -func (t *TaskRunsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { - if t.srv.Get == nil { - return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerRegistry/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/taskRuns/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if len(matches) < 5 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) - if err != nil { - return nil, err - } - taskRunNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("taskRunName")]) - if err != nil { - return nil, err - } - respr, errRespr := t.srv.Get(req.Context(), resourceGroupNameParam, registryNameParam, taskRunNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).TaskRun, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (t *TaskRunsServerTransport) dispatchGetDetails(req *http.Request) (*http.Response, error) { - if t.srv.GetDetails == nil { - return nil, &nonRetriableError{errors.New("fake for method GetDetails not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerRegistry/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/taskRuns/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/listDetails` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if len(matches) < 5 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) - if err != nil { - return nil, err - } - taskRunNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("taskRunName")]) - if err != nil { - return nil, err - } - respr, errRespr := t.srv.GetDetails(req.Context(), resourceGroupNameParam, registryNameParam, taskRunNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).TaskRun, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (t *TaskRunsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { - if t.srv.NewListPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} - } - newListPager := t.newListPager.get(req) - if newListPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerRegistry/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/taskRuns` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) - if err != nil { - return nil, err - } - resp := t.srv.NewListPager(resourceGroupNameParam, registryNameParam, nil) - newListPager = &resp - t.newListPager.add(req, newListPager) - server.PagerResponderInjectNextLinks(newListPager, req, func(page *armcontainerregistry.TaskRunsClientListResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newListPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - t.newListPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListPager) { - t.newListPager.remove(req) - } - return resp, nil -} - -func (t *TaskRunsServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) { - if t.srv.BeginUpdate == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} - } - beginUpdate := t.beginUpdate.get(req) - if beginUpdate == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerRegistry/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/taskRuns/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if len(matches) < 5 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armcontainerregistry.TaskRunUpdateParameters](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) - if err != nil { - return nil, err - } - taskRunNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("taskRunName")]) - if err != nil { - return nil, err - } - respr, errRespr := t.srv.BeginUpdate(req.Context(), resourceGroupNameParam, registryNameParam, taskRunNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginUpdate = &respr - t.beginUpdate.add(req, beginUpdate) - } - - resp, err := server.PollerResponderNext(beginUpdate, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { - t.beginUpdate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} - } - if !server.PollerResponderMore(beginUpdate) { - t.beginUpdate.remove(req) - } - - return resp, nil -} - -// set this to conditionally intercept incoming requests to TaskRunsServerTransport -var taskRunsServerTransportInterceptor interface { - // Do returns true if the server transport should use the returned response/error - Do(*http.Request) (*http.Response, error, bool) -} diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/tasks_server.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/tasks_server.go deleted file mode 100644 index 52e9e29926c4..000000000000 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/tasks_server.go +++ /dev/null @@ -1,358 +0,0 @@ -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry/v3" - "net/http" - "net/url" - "regexp" -) - -// TasksServer is a fake server for instances of the armcontainerregistry.TasksClient type. -type TasksServer struct { - // Create is the fake for method TasksClient.Create - // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated - Create func(ctx context.Context, resourceGroupName string, registryName string, taskName string, taskCreateParameters armcontainerregistry.Task, options *armcontainerregistry.TasksClientCreateOptions) (resp azfake.Responder[armcontainerregistry.TasksClientCreateResponse], errResp azfake.ErrorResponder) - - // Delete is the fake for method TasksClient.Delete - // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent - Delete func(ctx context.Context, resourceGroupName string, registryName string, taskName string, options *armcontainerregistry.TasksClientDeleteOptions) (resp azfake.Responder[armcontainerregistry.TasksClientDeleteResponse], errResp azfake.ErrorResponder) - - // Get is the fake for method TasksClient.Get - // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, registryName string, taskName string, options *armcontainerregistry.TasksClientGetOptions) (resp azfake.Responder[armcontainerregistry.TasksClientGetResponse], errResp azfake.ErrorResponder) - - // GetDetails is the fake for method TasksClient.GetDetails - // HTTP status codes to indicate success: http.StatusOK - GetDetails func(ctx context.Context, resourceGroupName string, registryName string, taskName string, options *armcontainerregistry.TasksClientGetDetailsOptions) (resp azfake.Responder[armcontainerregistry.TasksClientGetDetailsResponse], errResp azfake.ErrorResponder) - - // NewListPager is the fake for method TasksClient.NewListPager - // HTTP status codes to indicate success: http.StatusOK - NewListPager func(resourceGroupName string, registryName string, options *armcontainerregistry.TasksClientListOptions) (resp azfake.PagerResponder[armcontainerregistry.TasksClientListResponse]) - - // Update is the fake for method TasksClient.Update - // HTTP status codes to indicate success: http.StatusOK - Update func(ctx context.Context, resourceGroupName string, registryName string, taskName string, taskUpdateParameters armcontainerregistry.TaskUpdateParameters, options *armcontainerregistry.TasksClientUpdateOptions) (resp azfake.Responder[armcontainerregistry.TasksClientUpdateResponse], errResp azfake.ErrorResponder) -} - -// NewTasksServerTransport creates a new instance of TasksServerTransport with the provided implementation. -// The returned TasksServerTransport instance is connected to an instance of armcontainerregistry.TasksClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewTasksServerTransport(srv *TasksServer) *TasksServerTransport { - return &TasksServerTransport{ - srv: srv, - newListPager: newTracker[azfake.PagerResponder[armcontainerregistry.TasksClientListResponse]](), - } -} - -// TasksServerTransport connects instances of armcontainerregistry.TasksClient to instances of TasksServer. -// Don't use this type directly, use NewTasksServerTransport instead. -type TasksServerTransport struct { - srv *TasksServer - newListPager *tracker[azfake.PagerResponder[armcontainerregistry.TasksClientListResponse]] -} - -// Do implements the policy.Transporter interface for TasksServerTransport. -func (t *TasksServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - return t.dispatchToMethodFake(req, method) -} - -func (t *TasksServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { - resultChan := make(chan result) - defer close(resultChan) - - go func() { - var intercepted bool - var res result - if tasksServerTransportInterceptor != nil { - res.resp, res.err, intercepted = tasksServerTransportInterceptor.Do(req) - } - if !intercepted { - switch method { - case "TasksClient.Create": - res.resp, res.err = t.dispatchCreate(req) - case "TasksClient.Delete": - res.resp, res.err = t.dispatchDelete(req) - case "TasksClient.Get": - res.resp, res.err = t.dispatchGet(req) - case "TasksClient.GetDetails": - res.resp, res.err = t.dispatchGetDetails(req) - case "TasksClient.NewListPager": - res.resp, res.err = t.dispatchNewListPager(req) - case "TasksClient.Update": - res.resp, res.err = t.dispatchUpdate(req) - default: - res.err = fmt.Errorf("unhandled API %s", method) - } - - } - select { - case resultChan <- res: - case <-req.Context().Done(): - } - }() - - select { - case <-req.Context().Done(): - return nil, req.Context().Err() - case res := <-resultChan: - return res.resp, res.err - } -} - -func (t *TasksServerTransport) dispatchCreate(req *http.Request) (*http.Response, error) { - if t.srv.Create == nil { - return nil, &nonRetriableError{errors.New("fake for method Create not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerRegistry/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/tasks/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if len(matches) < 5 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armcontainerregistry.Task](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) - if err != nil { - return nil, err - } - taskNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("taskName")]) - if err != nil { - return nil, err - } - respr, errRespr := t.srv.Create(req.Context(), resourceGroupNameParam, registryNameParam, taskNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Task, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (t *TasksServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { - if t.srv.Delete == nil { - return nil, &nonRetriableError{errors.New("fake for method Delete not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerRegistry/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/tasks/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if len(matches) < 5 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) - if err != nil { - return nil, err - } - taskNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("taskName")]) - if err != nil { - return nil, err - } - respr, errRespr := t.srv.Delete(req.Context(), resourceGroupNameParam, registryNameParam, taskNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} - } - resp, err := server.NewResponse(respContent, req, nil) - if err != nil { - return nil, err - } - return resp, nil -} - -func (t *TasksServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { - if t.srv.Get == nil { - return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerRegistry/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/tasks/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if len(matches) < 5 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) - if err != nil { - return nil, err - } - taskNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("taskName")]) - if err != nil { - return nil, err - } - respr, errRespr := t.srv.Get(req.Context(), resourceGroupNameParam, registryNameParam, taskNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Task, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (t *TasksServerTransport) dispatchGetDetails(req *http.Request) (*http.Response, error) { - if t.srv.GetDetails == nil { - return nil, &nonRetriableError{errors.New("fake for method GetDetails not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerRegistry/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/tasks/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/listDetails` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if len(matches) < 5 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) - if err != nil { - return nil, err - } - taskNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("taskName")]) - if err != nil { - return nil, err - } - respr, errRespr := t.srv.GetDetails(req.Context(), resourceGroupNameParam, registryNameParam, taskNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Task, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (t *TasksServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { - if t.srv.NewListPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} - } - newListPager := t.newListPager.get(req) - if newListPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerRegistry/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/tasks` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) - if err != nil { - return nil, err - } - resp := t.srv.NewListPager(resourceGroupNameParam, registryNameParam, nil) - newListPager = &resp - t.newListPager.add(req, newListPager) - server.PagerResponderInjectNextLinks(newListPager, req, func(page *armcontainerregistry.TasksClientListResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newListPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - t.newListPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListPager) { - t.newListPager.remove(req) - } - return resp, nil -} - -func (t *TasksServerTransport) dispatchUpdate(req *http.Request) (*http.Response, error) { - if t.srv.Update == nil { - return nil, &nonRetriableError{errors.New("fake for method Update not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerRegistry/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/tasks/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if len(matches) < 5 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armcontainerregistry.TaskUpdateParameters](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - registryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("registryName")]) - if err != nil { - return nil, err - } - taskNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("taskName")]) - if err != nil { - return nil, err - } - respr, errRespr := t.srv.Update(req.Context(), resourceGroupNameParam, registryNameParam, taskNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Task, req) - if err != nil { - return nil, err - } - return resp, nil -} - -// set this to conditionally intercept incoming requests to TasksServerTransport -var tasksServerTransportInterceptor interface { - // Do returns true if the server transport should use the returned response/error - Do(*http.Request) (*http.Response, error, bool) -} diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/tokens_server.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/tokens_server.go index 3a81703a2e3f..ad234c10c9de 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/tokens_server.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/tokens_server.go @@ -1,7 +1,6 @@ // 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/webhooks_server.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/webhooks_server.go index 92ec0449d49c..e58e3c7e21b1 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/webhooks_server.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/webhooks_server.go @@ -1,7 +1,6 @@ // 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/go.mod b/sdk/resourcemanager/containerregistry/armcontainerregistry/go.mod index ab0e5399cf2e..5430ac57e470 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/go.mod +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/go.mod @@ -3,7 +3,7 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/a go 1.24.0 require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.20.0 + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.21.0 github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1 github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3 v3.1.0 @@ -19,9 +19,9 @@ require ( github.com/kylelemons/godebug v1.1.0 // indirect github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - golang.org/x/crypto v0.45.0 // indirect - golang.org/x/net v0.47.0 // indirect - golang.org/x/sys v0.38.0 // indirect - golang.org/x/text v0.31.0 // indirect + golang.org/x/crypto v0.47.0 // indirect + golang.org/x/net v0.49.0 // indirect + golang.org/x/sys v0.40.0 // indirect + golang.org/x/text v0.33.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/go.sum b/sdk/resourcemanager/containerregistry/armcontainerregistry/go.sum index cc236fb92e86..f4450ac568ee 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/go.sum +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/go.sum @@ -1,5 +1,5 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.20.0 h1:JXg2dwJUmPB9JmtVmdEB16APJ7jurfbY5jnfXpJoRMc= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.20.0/go.mod h1:YD5h/ldMsG0XiIw7PdyNhLxaM317eFh5yNLccNfGdyw= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.21.0 h1:fou+2+WFTib47nS+nz/ozhEBnvU96bKHy6LjRsY4E28= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.21.0/go.mod h1:t76Ruy8AHvUAC8GfMWJMa0ElSbuIcO03NLpynfbgsPA= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1 h1:Hk5QBxZQC1jb2Fwj6mpzme37xbCDdNTxU7O9eb5+LB4= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1/go.mod h1:IYus9qsFobWIc2YVwe/WPjcnyCkPKtnHAqUYeebc8z0= github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2 h1:yz1bePFlP5Vws5+8ez6T3HWXPmwOK7Yvq8QxDBD3SKY= @@ -40,15 +40,15 @@ github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= -golang.org/x/crypto v0.45.0 h1:jMBrvKuj23MTlT0bQEOBcAE0mjg8mK9RXFhRH6nyF3Q= -golang.org/x/crypto v0.45.0/go.mod h1:XTGrrkGJve7CYK7J8PEww4aY7gM3qMCElcJQ8n8JdX4= -golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY= -golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU= +golang.org/x/crypto v0.47.0 h1:V6e3FRj+n4dbpw86FJ8Fv7XVOql7TEwpHapKoMJ/GO8= +golang.org/x/crypto v0.47.0/go.mod h1:ff3Y9VzzKbwSSEzWqJsJVBnWmRwRSHt/6Op5n9bQc4A= +golang.org/x/net v0.49.0 h1:eeHFmOGUTtaaPSGNmjBKpbng9MulQsJURQUAfUwY++o= +golang.org/x/net v0.49.0/go.mod h1:/ysNB2EvaqvesRkuLAyjI1ycPZlQHM3q01F02UY/MV8= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc= -golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= -golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM= -golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM= +golang.org/x/sys v0.40.0 h1:DBZZqJ2Rkml6QMQsZywtnjnnGvHza6BTfYFWY9kjEWQ= +golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/text v0.33.0 h1:B3njUFyqtHDUI5jMn1YIr5B0IE2U0qck04r6d4KPAxE= +golang.org/x/text v0.33.0/go.mod h1:LuMebE6+rBincTi9+xWTY8TztLzKHc/9C1uBCG27+q8= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/interfaces.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/interfaces.go deleted file mode 100644 index 2c91805ea3f1..000000000000 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/interfaces.go +++ /dev/null @@ -1,33 +0,0 @@ -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcontainerregistry - -// RunRequestClassification provides polymorphic access to related types. -// Call the interface's GetRunRequest() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *DockerBuildRequest, *EncodedTaskRunRequest, *FileTaskRunRequest, *RunRequest, *TaskRunRequest -type RunRequestClassification interface { - // GetRunRequest returns the RunRequest content of the underlying type. - GetRunRequest() *RunRequest -} - -// TaskStepPropertiesClassification provides polymorphic access to related types. -// Call the interface's GetTaskStepProperties() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *DockerBuildStep, *EncodedTaskStep, *FileTaskStep, *TaskStepProperties -type TaskStepPropertiesClassification interface { - // GetTaskStepProperties returns the TaskStepProperties content of the underlying type. - GetTaskStepProperties() *TaskStepProperties -} - -// TaskStepUpdateParametersClassification provides polymorphic access to related types. -// Call the interface's GetTaskStepUpdateParameters() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *DockerBuildStepUpdateParameters, *EncodedTaskStepUpdateParameters, *FileTaskStepUpdateParameters, *TaskStepUpdateParameters -type TaskStepUpdateParametersClassification interface { - // GetTaskStepUpdateParameters returns the TaskStepUpdateParameters content of the underlying type. - GetTaskStepUpdateParameters() *TaskStepUpdateParameters -} diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/models.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/models.go index f920d7fe0a5e..34688cd1f51b 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/models.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/models.go @@ -1,7 +1,6 @@ // 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armcontainerregistry @@ -19,96 +18,6 @@ type Actor struct { Name *string } -// AgentPool - The agentpool that has the ARM resource and properties. The agentpool will have all information to create an -// agent pool. -type AgentPool struct { - // REQUIRED; The geo-location where the resource lives - Location *string - - // The properties associated with the agent pool - Properties *AgentPoolProperties - - // Resource tags. - Tags map[string]*string - - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - -// AgentPoolListResult - The collection of agent pools. -type AgentPoolListResult struct { - // The URI that can be used to request the next set of paged results. - NextLink *string - - // The collection value. - Value []*AgentPool -} - -// AgentPoolProperties - The properties of agent pool. -type AgentPoolProperties struct { - // The count of agent machine - Count *int32 - - // The OS of agent machine - OS *OS - - // The Tier of agent machine - Tier *string - - // The Virtual Network Subnet Resource Id of the agent machine - VirtualNetworkSubnetResourceID *string - - // READ-ONLY; The provisioning state of this agent pool - ProvisioningState *ProvisioningState -} - -type AgentPoolPropertiesUpdateParameters struct { - // The count of agent machine - Count *int32 -} - -// AgentPoolQueueStatus - The QueueStatus of Agent Pool -type AgentPoolQueueStatus struct { - // The number of pending runs in the queue - Count *int32 -} - -// AgentPoolUpdateParameters - The parameters for updating an agent pool. -type AgentPoolUpdateParameters struct { - // The properties associated with the agent pool - Properties *AgentPoolPropertiesUpdateParameters - - // The ARM resource tags. - Tags map[string]*string -} - -// AgentProperties - The properties that determine the run agent configuration. -type AgentProperties struct { - // The CPU configuration in terms of number of cores required for the run. - CPU *int32 -} - -// Argument - The properties of a run argument. -type Argument struct { - // REQUIRED; The name of the argument. - Name *string - - // REQUIRED; The value of the argument. - Value *string - - // Flag to indicate whether the argument represents a secret and want to be removed from build logs. - IsSecret *bool -} - // AuthCredential - Authentication credential stored for an upstream. type AuthCredential struct { // The name of the credential. @@ -124,111 +33,21 @@ type AuthCredential struct { CredentialHealth *CredentialHealth } -// AuthInfo - The authorization properties for accessing the source code repository. -type AuthInfo struct { - // REQUIRED; The access token used to access the source control provider. - Token *string - - // REQUIRED; The type of Auth token. - TokenType *TokenType - - // Time in seconds that the token remains valid - ExpiresIn *int32 - - // The refresh token used to refresh the access token. - RefreshToken *string - - // The scope of the access token. - Scope *string -} - -// AuthInfoUpdateParameters - The authorization properties for accessing the source code repository. -type AuthInfoUpdateParameters struct { - // Time in seconds that the token remains valid - ExpiresIn *int32 - - // The refresh token used to refresh the access token. - RefreshToken *string - - // The scope of the access token. - Scope *string - - // The access token used to access the source control provider. - Token *string - - // The type of Auth token. - TokenType *TokenType -} - // AzureADAuthenticationAsArmPolicy - The policy for using Azure Resource Manager audience token for a container registry. type AzureADAuthenticationAsArmPolicy struct { // The value that indicates whether the policy is enabled or not. Status *AzureADAuthenticationAsArmPolicyStatus } -// BaseImageDependency - Properties that describe a base image dependency. -type BaseImageDependency struct { - // The sha256-based digest of the image manifest. - Digest *string - - // The registry login server. - Registry *string - - // The repository name. - Repository *string - - // The tag name. - Tag *string - - // The type of the base image dependency. - Type *BaseImageDependencyType -} - -// BaseImageTrigger - The trigger based on base image dependency. -type BaseImageTrigger struct { - // REQUIRED; The type of the auto trigger for base image dependency updates. - BaseImageTriggerType *BaseImageTriggerType - - // REQUIRED; The name of the trigger. - Name *string - - // The current status of trigger. - Status *TriggerStatus - - // The endpoint URL for receiving update triggers. - UpdateTriggerEndpoint *string - - // Type of Payload body for Base image update triggers. - UpdateTriggerPayloadType *UpdateTriggerPayloadType -} - -// BaseImageTriggerUpdateParameters - The properties for updating base image dependency trigger. -type BaseImageTriggerUpdateParameters struct { - // REQUIRED; The name of the trigger. - Name *string - - // The type of the auto trigger for base image dependency updates. - BaseImageTriggerType *BaseImageTriggerType - - // The current status of trigger. - Status *TriggerStatus - - // The endpoint URL for receiving update triggers. - UpdateTriggerEndpoint *string - - // Type of Payload body for Base image update triggers. - UpdateTriggerPayloadType *UpdateTriggerPayloadType -} - // CacheRule - An object that represents a cache rule for a container registry. type CacheRule struct { // The properties of the cache rule. Properties *CacheRuleProperties - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string - // READ-ONLY; The name of the resource + // READ-ONLY; The name of the private link resource. Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -246,7 +65,8 @@ type CacheRuleProperties struct { // Source repository pulled from upstream. SourceRepository *string - // Target repository specified in docker pull command. Eg: docker pull myregistry.azurecr.io/{targetRepository}:{tag} + // Target repository specified in docker pull command. + // Eg: docker pull myregistry.azurecr.io/{targetRepository}:{tag} TargetRepository *string // READ-ONLY; The creation date of the cache rule. @@ -292,10 +112,10 @@ type ConnectedRegistry struct { // The properties of the connected registry. Properties *ConnectedRegistryProperties - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string - // READ-ONLY; The name of the resource + // READ-ONLY; The name of the private link resource. Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -401,10 +221,10 @@ type CredentialSet struct { // The properties of the credential set. Properties *CredentialSetProperties - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string - // READ-ONLY; The name of the resource + // READ-ONLY; The name of the private link resource. Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -426,7 +246,8 @@ type CredentialSetListResult struct { // CredentialSetProperties - The properties of a credential set resource. type CredentialSetProperties struct { - // List of authentication credentials stored for an upstream. Usually consists of a primary and an optional secondary credential. + // List of authentication credentials stored for an upstream. + // Usually consists of a primary and an optional secondary credential. AuthCredentials []*AuthCredential // The credentials are stored for this upstream or login server. @@ -450,293 +271,11 @@ type CredentialSetUpdateParameters struct { // CredentialSetUpdateProperties - The parameters for updating credential set properties. type CredentialSetUpdateProperties struct { - // List of authentication credentials stored for an upstream. Usually consists of a primary and an optional secondary credential. + // List of authentication credentials stored for an upstream. + // Usually consists of a primary and an optional secondary credential. AuthCredentials []*AuthCredential } -// Credentials - The parameters that describes a set of credentials that will be used when a run is invoked. -type Credentials struct { - // Describes the credential parameters for accessing other custom registries. The key for the dictionary item will be the - // registry login server (myregistry.azurecr.io) and the value of the item will be - // the registry credentials for accessing the registry. - CustomRegistries map[string]*CustomRegistryCredentials - - // Describes the credential parameters for accessing the source registry. - SourceRegistry *SourceRegistryCredentials -} - -// CustomRegistryCredentials - Describes the credentials that will be used to access a custom registry during a run. -type CustomRegistryCredentials struct { - // Indicates the managed identity assigned to the custom credential. If a user-assigned identity this value is the Client - // ID. If a system-assigned identity, the value will be system. In the case of a - // system-assigned identity, the Client ID will be determined by the runner. This identity may be used to authenticate to - // key vault to retrieve credentials or it may be the only source of authentication - // used for accessing the registry. - Identity *string - - // The password for logging into the custom registry. The password is a secret object that allows multiple ways of providing - // the value for it. - Password *SecretObject - - // The username for logging into the custom registry. - UserName *SecretObject -} - -// DockerBuildRequest - The parameters for a docker quick build. -type DockerBuildRequest struct { - // REQUIRED; The Docker file path relative to the source location. - DockerFilePath *string - - // REQUIRED; The platform properties against which the run has to happen. - Platform *PlatformProperties - - // REQUIRED; The type of the run request. - Type *string - - // The machine configuration of the run agent. - AgentConfiguration *AgentProperties - - // The dedicated agent pool for the run. - AgentPoolName *string - - // The collection of override arguments to be used when executing the run. - Arguments []*Argument - - // The properties that describes a set of credentials that will be used when this run is invoked. - Credentials *Credentials - - // The fully qualified image names including the repository and tag. - ImageNames []*string - - // The value that indicates whether archiving is enabled for the run or not. - IsArchiveEnabled *bool - - // The value of this property indicates whether the image built should be pushed to the registry or not. - IsPushEnabled *bool - - // The template that describes the repository and tag information for run log artifact. - LogTemplate *string - - // The value of this property indicates whether the image cache is enabled or not. - NoCache *bool - - // The URL(absolute or relative) of the source context. It can be an URL to a tar or git repository. If it is relative URL, - // the relative path should be obtained from calling listBuildSourceUploadUrl API. - SourceLocation *string - - // The name of the target build stage for the docker build. - Target *string - - // Run timeout in seconds. - Timeout *int32 -} - -// GetRunRequest implements the RunRequestClassification interface for type DockerBuildRequest. -func (d *DockerBuildRequest) GetRunRequest() *RunRequest { - return &RunRequest{ - AgentPoolName: d.AgentPoolName, - IsArchiveEnabled: d.IsArchiveEnabled, - LogTemplate: d.LogTemplate, - Type: d.Type, - } -} - -// DockerBuildStep - The Docker build step. -type DockerBuildStep struct { - // REQUIRED; The Docker file path relative to the source context. - DockerFilePath *string - - // REQUIRED; The type of the step. - Type *StepType - - // The collection of override arguments to be used when executing this build step. - Arguments []*Argument - - // The token (git PAT or SAS token of storage account blob) associated with the context for a step. - ContextAccessToken *string - - // The URL(absolute or relative) of the source context for the task step. - ContextPath *string - - // The fully qualified image names including the repository and tag. - ImageNames []*string - - // The value of this property indicates whether the image built should be pushed to the registry or not. - IsPushEnabled *bool - - // The value of this property indicates whether the image cache is enabled or not. - NoCache *bool - - // The name of the target build stage for the docker build. - Target *string - - // READ-ONLY; List of base image dependencies for a step. - BaseImageDependencies []*BaseImageDependency -} - -// GetTaskStepProperties implements the TaskStepPropertiesClassification interface for type DockerBuildStep. -func (d *DockerBuildStep) GetTaskStepProperties() *TaskStepProperties { - return &TaskStepProperties{ - BaseImageDependencies: d.BaseImageDependencies, - ContextAccessToken: d.ContextAccessToken, - ContextPath: d.ContextPath, - Type: d.Type, - } -} - -// DockerBuildStepUpdateParameters - The properties for updating a docker build step. -type DockerBuildStepUpdateParameters struct { - // REQUIRED; The type of the step. - Type *StepType - - // The collection of override arguments to be used when executing this build step. - Arguments []*Argument - - // The token (git PAT or SAS token of storage account blob) associated with the context for a step. - ContextAccessToken *string - - // The URL(absolute or relative) of the source context for the task step. - ContextPath *string - - // The Docker file path relative to the source context. - DockerFilePath *string - - // The fully qualified image names including the repository and tag. - ImageNames []*string - - // The value of this property indicates whether the image built should be pushed to the registry or not. - IsPushEnabled *bool - - // The value of this property indicates whether the image cache is enabled or not. - NoCache *bool - - // The name of the target build stage for the docker build. - Target *string -} - -// GetTaskStepUpdateParameters implements the TaskStepUpdateParametersClassification interface for type DockerBuildStepUpdateParameters. -func (d *DockerBuildStepUpdateParameters) GetTaskStepUpdateParameters() *TaskStepUpdateParameters { - return &TaskStepUpdateParameters{ - ContextAccessToken: d.ContextAccessToken, - ContextPath: d.ContextPath, - Type: d.Type, - } -} - -// EncodedTaskRunRequest - The parameters for a quick task run request. -type EncodedTaskRunRequest struct { - // REQUIRED; Base64 encoded value of the template/definition file content. - EncodedTaskContent *string - - // REQUIRED; The platform properties against which the run has to happen. - Platform *PlatformProperties - - // REQUIRED; The type of the run request. - Type *string - - // The machine configuration of the run agent. - AgentConfiguration *AgentProperties - - // The dedicated agent pool for the run. - AgentPoolName *string - - // The properties that describes a set of credentials that will be used when this run is invoked. - Credentials *Credentials - - // Base64 encoded value of the parameters/values file content. - EncodedValuesContent *string - - // The value that indicates whether archiving is enabled for the run or not. - IsArchiveEnabled *bool - - // The template that describes the repository and tag information for run log artifact. - LogTemplate *string - - // The URL(absolute or relative) of the source context. It can be an URL to a tar or git repository. If it is relative URL, - // the relative path should be obtained from calling listBuildSourceUploadUrl API. - SourceLocation *string - - // Run timeout in seconds. - Timeout *int32 - - // The collection of overridable values that can be passed when running a task. - Values []*SetValue -} - -// GetRunRequest implements the RunRequestClassification interface for type EncodedTaskRunRequest. -func (e *EncodedTaskRunRequest) GetRunRequest() *RunRequest { - return &RunRequest{ - AgentPoolName: e.AgentPoolName, - IsArchiveEnabled: e.IsArchiveEnabled, - LogTemplate: e.LogTemplate, - Type: e.Type, - } -} - -// EncodedTaskStep - The properties of a encoded task step. -type EncodedTaskStep struct { - // REQUIRED; Base64 encoded value of the template/definition file content. - EncodedTaskContent *string - - // REQUIRED; The type of the step. - Type *StepType - - // The token (git PAT or SAS token of storage account blob) associated with the context for a step. - ContextAccessToken *string - - // The URL(absolute or relative) of the source context for the task step. - ContextPath *string - - // Base64 encoded value of the parameters/values file content. - EncodedValuesContent *string - - // The collection of overridable values that can be passed when running a task. - Values []*SetValue - - // READ-ONLY; List of base image dependencies for a step. - BaseImageDependencies []*BaseImageDependency -} - -// GetTaskStepProperties implements the TaskStepPropertiesClassification interface for type EncodedTaskStep. -func (e *EncodedTaskStep) GetTaskStepProperties() *TaskStepProperties { - return &TaskStepProperties{ - BaseImageDependencies: e.BaseImageDependencies, - ContextAccessToken: e.ContextAccessToken, - ContextPath: e.ContextPath, - Type: e.Type, - } -} - -// EncodedTaskStepUpdateParameters - The properties for updating encoded task step. -type EncodedTaskStepUpdateParameters struct { - // REQUIRED; The type of the step. - Type *StepType - - // The token (git PAT or SAS token of storage account blob) associated with the context for a step. - ContextAccessToken *string - - // The URL(absolute or relative) of the source context for the task step. - ContextPath *string - - // Base64 encoded value of the template/definition file content. - EncodedTaskContent *string - - // Base64 encoded value of the parameters/values file content. - EncodedValuesContent *string - - // The collection of overridable values that can be passed when running a task. - Values []*SetValue -} - -// GetTaskStepUpdateParameters implements the TaskStepUpdateParametersClassification interface for type EncodedTaskStepUpdateParameters. -func (e *EncodedTaskStepUpdateParameters) GetTaskStepUpdateParameters() *TaskStepUpdateParameters { - return &TaskStepUpdateParameters{ - ContextAccessToken: e.ContextAccessToken, - ContextPath: e.ContextPath, - Type: e.Type, - } -} - type EncryptionProperty struct { // Key vault properties. KeyVaultProperties *KeyVaultProperties @@ -839,120 +378,6 @@ type ExportPolicy struct { Status *ExportPolicyStatus } -// FileTaskRunRequest - The request parameters for a scheduling run against a task file. -type FileTaskRunRequest struct { - // REQUIRED; The platform properties against which the run has to happen. - Platform *PlatformProperties - - // REQUIRED; The template/definition file path relative to the source. - TaskFilePath *string - - // REQUIRED; The type of the run request. - Type *string - - // The machine configuration of the run agent. - AgentConfiguration *AgentProperties - - // The dedicated agent pool for the run. - AgentPoolName *string - - // The properties that describes a set of credentials that will be used when this run is invoked. - Credentials *Credentials - - // The value that indicates whether archiving is enabled for the run or not. - IsArchiveEnabled *bool - - // The template that describes the repository and tag information for run log artifact. - LogTemplate *string - - // The URL(absolute or relative) of the source context. It can be an URL to a tar or git repository. If it is relative URL, - // the relative path should be obtained from calling listBuildSourceUploadUrl API. - SourceLocation *string - - // Run timeout in seconds. - Timeout *int32 - - // The collection of overridable values that can be passed when running a task. - Values []*SetValue - - // The values/parameters file path relative to the source. - ValuesFilePath *string -} - -// GetRunRequest implements the RunRequestClassification interface for type FileTaskRunRequest. -func (f *FileTaskRunRequest) GetRunRequest() *RunRequest { - return &RunRequest{ - AgentPoolName: f.AgentPoolName, - IsArchiveEnabled: f.IsArchiveEnabled, - LogTemplate: f.LogTemplate, - Type: f.Type, - } -} - -// FileTaskStep - The properties of a task step. -type FileTaskStep struct { - // REQUIRED; The task template/definition file path relative to the source context. - TaskFilePath *string - - // REQUIRED; The type of the step. - Type *StepType - - // The token (git PAT or SAS token of storage account blob) associated with the context for a step. - ContextAccessToken *string - - // The URL(absolute or relative) of the source context for the task step. - ContextPath *string - - // The collection of overridable values that can be passed when running a task. - Values []*SetValue - - // The task values/parameters file path relative to the source context. - ValuesFilePath *string - - // READ-ONLY; List of base image dependencies for a step. - BaseImageDependencies []*BaseImageDependency -} - -// GetTaskStepProperties implements the TaskStepPropertiesClassification interface for type FileTaskStep. -func (f *FileTaskStep) GetTaskStepProperties() *TaskStepProperties { - return &TaskStepProperties{ - BaseImageDependencies: f.BaseImageDependencies, - ContextAccessToken: f.ContextAccessToken, - ContextPath: f.ContextPath, - Type: f.Type, - } -} - -// FileTaskStepUpdateParameters - The properties of updating a task step. -type FileTaskStepUpdateParameters struct { - // REQUIRED; The type of the step. - Type *StepType - - // The token (git PAT or SAS token of storage account blob) associated with the context for a step. - ContextAccessToken *string - - // The URL(absolute or relative) of the source context for the task step. - ContextPath *string - - // The task template/definition file path relative to the source context. - TaskFilePath *string - - // The collection of overridable values that can be passed when running a task. - Values []*SetValue - - // The values/parameters file path relative to the source context. - ValuesFilePath *string -} - -// GetTaskStepUpdateParameters implements the TaskStepUpdateParametersClassification interface for type FileTaskStepUpdateParameters. -func (f *FileTaskStepUpdateParameters) GetTaskStepUpdateParameters() *TaskStepUpdateParameters { - return &TaskStepUpdateParameters{ - ContextAccessToken: f.ContextAccessToken, - ContextPath: f.ContextPath, - Type: f.Type, - } -} - // GarbageCollectionProperties - The garbage collection properties of the connected registry. type GarbageCollectionProperties struct { // Indicates whether garbage collection is enabled for the connected registry. @@ -998,9 +423,10 @@ type IdentityProperties struct { // The identity type. Type *ResourceIdentityType - // The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource - // ids in the form: - // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + // The list of user identities associated with the resource. The user identity + // dictionary key references will be ARM resource ids in the form: + // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ + // providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. UserAssignedIdentities map[string]*UserIdentityProperties // READ-ONLY; The principal ID of resource identity. @@ -1010,33 +436,6 @@ type IdentityProperties struct { TenantID *string } -// ImageDescriptor - Properties for a registry image. -type ImageDescriptor struct { - // The sha256-based digest of the image manifest. - Digest *string - - // The registry login server. - Registry *string - - // The repository name. - Repository *string - - // The tag name. - Tag *string -} - -// ImageUpdateTrigger - The image update trigger that caused a build. -type ImageUpdateTrigger struct { - // The unique ID of the trigger. - ID *string - - // The list of image updates that caused the build. - Images []*ImageDescriptor - - // The timestamp when the image update happened. - Timestamp *time.Time -} - type ImportImageParameters struct { // REQUIRED; The source of the image. Source *ImportSource @@ -1054,9 +453,10 @@ type ImportImageParameters struct { } type ImportSource struct { - // REQUIRED; Repository name of the source image. Specify an image by repository ('hello-world'). This will use the 'latest' - // tag. Specify an image by tag ('hello-world:latest'). Specify an image by sha256-based - // manifest digest ('hello-world@sha256:abc123'). + // REQUIRED; Repository name of the source image. + // Specify an image by repository ('hello-world'). This will use the 'latest' tag. + // Specify an image by tag ('hello-world:latest'). + // Specify an image by sha256-based manifest digest ('hello-world@sha256:abc123'). SourceImage *string // Credentials used when importing from a registry uri. @@ -1126,7 +526,8 @@ type OperationDefinition struct { // The display information for the container registry operation. Display *OperationDisplayDefinition - // This property indicates if the operation is an action or a data action ref: https://docs.microsoft.com/en-us/azure/role-based-access-control/role-definitions#management-and-data-operations + // This property indicates if the operation is an action or a data action + // ref: https://docs.microsoft.com/en-us/azure/role-based-access-control/role-definitions#management-and-data-operations IsDataAction *bool // Operation name: {provider}/{resource}/{operation}. @@ -1212,26 +613,6 @@ type OperationServiceSpecificationDefinition struct { MetricSpecifications []*OperationMetricSpecificationDefinition } -type OverrideTaskStepProperties struct { - // Gets or sets the collection of override arguments to be used when executing a build step. - Arguments []*Argument - - // The source context against which run has to be queued. - ContextPath *string - - // The file against which run has to be queued. - File *string - - // The name of the target build stage for the docker build. - Target *string - - // Base64 encoded update trigger token that will be attached with the base image trigger webhook. - UpdateTriggerToken *string - - // The collection of overridable values that can be passed when running a Task. - Values []*SetValue -} - // ParentProperties - The properties of the connected registry parent. type ParentProperties struct { // REQUIRED; The sync properties of the connected registry with its parent. @@ -1241,30 +622,6 @@ type ParentProperties struct { ID *string } -// PlatformProperties - The platform properties against which the run has to happen. -type PlatformProperties struct { - // REQUIRED; The operating system type required for the run. - OS *OS - - // The OS architecture. - Architecture *Architecture - - // Variant of the CPU. - Variant *Variant -} - -// PlatformUpdateParameters - The properties for updating the platform configuration. -type PlatformUpdateParameters struct { - // The OS architecture. - Architecture *Architecture - - // The operating system type required for the run. - OS *OS - - // Variant of the CPU. - Variant *Variant -} - // Policies - The policies for a container registry. type Policies struct { // The policy for using Azure Resource Manager audience token for a container registry. @@ -1294,10 +651,10 @@ type PrivateEndpointConnection struct { // The properties of a private endpoint connection. Properties *PrivateEndpointConnectionProperties - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string - // READ-ONLY; The name of the resource + // READ-ONLY; The name of the private link resource. Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -1331,13 +688,13 @@ type PrivateEndpointConnectionProperties struct { // PrivateLinkResource - A private link resource. type PrivateLinkResource struct { - // Resource properties. + // A resource that supports private link capabilities. Properties *PrivateLinkResourceProperties - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string - // READ-ONLY; The name of the resource + // READ-ONLY; The name of the private link resource. Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -1410,10 +767,10 @@ type Registry struct { // Resource tags. Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string - // READ-ONLY; The name of the resource + // READ-ONLY; The name of the private link resource. Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -1450,19 +807,10 @@ type RegistryNameCheckRequest struct { // CONSTANT; The resource type of the container registry. This field must be set to 'Microsoft.ContainerRegistry/registries'. // Field has constant value "Microsoft.ContainerRegistry/registries", any specified value is ignored. Type *string - - // The auto generated domain name label of the container registry. This value defaults to "Unsecure". - AutoGeneratedDomainNameLabelScope *AutoGeneratedDomainNameLabelScope - - // The resource group name of the container registry. - ResourceGroupName *string } // RegistryNameStatus - The result of a request to check the availability of a container registry name. type RegistryNameStatus struct { - // The complete login server name with domain name label (DNL) hash, if available - AvailableLoginServerName *string - // If any, the error message that provides more detail for the reason that the name is not available. Message *string @@ -1490,9 +838,6 @@ type RegistryProperties struct { // Enables registry-wide pull from unauthenticated clients. AnonymousPullEnabled *bool - // Determines the domain name label reuse scope. - AutoGeneratedDomainNameLabelScope *AutoGeneratedDomainNameLabelScope - // Enable a single data endpoint per region for serving data. DataEndpointEnabled *bool @@ -1619,10 +964,10 @@ type Replication struct { // Resource tags. Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string - // READ-ONLY; The name of the resource + // READ-ONLY; The name of the private link resource. Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -1645,8 +990,7 @@ type ReplicationListResult struct { // ReplicationProperties - The properties of a replication. type ReplicationProperties struct { // Specifies whether the replication's regional endpoint is enabled. Requests will not be routed to a replication whose regional - // endpoint is disabled, however its data will continue to be synced with - // other replications. + // endpoint is disabled, however its data will continue to be synced with other replications. RegionEndpointEnabled *bool // Whether or not zone redundancy is enabled for this container registry replication @@ -1670,8 +1014,7 @@ type ReplicationUpdateParameters struct { type ReplicationUpdateParametersProperties struct { // Specifies whether the replication's regional endpoint is enabled. Requests will not be routed to a replication whose regional - // endpoint is disabled, however its data will continue to be synced with - // other replications. + // endpoint is disabled, however its data will continue to be synced with other replications. RegionEndpointEnabled *bool } @@ -1706,135 +1049,6 @@ type RetentionPolicy struct { LastUpdatedTime *time.Time } -// Run resource properties -type Run struct { - // The properties of a run. - Properties *RunProperties - - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - -// RunGetLogResult - The result of get log link operation. -type RunGetLogResult struct { - // The link to logs in registry for a run on a azure container registry. - LogArtifactLink *string - - // The link to logs for a run on a azure container registry. - LogLink *string -} - -// RunListResult - The collection of runs. -type RunListResult struct { - // The URI that can be used to request the next set of paged results. - NextLink *string - - // The collection value. - Value []*Run -} - -// RunProperties - The properties for a run. -type RunProperties struct { - // The machine configuration of the run agent. - AgentConfiguration *AgentProperties - - // The dedicated agent pool for the run. - AgentPoolName *string - - // The time the run was scheduled. - CreateTime *time.Time - - // The list of custom registries that were logged in during this run. - CustomRegistries []*string - - // The time the run finished. - FinishTime *time.Time - - // The image update trigger that caused the run. This is applicable if the task has base image trigger configured. - ImageUpdateTrigger *ImageUpdateTrigger - - // The value that indicates whether archiving is enabled or not. - IsArchiveEnabled *bool - - // The last updated time for the run. - LastUpdatedTime *time.Time - - // The list of all images that were generated from the run. This is applicable if the run generates base image dependencies. - OutputImages []*ImageDescriptor - - // The platform properties against which the run will happen. - Platform *PlatformProperties - - // The provisioning state of a run. - ProvisioningState *ProvisioningState - - // The unique identifier for the run. - RunID *string - - // The type of run. - RunType *RunType - - // The scope of the credentials that were used to login to the source registry during this run. - SourceRegistryAuth *string - - // The source trigger that caused the run. - SourceTrigger *SourceTriggerDescriptor - - // The time the run started. - StartTime *time.Time - - // The current status of the run. - Status *RunStatus - - // The task against which run was scheduled. - Task *string - - // The timer trigger that caused the run. - TimerTrigger *TimerTriggerDescriptor - - // The update trigger token passed for the Run. - UpdateTriggerToken *string - - // READ-ONLY; The image description for the log artifact. - LogArtifact *ImageDescriptor - - // READ-ONLY; The error message received from backend systems after the run is scheduled. - RunErrorMessage *string -} - -// RunRequest - The request parameters for scheduling a run. -type RunRequest struct { - // REQUIRED; The type of the run request. - Type *string - - // The dedicated agent pool for the run. - AgentPoolName *string - - // The value that indicates whether archiving is enabled for the run or not. - IsArchiveEnabled *bool - - // The template that describes the repository and tag information for run log artifact. - LogTemplate *string -} - -// GetRunRequest implements the RunRequestClassification interface for type RunRequest. -func (r *RunRequest) GetRunRequest() *RunRequest { return r } - -// RunUpdateParameters - The set of run properties that can be updated. -type RunUpdateParameters struct { - // The value that indicates whether archiving is enabled or not. - IsArchiveEnabled *bool -} - // SKU - The SKU of a container registry. type SKU struct { // REQUIRED; The SKU name of the container registry. Required for registry creation. @@ -1849,10 +1063,10 @@ type ScopeMap struct { // The properties of the scope map. Properties *ScopeMapProperties - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string - // READ-ONLY; The name of the resource + // READ-ONLY; The name of the private link resource. Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -1874,7 +1088,9 @@ type ScopeMapListResult struct { // ScopeMapProperties - The properties of a scope map. type ScopeMapProperties struct { - // REQUIRED; The list of scoped permissions for registry artifacts. E.g. repositories/repository-name/content/read, repositories/repository-name/metadata/write + // REQUIRED; The list of scoped permissions for registry artifacts. + // E.g. repositories/repository-name/content/read, + // repositories/repository-name/metadata/write Actions []*string // The user friendly description of the scope map. @@ -1892,7 +1108,9 @@ type ScopeMapProperties struct { // ScopeMapPropertiesUpdateParameters - The update parameters for scope map properties. type ScopeMapPropertiesUpdateParameters struct { - // The list of scope permissions for registry artifacts. E.g. repositories/repository-name/pull, repositories/repository-name/delete + // The list of scope permissions for registry artifacts. + // E.g. repositories/repository-name/pull, + // repositories/repository-name/delete Actions []*string // The user friendly description of the scope map. @@ -1905,28 +1123,6 @@ type ScopeMapUpdateParameters struct { Properties *ScopeMapPropertiesUpdateParameters } -// SecretObject - Describes the properties of a secret object value. -type SecretObject struct { - // The type of the secret object which determines how the value of the secret object has to be interpreted. - Type *SecretObjectType - - // The value of the secret. The format of this value will be determined based on the type of the secret object. If the type - // is Opaque, the value will be used as is without any modification. - Value *string -} - -// SetValue - The properties of a overridable value that can be passed to a task template. -type SetValue struct { - // REQUIRED; The name of the overridable value. - Name *string - - // REQUIRED; The overridable value. - Value *string - - // Flag to indicate whether the value represents a secret or not. - IsSecret *bool -} - // Source - The registry node that generated the event. Put differently, while the actor initiates the event, the source generates // it. type Source struct { @@ -1938,111 +1134,6 @@ type Source struct { InstanceID *string } -// SourceProperties - The properties of the source code repository. -type SourceProperties struct { - // REQUIRED; The full URL to the source code repository - RepositoryURL *string - - // REQUIRED; The type of source control service. - SourceControlType *SourceControlType - - // The branch name of the source code. - Branch *string - - // The authorization properties for accessing the source code repository and to set up webhooks for notifications. - SourceControlAuthProperties *AuthInfo -} - -// SourceRegistryCredentials - Describes the credential parameters for accessing the source registry. -type SourceRegistryCredentials struct { - // The Entra identity used for source registry login. The value is [system] for system-assigned managed identity, [caller] - // for caller identity, and client ID for user-assigned managed identity. - Identity *string - - // The authentication mode which determines the source registry login scope. The credentials for the source registry will - // be generated using the given scope. These credentials will be used to login to - // the source registry during the run. - LoginMode *SourceRegistryLoginMode -} - -// SourceTrigger - The properties of a source based trigger. -type SourceTrigger struct { - // REQUIRED; The name of the trigger. - Name *string - - // REQUIRED; The properties that describes the source(code) for the task. - SourceRepository *SourceProperties - - // REQUIRED; The source event corresponding to the trigger. - SourceTriggerEvents []*SourceTriggerEvent - - // The current status of trigger. - Status *TriggerStatus -} - -// SourceTriggerDescriptor - The source trigger that caused a run. -type SourceTriggerDescriptor struct { - // The branch name in the repository. - BranchName *string - - // The unique ID that identifies a commit. - CommitID *string - - // The event type of the trigger. - EventType *string - - // The unique ID of the trigger. - ID *string - - // The source control provider type. - ProviderType *string - - // The unique ID that identifies pull request. - PullRequestID *string - - // The repository URL. - RepositoryURL *string -} - -// SourceTriggerUpdateParameters - The properties for updating a source based trigger. -type SourceTriggerUpdateParameters struct { - // REQUIRED; The name of the trigger. - Name *string - - // The properties that describes the source(code) for the task. - SourceRepository *SourceUpdateParameters - - // The source event corresponding to the trigger. - SourceTriggerEvents []*SourceTriggerEvent - - // The current status of trigger. - Status *TriggerStatus -} - -// SourceUpdateParameters - The properties for updating the source code repository. -type SourceUpdateParameters struct { - // The branch name of the source code. - Branch *string - - // The full URL to the source code repository - RepositoryURL *string - - // The authorization properties for accessing the source code repository and to set up webhooks for notifications. - SourceControlAuthProperties *AuthInfoUpdateParameters - - // The type of source control service. - SourceControlType *SourceControlType -} - -// SourceUploadDefinition - The properties of a response to source upload request. -type SourceUploadDefinition struct { - // The relative path to the source. This is used to submit the subsequent queue build request. - RelativePath *string - - // The URL where the client can upload the source. - UploadURL *string -} - // Status - The status of an Azure resource at the time the operation was called. type Status struct { // READ-ONLY; The short label for the status. @@ -2179,302 +1270,15 @@ type Target struct { Version *string } -// Task - The task that has the ARM resource and task properties. The task will have all information to schedule a run against -// it. -type Task struct { - // REQUIRED; The geo-location where the resource lives - Location *string - - // Identity for the resource. - Identity *IdentityProperties - - // The properties of a task. - Properties *TaskProperties - - // Resource tags. - Tags map[string]*string - - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - -// TaskListResult - The collection of tasks. -type TaskListResult struct { - // The URI that can be used to request the next set of paged results. - NextLink *string - - // The collection value. - Value []*Task -} - -// TaskProperties - The properties of a task. -type TaskProperties struct { - // The machine configuration of the run agent. - AgentConfiguration *AgentProperties - - // The dedicated agent pool for the task. - AgentPoolName *string - - // The properties that describes a set of credentials that will be used when this run is invoked. - Credentials *Credentials - - // The value of this property indicates whether the task resource is system task or not. - IsSystemTask *bool - - // The template that describes the repository and tag information for run log artifact. - LogTemplate *string - - // The platform properties against which the run has to happen. - Platform *PlatformProperties - - // The current status of task. - Status *TaskStatus - - // The properties of a task step. - Step TaskStepPropertiesClassification - - // Run timeout in seconds. - Timeout *int32 - - // The properties that describe all triggers for the task. - Trigger *TriggerProperties - - // READ-ONLY; The creation date of task. - CreationDate *time.Time - - // READ-ONLY; The provisioning state of the task. - ProvisioningState *ProvisioningState -} - -// TaskPropertiesUpdateParameters - The properties for updating a task. -type TaskPropertiesUpdateParameters struct { - // The machine configuration of the run agent. - AgentConfiguration *AgentProperties - - // The dedicated agent pool for the task. - AgentPoolName *string - - // The parameters that describes a set of credentials that will be used when this run is invoked. - Credentials *Credentials - - // The template that describes the repository and tag information for run log artifact. - LogTemplate *string - - // The platform properties against which the run has to happen. - Platform *PlatformUpdateParameters - - // The current status of task. - Status *TaskStatus - - // The properties for updating a task step. - Step TaskStepUpdateParametersClassification - - // Run timeout in seconds. - Timeout *int32 - - // The properties for updating trigger properties. - Trigger *TriggerUpdateParameters -} - -// TaskRun - The task run that has the ARM resource and properties. The task run will have the information of request and -// result of a run. -type TaskRun struct { - // Identity for the resource. - Identity *IdentityProperties - - // The location of the resource - Location *string - - // The properties associated with the task run, i.e., request and result of the run - Properties *TaskRunProperties - - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - -// TaskRunListResult - The collection of task runs. -type TaskRunListResult struct { - // The URI that can be used to request the next set of paged results. - NextLink *string - - // The collection value. - Value []*TaskRun -} - -// TaskRunProperties - The properties of task run. -type TaskRunProperties struct { - // How the run should be forced to rerun even if the run request configuration has not changed - ForceUpdateTag *string - - // The request (parameters) for the run - RunRequest RunRequestClassification - - // READ-ONLY; The provisioning state of this task run - ProvisioningState *ProvisioningState - - // READ-ONLY; The result of this task run - RunResult *Run -} - -// TaskRunPropertiesUpdateParameters - The properties of a task run update parameters. -type TaskRunPropertiesUpdateParameters struct { - // How the run should be forced to rerun even if the run request configuration has not changed - ForceUpdateTag *string - - // The request (parameters) for the new run - RunRequest RunRequestClassification -} - -// TaskRunRequest - The parameters for a task run request. -type TaskRunRequest struct { - // REQUIRED; The resource ID of task against which run has to be queued. - TaskID *string - - // REQUIRED; The type of the run request. - Type *string - - // The dedicated agent pool for the run. - AgentPoolName *string - - // The value that indicates whether archiving is enabled for the run or not. - IsArchiveEnabled *bool - - // The template that describes the repository and tag information for run log artifact. - LogTemplate *string - - // Set of overridable parameters that can be passed when running a Task. - OverrideTaskStepProperties *OverrideTaskStepProperties -} - -// GetRunRequest implements the RunRequestClassification interface for type TaskRunRequest. -func (t *TaskRunRequest) GetRunRequest() *RunRequest { - return &RunRequest{ - AgentPoolName: t.AgentPoolName, - IsArchiveEnabled: t.IsArchiveEnabled, - LogTemplate: t.LogTemplate, - Type: t.Type, - } -} - -// TaskRunUpdateParameters - The parameters for updating a task run. -type TaskRunUpdateParameters struct { - // Identity for the resource. - Identity *IdentityProperties - - // The location of the resource - Location *string - - // The properties for updating a task run. - Properties *TaskRunPropertiesUpdateParameters - - // The ARM resource tags. - Tags map[string]*string -} - -// TaskStepProperties - Base properties for any task step. -type TaskStepProperties struct { - // REQUIRED; The type of the step. - Type *StepType - - // The token (git PAT or SAS token of storage account blob) associated with the context for a step. - ContextAccessToken *string - - // The URL(absolute or relative) of the source context for the task step. - ContextPath *string - - // READ-ONLY; List of base image dependencies for a step. - BaseImageDependencies []*BaseImageDependency -} - -// GetTaskStepProperties implements the TaskStepPropertiesClassification interface for type TaskStepProperties. -func (t *TaskStepProperties) GetTaskStepProperties() *TaskStepProperties { return t } - -// TaskStepUpdateParameters - Base properties for updating any task step. -type TaskStepUpdateParameters struct { - // REQUIRED; The type of the step. - Type *StepType - - // The token (git PAT or SAS token of storage account blob) associated with the context for a step. - ContextAccessToken *string - - // The URL(absolute or relative) of the source context for the task step. - ContextPath *string -} - -// GetTaskStepUpdateParameters implements the TaskStepUpdateParametersClassification interface for type TaskStepUpdateParameters. -func (t *TaskStepUpdateParameters) GetTaskStepUpdateParameters() *TaskStepUpdateParameters { return t } - -// TaskUpdateParameters - The parameters for updating a task. -type TaskUpdateParameters struct { - // Identity for the resource. - Identity *IdentityProperties - - // The properties for updating a task. - Properties *TaskPropertiesUpdateParameters - - // The ARM resource tags. - Tags map[string]*string -} - -// TimerTrigger - The properties of a timer trigger. -type TimerTrigger struct { - // REQUIRED; The name of the trigger. - Name *string - - // REQUIRED; The CRON expression for the task schedule - Schedule *string - - // The current status of trigger. - Status *TriggerStatus -} - -type TimerTriggerDescriptor struct { - // The occurrence that triggered the run. - ScheduleOccurrence *string - - // The timer trigger name that caused the run. - TimerTriggerName *string -} - -// TimerTriggerUpdateParameters - The properties for updating a timer trigger. -type TimerTriggerUpdateParameters struct { - // REQUIRED; The name of the trigger. - Name *string - - // The CRON expression for the task schedule - Schedule *string - - // The current status of trigger. - Status *TriggerStatus -} - // Token - An object that represents a token for a container registry. type Token struct { // The properties of the token. Properties *TokenProperties - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string - // READ-ONLY; The name of the resource + // READ-ONLY; The name of the private link resource. Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -2563,30 +1367,6 @@ type TokenUpdateProperties struct { Status *TokenStatus } -// TriggerProperties - The properties of a trigger. -type TriggerProperties struct { - // The trigger based on base image dependencies. - BaseImageTrigger *BaseImageTrigger - - // The collection of triggers based on source code repository. - SourceTriggers []*SourceTrigger - - // The collection of timer triggers. - TimerTriggers []*TimerTrigger -} - -// TriggerUpdateParameters - The properties for updating triggers. -type TriggerUpdateParameters struct { - // The trigger based on base image dependencies. - BaseImageTrigger *BaseImageTriggerUpdateParameters - - // The collection of triggers based on source code repository. - SourceTriggers []*SourceTriggerUpdateParameters - - // The collection of timer triggers. - TimerTriggers []*TimerTriggerUpdateParameters -} - // TrustPolicy - The content trust policy for a container registry. type TrustPolicy struct { // The value that indicates whether the policy is enabled or not. @@ -2615,10 +1395,10 @@ type Webhook struct { // Resource tags. Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string - // READ-ONLY; The name of the resource + // READ-ONLY; The name of the private link resource. Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -2656,8 +1436,7 @@ type WebhookProperties struct { Actions []*WebhookAction // The scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository - // 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to - // 'foo:latest'. Empty means all events. + // 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events. Scope *string // The status of the webhook at the time the operation was called. @@ -2679,8 +1458,7 @@ type WebhookPropertiesCreateParameters struct { CustomHeaders map[string]*string // The scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository - // 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to - // 'foo:latest'. Empty means all events. + // 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events. Scope *string // The status of the webhook at the time the operation was called. @@ -2696,8 +1474,7 @@ type WebhookPropertiesUpdateParameters struct { CustomHeaders map[string]*string // The scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository - // 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to - // 'foo:latest'. Empty means all events. + // 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events. Scope *string // The service URI for the webhook to post notifications. diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/models_serde.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/models_serde.go index 26ef343928d0..9fc21ec8eba6 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/models_serde.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/models_serde.go @@ -1,7 +1,6 @@ // 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armcontainerregistry @@ -9,7 +8,9 @@ import ( "encoding/json" "fmt" "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/datetime" "reflect" + "time" ) // MarshalJSON implements the json.Marshaller interface for type ActivationProperties. @@ -66,21 +67,18 @@ func (a *Actor) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AgentPool. -func (a AgentPool) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AuthCredential. +func (a AuthCredential) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", a.ID) - populate(objectMap, "location", a.Location) + populate(objectMap, "credentialHealth", a.CredentialHealth) populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "systemData", a.SystemData) - populate(objectMap, "tags", a.Tags) - populate(objectMap, "type", a.Type) + populate(objectMap, "passwordSecretIdentifier", a.PasswordSecretIdentifier) + populate(objectMap, "usernameSecretIdentifier", a.UsernameSecretIdentifier) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AgentPool. -func (a *AgentPool) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthCredential. +func (a *AuthCredential) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -88,26 +86,17 @@ func (a *AgentPool) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &a.Location) + case "credentialHealth": + err = unpopulate(val, "CredentialHealth", &a.CredentialHealth) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &a.Name) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &a.SystemData) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &a.Tags) + case "passwordSecretIdentifier": + err = unpopulate(val, "PasswordSecretIdentifier", &a.PasswordSecretIdentifier) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) + case "usernameSecretIdentifier": + err = unpopulate(val, "UsernameSecretIdentifier", &a.UsernameSecretIdentifier) delete(rawMsg, key) } if err != nil { @@ -117,16 +106,15 @@ func (a *AgentPool) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AgentPoolListResult. -func (a AgentPoolListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureADAuthenticationAsArmPolicy. +func (a AzureADAuthenticationAsArmPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", a.NextLink) - populate(objectMap, "value", a.Value) + populate(objectMap, "status", a.Status) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AgentPoolListResult. -func (a *AgentPoolListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureADAuthenticationAsArmPolicy. +func (a *AzureADAuthenticationAsArmPolicy) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -134,11 +122,8 @@ func (a *AgentPoolListResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &a.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &a.Value) + case "status": + err = unpopulate(val, "Status", &a.Status) delete(rawMsg, key) } if err != nil { @@ -148,490 +133,519 @@ func (a *AgentPoolListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AgentPoolProperties. -func (a AgentPoolProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CacheRule. +func (c CacheRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "count", a.Count) - populate(objectMap, "os", a.OS) - populate(objectMap, "provisioningState", a.ProvisioningState) - populate(objectMap, "tier", a.Tier) - populate(objectMap, "virtualNetworkSubnetResourceId", a.VirtualNetworkSubnetResourceID) + populate(objectMap, "id", c.ID) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "systemData", c.SystemData) + populate(objectMap, "type", c.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AgentPoolProperties. -func (a *AgentPoolProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CacheRule. +func (c *CacheRule) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "count": - err = unpopulate(val, "Count", &a.Count) + case "id": + err = unpopulate(val, "ID", &c.ID) delete(rawMsg, key) - case "os": - err = unpopulate(val, "OS", &a.OS) + case "name": + err = unpopulate(val, "Name", &c.Name) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) delete(rawMsg, key) - case "tier": - err = unpopulate(val, "Tier", &a.Tier) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) delete(rawMsg, key) - case "virtualNetworkSubnetResourceId": - err = unpopulate(val, "VirtualNetworkSubnetResourceID", &a.VirtualNetworkSubnetResourceID) + case "type": + err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type AgentPoolPropertiesUpdateParameters. -func (a AgentPoolPropertiesUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CacheRuleProperties. +func (c CacheRuleProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "count", a.Count) + populateTime[datetime.RFC3339](objectMap, "creationDate", c.CreationDate) + populate(objectMap, "credentialSetResourceId", c.CredentialSetResourceID) + populate(objectMap, "provisioningState", c.ProvisioningState) + populate(objectMap, "sourceRepository", c.SourceRepository) + populate(objectMap, "targetRepository", c.TargetRepository) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AgentPoolPropertiesUpdateParameters. -func (a *AgentPoolPropertiesUpdateParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CacheRuleProperties. +func (c *CacheRuleProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "count": - err = unpopulate(val, "Count", &a.Count) + case "creationDate": + err = unpopulateTime[datetime.RFC3339](val, "CreationDate", &c.CreationDate) + delete(rawMsg, key) + case "credentialSetResourceId": + err = unpopulate(val, "CredentialSetResourceID", &c.CredentialSetResourceID) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + delete(rawMsg, key) + case "sourceRepository": + err = unpopulate(val, "SourceRepository", &c.SourceRepository) + delete(rawMsg, key) + case "targetRepository": + err = unpopulate(val, "TargetRepository", &c.TargetRepository) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type AgentPoolQueueStatus. -func (a AgentPoolQueueStatus) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CacheRuleUpdateParameters. +func (c CacheRuleUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "count", a.Count) + populate(objectMap, "properties", c.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AgentPoolQueueStatus. -func (a *AgentPoolQueueStatus) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CacheRuleUpdateParameters. +func (c *CacheRuleUpdateParameters) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "count": - err = unpopulate(val, "Count", &a.Count) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type AgentPoolUpdateParameters. -func (a AgentPoolUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CacheRuleUpdateProperties. +func (c CacheRuleUpdateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "tags", a.Tags) + populate(objectMap, "credentialSetResourceId", c.CredentialSetResourceID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AgentPoolUpdateParameters. -func (a *AgentPoolUpdateParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CacheRuleUpdateProperties. +func (c *CacheRuleUpdateProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &a.Tags) + case "credentialSetResourceId": + err = unpopulate(val, "CredentialSetResourceID", &c.CredentialSetResourceID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type AgentProperties. -func (a AgentProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CacheRulesListResult. +func (c CacheRulesListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "cpu", a.CPU) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AgentProperties. -func (a *AgentProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CacheRulesListResult. +func (c *CacheRulesListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "cpu": - err = unpopulate(val, "CPU", &a.CPU) + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Argument. -func (a Argument) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CallbackConfig. +func (c CallbackConfig) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "isSecret", a.IsSecret) - populate(objectMap, "name", a.Name) - populate(objectMap, "value", a.Value) + populate(objectMap, "customHeaders", c.CustomHeaders) + populate(objectMap, "serviceUri", c.ServiceURI) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Argument. -func (a *Argument) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CallbackConfig. +func (c *CallbackConfig) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "isSecret": - err = unpopulate(val, "IsSecret", &a.IsSecret) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) + case "customHeaders": + err = unpopulate(val, "CustomHeaders", &c.CustomHeaders) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &a.Value) + case "serviceUri": + err = unpopulate(val, "ServiceURI", &c.ServiceURI) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type AuthCredential. -func (a AuthCredential) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ConnectedRegistry. +func (c ConnectedRegistry) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "credentialHealth", a.CredentialHealth) - populate(objectMap, "name", a.Name) - populate(objectMap, "passwordSecretIdentifier", a.PasswordSecretIdentifier) - populate(objectMap, "usernameSecretIdentifier", a.UsernameSecretIdentifier) + populate(objectMap, "id", c.ID) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "systemData", c.SystemData) + populate(objectMap, "type", c.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AuthCredential. -func (a *AuthCredential) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectedRegistry. +func (c *ConnectedRegistry) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "credentialHealth": - err = unpopulate(val, "CredentialHealth", &a.CredentialHealth) + case "id": + err = unpopulate(val, "ID", &c.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &a.Name) + err = unpopulate(val, "Name", &c.Name) delete(rawMsg, key) - case "passwordSecretIdentifier": - err = unpopulate(val, "PasswordSecretIdentifier", &a.PasswordSecretIdentifier) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) delete(rawMsg, key) - case "usernameSecretIdentifier": - err = unpopulate(val, "UsernameSecretIdentifier", &a.UsernameSecretIdentifier) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type AuthInfo. -func (a AuthInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ConnectedRegistryListResult. +func (c ConnectedRegistryListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "expiresIn", a.ExpiresIn) - populate(objectMap, "refreshToken", a.RefreshToken) - populate(objectMap, "scope", a.Scope) - populate(objectMap, "token", a.Token) - populate(objectMap, "tokenType", a.TokenType) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AuthInfo. -func (a *AuthInfo) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectedRegistryListResult. +func (c *ConnectedRegistryListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "expiresIn": - err = unpopulate(val, "ExpiresIn", &a.ExpiresIn) - delete(rawMsg, key) - case "refreshToken": - err = unpopulate(val, "RefreshToken", &a.RefreshToken) - delete(rawMsg, key) - case "scope": - err = unpopulate(val, "Scope", &a.Scope) - delete(rawMsg, key) - case "token": - err = unpopulate(val, "Token", &a.Token) + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) delete(rawMsg, key) - case "tokenType": - err = unpopulate(val, "TokenType", &a.TokenType) + case "value": + err = unpopulate(val, "Value", &c.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type AuthInfoUpdateParameters. -func (a AuthInfoUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ConnectedRegistryProperties. +func (c ConnectedRegistryProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "expiresIn", a.ExpiresIn) - populate(objectMap, "refreshToken", a.RefreshToken) - populate(objectMap, "scope", a.Scope) - populate(objectMap, "token", a.Token) - populate(objectMap, "tokenType", a.TokenType) + populate(objectMap, "activation", c.Activation) + populate(objectMap, "clientTokenIds", c.ClientTokenIDs) + populate(objectMap, "connectionState", c.ConnectionState) + populate(objectMap, "garbageCollection", c.GarbageCollection) + populateTime[datetime.RFC3339](objectMap, "lastActivityTime", c.LastActivityTime) + populate(objectMap, "logging", c.Logging) + populate(objectMap, "loginServer", c.LoginServer) + populate(objectMap, "mode", c.Mode) + populate(objectMap, "notificationsList", c.NotificationsList) + populate(objectMap, "parent", c.Parent) + populate(objectMap, "provisioningState", c.ProvisioningState) + populate(objectMap, "statusDetails", c.StatusDetails) + populate(objectMap, "version", c.Version) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AuthInfoUpdateParameters. -func (a *AuthInfoUpdateParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectedRegistryProperties. +func (c *ConnectedRegistryProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "expiresIn": - err = unpopulate(val, "ExpiresIn", &a.ExpiresIn) + case "activation": + err = unpopulate(val, "Activation", &c.Activation) delete(rawMsg, key) - case "refreshToken": - err = unpopulate(val, "RefreshToken", &a.RefreshToken) + case "clientTokenIds": + err = unpopulate(val, "ClientTokenIDs", &c.ClientTokenIDs) delete(rawMsg, key) - case "scope": - err = unpopulate(val, "Scope", &a.Scope) + case "connectionState": + err = unpopulate(val, "ConnectionState", &c.ConnectionState) + delete(rawMsg, key) + case "garbageCollection": + err = unpopulate(val, "GarbageCollection", &c.GarbageCollection) + delete(rawMsg, key) + case "lastActivityTime": + err = unpopulateTime[datetime.RFC3339](val, "LastActivityTime", &c.LastActivityTime) + delete(rawMsg, key) + case "logging": + err = unpopulate(val, "Logging", &c.Logging) + delete(rawMsg, key) + case "loginServer": + err = unpopulate(val, "LoginServer", &c.LoginServer) + delete(rawMsg, key) + case "mode": + err = unpopulate(val, "Mode", &c.Mode) + delete(rawMsg, key) + case "notificationsList": + err = unpopulate(val, "NotificationsList", &c.NotificationsList) + delete(rawMsg, key) + case "parent": + err = unpopulate(val, "Parent", &c.Parent) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) delete(rawMsg, key) - case "token": - err = unpopulate(val, "Token", &a.Token) + case "statusDetails": + err = unpopulate(val, "StatusDetails", &c.StatusDetails) delete(rawMsg, key) - case "tokenType": - err = unpopulate(val, "TokenType", &a.TokenType) + case "version": + err = unpopulate(val, "Version", &c.Version) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureADAuthenticationAsArmPolicy. -func (a AzureADAuthenticationAsArmPolicy) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ConnectedRegistryUpdateParameters. +func (c ConnectedRegistryUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "status", a.Status) + populate(objectMap, "properties", c.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureADAuthenticationAsArmPolicy. -func (a *AzureADAuthenticationAsArmPolicy) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectedRegistryUpdateParameters. +func (c *ConnectedRegistryUpdateParameters) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "status": - err = unpopulate(val, "Status", &a.Status) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BaseImageDependency. -func (b BaseImageDependency) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ConnectedRegistryUpdateProperties. +func (c ConnectedRegistryUpdateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "digest", b.Digest) - populate(objectMap, "registry", b.Registry) - populate(objectMap, "repository", b.Repository) - populate(objectMap, "tag", b.Tag) - populate(objectMap, "type", b.Type) + populate(objectMap, "clientTokenIds", c.ClientTokenIDs) + populate(objectMap, "garbageCollection", c.GarbageCollection) + populate(objectMap, "logging", c.Logging) + populate(objectMap, "notificationsList", c.NotificationsList) + populate(objectMap, "syncProperties", c.SyncProperties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BaseImageDependency. -func (b *BaseImageDependency) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectedRegistryUpdateProperties. +func (c *ConnectedRegistryUpdateProperties) 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", b, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "digest": - err = unpopulate(val, "Digest", &b.Digest) + case "clientTokenIds": + err = unpopulate(val, "ClientTokenIDs", &c.ClientTokenIDs) delete(rawMsg, key) - case "registry": - err = unpopulate(val, "Registry", &b.Registry) + case "garbageCollection": + err = unpopulate(val, "GarbageCollection", &c.GarbageCollection) delete(rawMsg, key) - case "repository": - err = unpopulate(val, "Repository", &b.Repository) + case "logging": + err = unpopulate(val, "Logging", &c.Logging) delete(rawMsg, key) - case "tag": - err = unpopulate(val, "Tag", &b.Tag) + case "notificationsList": + err = unpopulate(val, "NotificationsList", &c.NotificationsList) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &b.Type) + case "syncProperties": + err = unpopulate(val, "SyncProperties", &c.SyncProperties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BaseImageTrigger. -func (b BaseImageTrigger) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CredentialHealth. +func (c CredentialHealth) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "baseImageTriggerType", b.BaseImageTriggerType) - populate(objectMap, "name", b.Name) - populate(objectMap, "status", b.Status) - populate(objectMap, "updateTriggerEndpoint", b.UpdateTriggerEndpoint) - populate(objectMap, "updateTriggerPayloadType", b.UpdateTriggerPayloadType) + populate(objectMap, "errorCode", c.ErrorCode) + populate(objectMap, "errorMessage", c.ErrorMessage) + populate(objectMap, "status", c.Status) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BaseImageTrigger. -func (b *BaseImageTrigger) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CredentialHealth. +func (c *CredentialHealth) 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", b, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "baseImageTriggerType": - err = unpopulate(val, "BaseImageTriggerType", &b.BaseImageTriggerType) + case "errorCode": + err = unpopulate(val, "ErrorCode", &c.ErrorCode) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &b.Name) + case "errorMessage": + err = unpopulate(val, "ErrorMessage", &c.ErrorMessage) delete(rawMsg, key) case "status": - err = unpopulate(val, "Status", &b.Status) - delete(rawMsg, key) - case "updateTriggerEndpoint": - err = unpopulate(val, "UpdateTriggerEndpoint", &b.UpdateTriggerEndpoint) - delete(rawMsg, key) - case "updateTriggerPayloadType": - err = unpopulate(val, "UpdateTriggerPayloadType", &b.UpdateTriggerPayloadType) + err = unpopulate(val, "Status", &c.Status) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BaseImageTriggerUpdateParameters. -func (b BaseImageTriggerUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CredentialSet. +func (c CredentialSet) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "baseImageTriggerType", b.BaseImageTriggerType) - populate(objectMap, "name", b.Name) - populate(objectMap, "status", b.Status) - populate(objectMap, "updateTriggerEndpoint", b.UpdateTriggerEndpoint) - populate(objectMap, "updateTriggerPayloadType", b.UpdateTriggerPayloadType) + populate(objectMap, "id", c.ID) + populate(objectMap, "identity", c.Identity) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "systemData", c.SystemData) + populate(objectMap, "type", c.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BaseImageTriggerUpdateParameters. -func (b *BaseImageTriggerUpdateParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CredentialSet. +func (c *CredentialSet) 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", b, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "baseImageTriggerType": - err = unpopulate(val, "BaseImageTriggerType", &b.BaseImageTriggerType) + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &c.Identity) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &b.Name) + err = unpopulate(val, "Name", &c.Name) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &b.Status) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) delete(rawMsg, key) - case "updateTriggerEndpoint": - err = unpopulate(val, "UpdateTriggerEndpoint", &b.UpdateTriggerEndpoint) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) delete(rawMsg, key) - case "updateTriggerPayloadType": - err = unpopulate(val, "UpdateTriggerPayloadType", &b.UpdateTriggerPayloadType) + case "type": + err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CacheRule. -func (c CacheRule) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CredentialSetListResult. +func (c CredentialSetListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", c.ID) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "systemData", c.SystemData) - populate(objectMap, "type", c.Type) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CacheRule. -func (c *CacheRule) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CredentialSetListResult. +func (c *CredentialSetListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -639,20 +653,11 @@ func (c *CacheRule) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &c.SystemData) + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) + case "value": + err = unpopulate(val, "Value", &c.Value) delete(rawMsg, key) } if err != nil { @@ -662,19 +667,18 @@ func (c *CacheRule) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CacheRuleProperties. -func (c CacheRuleProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CredentialSetProperties. +func (c CredentialSetProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "creationDate", c.CreationDate) - populate(objectMap, "credentialSetResourceId", c.CredentialSetResourceID) + populate(objectMap, "authCredentials", c.AuthCredentials) + populateTime[datetime.RFC3339](objectMap, "creationDate", c.CreationDate) + populate(objectMap, "loginServer", c.LoginServer) populate(objectMap, "provisioningState", c.ProvisioningState) - populate(objectMap, "sourceRepository", c.SourceRepository) - populate(objectMap, "targetRepository", c.TargetRepository) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CacheRuleProperties. -func (c *CacheRuleProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CredentialSetProperties. +func (c *CredentialSetProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -682,21 +686,18 @@ func (c *CacheRuleProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "authCredentials": + err = unpopulate(val, "AuthCredentials", &c.AuthCredentials) + delete(rawMsg, key) case "creationDate": - err = unpopulateDateTimeRFC3339(val, "CreationDate", &c.CreationDate) + err = unpopulateTime[datetime.RFC3339](val, "CreationDate", &c.CreationDate) delete(rawMsg, key) - case "credentialSetResourceId": - err = unpopulate(val, "CredentialSetResourceID", &c.CredentialSetResourceID) + case "loginServer": + err = unpopulate(val, "LoginServer", &c.LoginServer) delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) delete(rawMsg, key) - case "sourceRepository": - err = unpopulate(val, "SourceRepository", &c.SourceRepository) - delete(rawMsg, key) - case "targetRepository": - err = unpopulate(val, "TargetRepository", &c.TargetRepository) - delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -705,15 +706,16 @@ func (c *CacheRuleProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CacheRuleUpdateParameters. -func (c CacheRuleUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CredentialSetUpdateParameters. +func (c CredentialSetUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "identity", c.Identity) populate(objectMap, "properties", c.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CacheRuleUpdateParameters. -func (c *CacheRuleUpdateParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CredentialSetUpdateParameters. +func (c *CredentialSetUpdateParameters) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -721,6 +723,9 @@ func (c *CacheRuleUpdateParameters) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "identity": + err = unpopulate(val, "Identity", &c.Identity) + delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &c.Properties) delete(rawMsg, key) @@ -732,15 +737,15 @@ func (c *CacheRuleUpdateParameters) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CacheRuleUpdateProperties. -func (c CacheRuleUpdateProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CredentialSetUpdateProperties. +func (c CredentialSetUpdateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "credentialSetResourceId", c.CredentialSetResourceID) + populate(objectMap, "authCredentials", c.AuthCredentials) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CacheRuleUpdateProperties. -func (c *CacheRuleUpdateProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CredentialSetUpdateProperties. +func (c *CredentialSetUpdateProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -748,8 +753,8 @@ func (c *CacheRuleUpdateProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "credentialSetResourceId": - err = unpopulate(val, "CredentialSetResourceID", &c.CredentialSetResourceID) + case "authCredentials": + err = unpopulate(val, "AuthCredentials", &c.AuthCredentials) delete(rawMsg, key) } if err != nil { @@ -759,5164 +764,2555 @@ func (c *CacheRuleUpdateProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CacheRulesListResult. -func (c CacheRulesListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type EncryptionProperty. +func (e EncryptionProperty) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) + populate(objectMap, "keyVaultProperties", e.KeyVaultProperties) + populate(objectMap, "status", e.Status) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CacheRulesListResult. -func (c *CacheRulesListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionProperty. +func (e *EncryptionProperty) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) + case "keyVaultProperties": + err = unpopulate(val, "KeyVaultProperties", &e.KeyVaultProperties) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) + case "status": + err = unpopulate(val, "Status", &e.Status) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CallbackConfig. -func (c CallbackConfig) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Event. +func (e Event) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "customHeaders", c.CustomHeaders) - populate(objectMap, "serviceUri", c.ServiceURI) + populate(objectMap, "eventRequestMessage", e.EventRequestMessage) + populate(objectMap, "eventResponseMessage", e.EventResponseMessage) + populate(objectMap, "id", e.ID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CallbackConfig. -func (c *CallbackConfig) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Event. +func (e *Event) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "customHeaders": - err = unpopulate(val, "CustomHeaders", &c.CustomHeaders) + case "eventRequestMessage": + err = unpopulate(val, "EventRequestMessage", &e.EventRequestMessage) delete(rawMsg, key) - case "serviceUri": - err = unpopulate(val, "ServiceURI", &c.ServiceURI) + case "eventResponseMessage": + err = unpopulate(val, "EventResponseMessage", &e.EventResponseMessage) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &e.ID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ConnectedRegistry. -func (c ConnectedRegistry) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type EventContent. +func (e EventContent) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", c.ID) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "systemData", c.SystemData) - populate(objectMap, "type", c.Type) + populate(objectMap, "action", e.Action) + populate(objectMap, "actor", e.Actor) + populate(objectMap, "id", e.ID) + populate(objectMap, "request", e.Request) + populate(objectMap, "source", e.Source) + populate(objectMap, "target", e.Target) + populateTime[datetime.RFC3339](objectMap, "timestamp", e.Timestamp) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectedRegistry. -func (c *ConnectedRegistry) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type EventContent. +func (e *EventContent) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) + case "action": + err = unpopulate(val, "Action", &e.Action) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) + case "actor": + err = unpopulate(val, "Actor", &e.Actor) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &c.SystemData) + case "id": + err = unpopulate(val, "ID", &e.ID) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) + case "request": + err = unpopulate(val, "Request", &e.Request) + delete(rawMsg, key) + case "source": + err = unpopulate(val, "Source", &e.Source) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &e.Target) + delete(rawMsg, key) + case "timestamp": + err = unpopulateTime[datetime.RFC3339](val, "Timestamp", &e.Timestamp) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ConnectedRegistryListResult. -func (c ConnectedRegistryListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type EventInfo. +func (e EventInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) + populate(objectMap, "id", e.ID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectedRegistryListResult. -func (c *ConnectedRegistryListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type EventInfo. +func (e *EventInfo) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) + case "id": + err = unpopulate(val, "ID", &e.ID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ConnectedRegistryProperties. -func (c ConnectedRegistryProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type EventListResult. +func (e EventListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "activation", c.Activation) - populate(objectMap, "clientTokenIds", c.ClientTokenIDs) - populate(objectMap, "connectionState", c.ConnectionState) - populate(objectMap, "garbageCollection", c.GarbageCollection) - populateDateTimeRFC3339(objectMap, "lastActivityTime", c.LastActivityTime) - populate(objectMap, "logging", c.Logging) - populate(objectMap, "loginServer", c.LoginServer) - populate(objectMap, "mode", c.Mode) - populate(objectMap, "notificationsList", c.NotificationsList) - populate(objectMap, "parent", c.Parent) - populate(objectMap, "provisioningState", c.ProvisioningState) - populate(objectMap, "statusDetails", c.StatusDetails) - populate(objectMap, "version", c.Version) + populate(objectMap, "nextLink", e.NextLink) + populate(objectMap, "value", e.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectedRegistryProperties. -func (c *ConnectedRegistryProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type EventListResult. +func (e *EventListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "activation": - err = unpopulate(val, "Activation", &c.Activation) - delete(rawMsg, key) - case "clientTokenIds": - err = unpopulate(val, "ClientTokenIDs", &c.ClientTokenIDs) - delete(rawMsg, key) - case "connectionState": - err = unpopulate(val, "ConnectionState", &c.ConnectionState) - delete(rawMsg, key) - case "garbageCollection": - err = unpopulate(val, "GarbageCollection", &c.GarbageCollection) - delete(rawMsg, key) - case "lastActivityTime": - err = unpopulateDateTimeRFC3339(val, "LastActivityTime", &c.LastActivityTime) - delete(rawMsg, key) - case "logging": - err = unpopulate(val, "Logging", &c.Logging) - delete(rawMsg, key) - case "loginServer": - err = unpopulate(val, "LoginServer", &c.LoginServer) - delete(rawMsg, key) - case "mode": - err = unpopulate(val, "Mode", &c.Mode) - delete(rawMsg, key) - case "notificationsList": - err = unpopulate(val, "NotificationsList", &c.NotificationsList) - delete(rawMsg, key) - case "parent": - err = unpopulate(val, "Parent", &c.Parent) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) - delete(rawMsg, key) - case "statusDetails": - err = unpopulate(val, "StatusDetails", &c.StatusDetails) + case "nextLink": + err = unpopulate(val, "NextLink", &e.NextLink) delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &c.Version) + case "value": + err = unpopulate(val, "Value", &e.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ConnectedRegistryUpdateParameters. -func (c ConnectedRegistryUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type EventRequestMessage. +func (e EventRequestMessage) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", c.Properties) + populate(objectMap, "content", e.Content) + populate(objectMap, "headers", e.Headers) + populate(objectMap, "method", e.Method) + populate(objectMap, "requestUri", e.RequestURI) + populate(objectMap, "version", e.Version) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectedRegistryUpdateParameters. -func (c *ConnectedRegistryUpdateParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type EventRequestMessage. +func (e *EventRequestMessage) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &c.Properties) + case "content": + err = unpopulate(val, "Content", &e.Content) + delete(rawMsg, key) + case "headers": + err = unpopulate(val, "Headers", &e.Headers) + delete(rawMsg, key) + case "method": + err = unpopulate(val, "Method", &e.Method) + delete(rawMsg, key) + case "requestUri": + err = unpopulate(val, "RequestURI", &e.RequestURI) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &e.Version) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ConnectedRegistryUpdateProperties. -func (c ConnectedRegistryUpdateProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type EventResponseMessage. +func (e EventResponseMessage) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "clientTokenIds", c.ClientTokenIDs) - populate(objectMap, "garbageCollection", c.GarbageCollection) - populate(objectMap, "logging", c.Logging) - populate(objectMap, "notificationsList", c.NotificationsList) - populate(objectMap, "syncProperties", c.SyncProperties) + populate(objectMap, "content", e.Content) + populate(objectMap, "headers", e.Headers) + populate(objectMap, "reasonPhrase", e.ReasonPhrase) + populate(objectMap, "statusCode", e.StatusCode) + populate(objectMap, "version", e.Version) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectedRegistryUpdateProperties. -func (c *ConnectedRegistryUpdateProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type EventResponseMessage. +func (e *EventResponseMessage) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "clientTokenIds": - err = unpopulate(val, "ClientTokenIDs", &c.ClientTokenIDs) + case "content": + err = unpopulate(val, "Content", &e.Content) delete(rawMsg, key) - case "garbageCollection": - err = unpopulate(val, "GarbageCollection", &c.GarbageCollection) + case "headers": + err = unpopulate(val, "Headers", &e.Headers) delete(rawMsg, key) - case "logging": - err = unpopulate(val, "Logging", &c.Logging) + case "reasonPhrase": + err = unpopulate(val, "ReasonPhrase", &e.ReasonPhrase) delete(rawMsg, key) - case "notificationsList": - err = unpopulate(val, "NotificationsList", &c.NotificationsList) + case "statusCode": + err = unpopulate(val, "StatusCode", &e.StatusCode) delete(rawMsg, key) - case "syncProperties": - err = unpopulate(val, "SyncProperties", &c.SyncProperties) + case "version": + err = unpopulate(val, "Version", &e.Version) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CredentialHealth. -func (c CredentialHealth) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ExportPolicy. +func (e ExportPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "errorCode", c.ErrorCode) - populate(objectMap, "errorMessage", c.ErrorMessage) - populate(objectMap, "status", c.Status) + populate(objectMap, "status", e.Status) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CredentialHealth. -func (c *CredentialHealth) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ExportPolicy. +func (e *ExportPolicy) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "errorCode": - err = unpopulate(val, "ErrorCode", &c.ErrorCode) - delete(rawMsg, key) - case "errorMessage": - err = unpopulate(val, "ErrorMessage", &c.ErrorMessage) - delete(rawMsg, key) case "status": - err = unpopulate(val, "Status", &c.Status) + err = unpopulate(val, "Status", &e.Status) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CredentialSet. -func (c CredentialSet) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GarbageCollectionProperties. +func (g GarbageCollectionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", c.ID) - populate(objectMap, "identity", c.Identity) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "systemData", c.SystemData) - populate(objectMap, "type", c.Type) + populate(objectMap, "enabled", g.Enabled) + populate(objectMap, "schedule", g.Schedule) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CredentialSet. -func (c *CredentialSet) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GarbageCollectionProperties. +func (g *GarbageCollectionProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &c.Identity) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &c.SystemData) + case "enabled": + err = unpopulate(val, "Enabled", &g.Enabled) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) + case "schedule": + err = unpopulate(val, "Schedule", &g.Schedule) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CredentialSetListResult. -func (c CredentialSetListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GenerateCredentialsParameters. +func (g GenerateCredentialsParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) + populateTime[datetime.RFC3339](objectMap, "expiry", g.Expiry) + populate(objectMap, "name", g.Name) + populate(objectMap, "tokenId", g.TokenID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CredentialSetListResult. -func (c *CredentialSetListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GenerateCredentialsParameters. +func (g *GenerateCredentialsParameters) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CredentialSetProperties. -func (c CredentialSetProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "authCredentials", c.AuthCredentials) - populateDateTimeRFC3339(objectMap, "creationDate", c.CreationDate) - populate(objectMap, "loginServer", c.LoginServer) - populate(objectMap, "provisioningState", c.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CredentialSetProperties. -func (c *CredentialSetProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "authCredentials": - err = unpopulate(val, "AuthCredentials", &c.AuthCredentials) - delete(rawMsg, key) - case "creationDate": - err = unpopulateDateTimeRFC3339(val, "CreationDate", &c.CreationDate) - delete(rawMsg, key) - case "loginServer": - err = unpopulate(val, "LoginServer", &c.LoginServer) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CredentialSetUpdateParameters. -func (c CredentialSetUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "identity", c.Identity) - populate(objectMap, "properties", c.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CredentialSetUpdateParameters. -func (c *CredentialSetUpdateParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "identity": - err = unpopulate(val, "Identity", &c.Identity) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CredentialSetUpdateProperties. -func (c CredentialSetUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "authCredentials", c.AuthCredentials) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CredentialSetUpdateProperties. -func (c *CredentialSetUpdateProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "authCredentials": - err = unpopulate(val, "AuthCredentials", &c.AuthCredentials) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Credentials. -func (c Credentials) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "customRegistries", c.CustomRegistries) - populate(objectMap, "sourceRegistry", c.SourceRegistry) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Credentials. -func (c *Credentials) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "customRegistries": - err = unpopulate(val, "CustomRegistries", &c.CustomRegistries) - delete(rawMsg, key) - case "sourceRegistry": - err = unpopulate(val, "SourceRegistry", &c.SourceRegistry) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CustomRegistryCredentials. -func (c CustomRegistryCredentials) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "identity", c.Identity) - populate(objectMap, "password", c.Password) - populate(objectMap, "userName", c.UserName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CustomRegistryCredentials. -func (c *CustomRegistryCredentials) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "identity": - err = unpopulate(val, "Identity", &c.Identity) - delete(rawMsg, key) - case "password": - err = unpopulate(val, "Password", &c.Password) - delete(rawMsg, key) - case "userName": - err = unpopulate(val, "UserName", &c.UserName) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DockerBuildRequest. -func (d DockerBuildRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "agentConfiguration", d.AgentConfiguration) - populate(objectMap, "agentPoolName", d.AgentPoolName) - populate(objectMap, "arguments", d.Arguments) - populate(objectMap, "credentials", d.Credentials) - populate(objectMap, "dockerFilePath", d.DockerFilePath) - populate(objectMap, "imageNames", d.ImageNames) - populate(objectMap, "isArchiveEnabled", d.IsArchiveEnabled) - populate(objectMap, "isPushEnabled", d.IsPushEnabled) - populate(objectMap, "logTemplate", d.LogTemplate) - populate(objectMap, "noCache", d.NoCache) - populate(objectMap, "platform", d.Platform) - populate(objectMap, "sourceLocation", d.SourceLocation) - populate(objectMap, "target", d.Target) - populate(objectMap, "timeout", d.Timeout) - objectMap["type"] = "DockerBuildRequest" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DockerBuildRequest. -func (d *DockerBuildRequest) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "agentConfiguration": - err = unpopulate(val, "AgentConfiguration", &d.AgentConfiguration) - delete(rawMsg, key) - case "agentPoolName": - err = unpopulate(val, "AgentPoolName", &d.AgentPoolName) - delete(rawMsg, key) - case "arguments": - err = unpopulate(val, "Arguments", &d.Arguments) - delete(rawMsg, key) - case "credentials": - err = unpopulate(val, "Credentials", &d.Credentials) - delete(rawMsg, key) - case "dockerFilePath": - err = unpopulate(val, "DockerFilePath", &d.DockerFilePath) - delete(rawMsg, key) - case "imageNames": - err = unpopulate(val, "ImageNames", &d.ImageNames) - delete(rawMsg, key) - case "isArchiveEnabled": - err = unpopulate(val, "IsArchiveEnabled", &d.IsArchiveEnabled) - delete(rawMsg, key) - case "isPushEnabled": - err = unpopulate(val, "IsPushEnabled", &d.IsPushEnabled) - delete(rawMsg, key) - case "logTemplate": - err = unpopulate(val, "LogTemplate", &d.LogTemplate) - delete(rawMsg, key) - case "noCache": - err = unpopulate(val, "NoCache", &d.NoCache) - delete(rawMsg, key) - case "platform": - err = unpopulate(val, "Platform", &d.Platform) - delete(rawMsg, key) - case "sourceLocation": - err = unpopulate(val, "SourceLocation", &d.SourceLocation) - delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &d.Target) - delete(rawMsg, key) - case "timeout": - err = unpopulate(val, "Timeout", &d.Timeout) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DockerBuildStep. -func (d DockerBuildStep) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "arguments", d.Arguments) - populate(objectMap, "baseImageDependencies", d.BaseImageDependencies) - populate(objectMap, "contextAccessToken", d.ContextAccessToken) - populate(objectMap, "contextPath", d.ContextPath) - populate(objectMap, "dockerFilePath", d.DockerFilePath) - populate(objectMap, "imageNames", d.ImageNames) - populate(objectMap, "isPushEnabled", d.IsPushEnabled) - populate(objectMap, "noCache", d.NoCache) - populate(objectMap, "target", d.Target) - objectMap["type"] = StepTypeDocker - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DockerBuildStep. -func (d *DockerBuildStep) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "arguments": - err = unpopulate(val, "Arguments", &d.Arguments) - delete(rawMsg, key) - case "baseImageDependencies": - err = unpopulate(val, "BaseImageDependencies", &d.BaseImageDependencies) - delete(rawMsg, key) - case "contextAccessToken": - err = unpopulate(val, "ContextAccessToken", &d.ContextAccessToken) - delete(rawMsg, key) - case "contextPath": - err = unpopulate(val, "ContextPath", &d.ContextPath) - delete(rawMsg, key) - case "dockerFilePath": - err = unpopulate(val, "DockerFilePath", &d.DockerFilePath) - delete(rawMsg, key) - case "imageNames": - err = unpopulate(val, "ImageNames", &d.ImageNames) - delete(rawMsg, key) - case "isPushEnabled": - err = unpopulate(val, "IsPushEnabled", &d.IsPushEnabled) - delete(rawMsg, key) - case "noCache": - err = unpopulate(val, "NoCache", &d.NoCache) - delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &d.Target) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DockerBuildStepUpdateParameters. -func (d DockerBuildStepUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "arguments", d.Arguments) - populate(objectMap, "contextAccessToken", d.ContextAccessToken) - populate(objectMap, "contextPath", d.ContextPath) - populate(objectMap, "dockerFilePath", d.DockerFilePath) - populate(objectMap, "imageNames", d.ImageNames) - populate(objectMap, "isPushEnabled", d.IsPushEnabled) - populate(objectMap, "noCache", d.NoCache) - populate(objectMap, "target", d.Target) - objectMap["type"] = StepTypeDocker - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DockerBuildStepUpdateParameters. -func (d *DockerBuildStepUpdateParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "arguments": - err = unpopulate(val, "Arguments", &d.Arguments) - delete(rawMsg, key) - case "contextAccessToken": - err = unpopulate(val, "ContextAccessToken", &d.ContextAccessToken) - delete(rawMsg, key) - case "contextPath": - err = unpopulate(val, "ContextPath", &d.ContextPath) - delete(rawMsg, key) - case "dockerFilePath": - err = unpopulate(val, "DockerFilePath", &d.DockerFilePath) - delete(rawMsg, key) - case "imageNames": - err = unpopulate(val, "ImageNames", &d.ImageNames) - delete(rawMsg, key) - case "isPushEnabled": - err = unpopulate(val, "IsPushEnabled", &d.IsPushEnabled) - delete(rawMsg, key) - case "noCache": - err = unpopulate(val, "NoCache", &d.NoCache) - delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &d.Target) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type EncodedTaskRunRequest. -func (e EncodedTaskRunRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "agentConfiguration", e.AgentConfiguration) - populate(objectMap, "agentPoolName", e.AgentPoolName) - populate(objectMap, "credentials", e.Credentials) - populate(objectMap, "encodedTaskContent", e.EncodedTaskContent) - populate(objectMap, "encodedValuesContent", e.EncodedValuesContent) - populate(objectMap, "isArchiveEnabled", e.IsArchiveEnabled) - populate(objectMap, "logTemplate", e.LogTemplate) - populate(objectMap, "platform", e.Platform) - populate(objectMap, "sourceLocation", e.SourceLocation) - populate(objectMap, "timeout", e.Timeout) - objectMap["type"] = "EncodedTaskRunRequest" - populate(objectMap, "values", e.Values) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EncodedTaskRunRequest. -func (e *EncodedTaskRunRequest) 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", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "agentConfiguration": - err = unpopulate(val, "AgentConfiguration", &e.AgentConfiguration) - delete(rawMsg, key) - case "agentPoolName": - err = unpopulate(val, "AgentPoolName", &e.AgentPoolName) - delete(rawMsg, key) - case "credentials": - err = unpopulate(val, "Credentials", &e.Credentials) - delete(rawMsg, key) - case "encodedTaskContent": - err = unpopulate(val, "EncodedTaskContent", &e.EncodedTaskContent) - delete(rawMsg, key) - case "encodedValuesContent": - err = unpopulate(val, "EncodedValuesContent", &e.EncodedValuesContent) - delete(rawMsg, key) - case "isArchiveEnabled": - err = unpopulate(val, "IsArchiveEnabled", &e.IsArchiveEnabled) - delete(rawMsg, key) - case "logTemplate": - err = unpopulate(val, "LogTemplate", &e.LogTemplate) - delete(rawMsg, key) - case "platform": - err = unpopulate(val, "Platform", &e.Platform) - delete(rawMsg, key) - case "sourceLocation": - err = unpopulate(val, "SourceLocation", &e.SourceLocation) - delete(rawMsg, key) - case "timeout": - err = unpopulate(val, "Timeout", &e.Timeout) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) - delete(rawMsg, key) - case "values": - err = unpopulate(val, "Values", &e.Values) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type EncodedTaskStep. -func (e EncodedTaskStep) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "baseImageDependencies", e.BaseImageDependencies) - populate(objectMap, "contextAccessToken", e.ContextAccessToken) - populate(objectMap, "contextPath", e.ContextPath) - populate(objectMap, "encodedTaskContent", e.EncodedTaskContent) - populate(objectMap, "encodedValuesContent", e.EncodedValuesContent) - objectMap["type"] = StepTypeEncodedTask - populate(objectMap, "values", e.Values) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EncodedTaskStep. -func (e *EncodedTaskStep) 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", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "baseImageDependencies": - err = unpopulate(val, "BaseImageDependencies", &e.BaseImageDependencies) - delete(rawMsg, key) - case "contextAccessToken": - err = unpopulate(val, "ContextAccessToken", &e.ContextAccessToken) - delete(rawMsg, key) - case "contextPath": - err = unpopulate(val, "ContextPath", &e.ContextPath) - delete(rawMsg, key) - case "encodedTaskContent": - err = unpopulate(val, "EncodedTaskContent", &e.EncodedTaskContent) - delete(rawMsg, key) - case "encodedValuesContent": - err = unpopulate(val, "EncodedValuesContent", &e.EncodedValuesContent) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) - delete(rawMsg, key) - case "values": - err = unpopulate(val, "Values", &e.Values) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type EncodedTaskStepUpdateParameters. -func (e EncodedTaskStepUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "contextAccessToken", e.ContextAccessToken) - populate(objectMap, "contextPath", e.ContextPath) - populate(objectMap, "encodedTaskContent", e.EncodedTaskContent) - populate(objectMap, "encodedValuesContent", e.EncodedValuesContent) - objectMap["type"] = StepTypeEncodedTask - populate(objectMap, "values", e.Values) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EncodedTaskStepUpdateParameters. -func (e *EncodedTaskStepUpdateParameters) 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", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "contextAccessToken": - err = unpopulate(val, "ContextAccessToken", &e.ContextAccessToken) - delete(rawMsg, key) - case "contextPath": - err = unpopulate(val, "ContextPath", &e.ContextPath) - delete(rawMsg, key) - case "encodedTaskContent": - err = unpopulate(val, "EncodedTaskContent", &e.EncodedTaskContent) - delete(rawMsg, key) - case "encodedValuesContent": - err = unpopulate(val, "EncodedValuesContent", &e.EncodedValuesContent) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) - delete(rawMsg, key) - case "values": - err = unpopulate(val, "Values", &e.Values) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type EncryptionProperty. -func (e EncryptionProperty) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "keyVaultProperties", e.KeyVaultProperties) - populate(objectMap, "status", e.Status) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionProperty. -func (e *EncryptionProperty) 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", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "keyVaultProperties": - err = unpopulate(val, "KeyVaultProperties", &e.KeyVaultProperties) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &e.Status) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Event. -func (e Event) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "eventRequestMessage", e.EventRequestMessage) - populate(objectMap, "eventResponseMessage", e.EventResponseMessage) - populate(objectMap, "id", e.ID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Event. -func (e *Event) 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", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "eventRequestMessage": - err = unpopulate(val, "EventRequestMessage", &e.EventRequestMessage) - delete(rawMsg, key) - case "eventResponseMessage": - err = unpopulate(val, "EventResponseMessage", &e.EventResponseMessage) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &e.ID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type EventContent. -func (e EventContent) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "action", e.Action) - populate(objectMap, "actor", e.Actor) - populate(objectMap, "id", e.ID) - populate(objectMap, "request", e.Request) - populate(objectMap, "source", e.Source) - populate(objectMap, "target", e.Target) - populateDateTimeRFC3339(objectMap, "timestamp", e.Timestamp) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EventContent. -func (e *EventContent) 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", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "action": - err = unpopulate(val, "Action", &e.Action) - delete(rawMsg, key) - case "actor": - err = unpopulate(val, "Actor", &e.Actor) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &e.ID) - delete(rawMsg, key) - case "request": - err = unpopulate(val, "Request", &e.Request) - delete(rawMsg, key) - case "source": - err = unpopulate(val, "Source", &e.Source) - delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &e.Target) - delete(rawMsg, key) - case "timestamp": - err = unpopulateDateTimeRFC3339(val, "Timestamp", &e.Timestamp) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type EventInfo. -func (e EventInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", e.ID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EventInfo. -func (e *EventInfo) 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", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &e.ID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type EventListResult. -func (e EventListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", e.NextLink) - populate(objectMap, "value", e.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EventListResult. -func (e *EventListResult) 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", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &e.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &e.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type EventRequestMessage. -func (e EventRequestMessage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "content", e.Content) - populate(objectMap, "headers", e.Headers) - populate(objectMap, "method", e.Method) - populate(objectMap, "requestUri", e.RequestURI) - populate(objectMap, "version", e.Version) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EventRequestMessage. -func (e *EventRequestMessage) 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", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "content": - err = unpopulate(val, "Content", &e.Content) - delete(rawMsg, key) - case "headers": - err = unpopulate(val, "Headers", &e.Headers) - delete(rawMsg, key) - case "method": - err = unpopulate(val, "Method", &e.Method) - delete(rawMsg, key) - case "requestUri": - err = unpopulate(val, "RequestURI", &e.RequestURI) - delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &e.Version) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type EventResponseMessage. -func (e EventResponseMessage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "content", e.Content) - populate(objectMap, "headers", e.Headers) - populate(objectMap, "reasonPhrase", e.ReasonPhrase) - populate(objectMap, "statusCode", e.StatusCode) - populate(objectMap, "version", e.Version) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EventResponseMessage. -func (e *EventResponseMessage) 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", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "content": - err = unpopulate(val, "Content", &e.Content) - delete(rawMsg, key) - case "headers": - err = unpopulate(val, "Headers", &e.Headers) - delete(rawMsg, key) - case "reasonPhrase": - err = unpopulate(val, "ReasonPhrase", &e.ReasonPhrase) - delete(rawMsg, key) - case "statusCode": - err = unpopulate(val, "StatusCode", &e.StatusCode) - delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &e.Version) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ExportPolicy. -func (e ExportPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "status", e.Status) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExportPolicy. -func (e *ExportPolicy) 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", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "status": - err = unpopulate(val, "Status", &e.Status) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type FileTaskRunRequest. -func (f FileTaskRunRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "agentConfiguration", f.AgentConfiguration) - populate(objectMap, "agentPoolName", f.AgentPoolName) - populate(objectMap, "credentials", f.Credentials) - populate(objectMap, "isArchiveEnabled", f.IsArchiveEnabled) - populate(objectMap, "logTemplate", f.LogTemplate) - populate(objectMap, "platform", f.Platform) - populate(objectMap, "sourceLocation", f.SourceLocation) - populate(objectMap, "taskFilePath", f.TaskFilePath) - populate(objectMap, "timeout", f.Timeout) - objectMap["type"] = "FileTaskRunRequest" - populate(objectMap, "values", f.Values) - populate(objectMap, "valuesFilePath", f.ValuesFilePath) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FileTaskRunRequest. -func (f *FileTaskRunRequest) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "agentConfiguration": - err = unpopulate(val, "AgentConfiguration", &f.AgentConfiguration) - delete(rawMsg, key) - case "agentPoolName": - err = unpopulate(val, "AgentPoolName", &f.AgentPoolName) - delete(rawMsg, key) - case "credentials": - err = unpopulate(val, "Credentials", &f.Credentials) - delete(rawMsg, key) - case "isArchiveEnabled": - err = unpopulate(val, "IsArchiveEnabled", &f.IsArchiveEnabled) - delete(rawMsg, key) - case "logTemplate": - err = unpopulate(val, "LogTemplate", &f.LogTemplate) - delete(rawMsg, key) - case "platform": - err = unpopulate(val, "Platform", &f.Platform) - delete(rawMsg, key) - case "sourceLocation": - err = unpopulate(val, "SourceLocation", &f.SourceLocation) - delete(rawMsg, key) - case "taskFilePath": - err = unpopulate(val, "TaskFilePath", &f.TaskFilePath) - delete(rawMsg, key) - case "timeout": - err = unpopulate(val, "Timeout", &f.Timeout) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &f.Type) - delete(rawMsg, key) - case "values": - err = unpopulate(val, "Values", &f.Values) - delete(rawMsg, key) - case "valuesFilePath": - err = unpopulate(val, "ValuesFilePath", &f.ValuesFilePath) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type FileTaskStep. -func (f FileTaskStep) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "baseImageDependencies", f.BaseImageDependencies) - populate(objectMap, "contextAccessToken", f.ContextAccessToken) - populate(objectMap, "contextPath", f.ContextPath) - populate(objectMap, "taskFilePath", f.TaskFilePath) - objectMap["type"] = StepTypeFileTask - populate(objectMap, "values", f.Values) - populate(objectMap, "valuesFilePath", f.ValuesFilePath) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FileTaskStep. -func (f *FileTaskStep) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "baseImageDependencies": - err = unpopulate(val, "BaseImageDependencies", &f.BaseImageDependencies) - delete(rawMsg, key) - case "contextAccessToken": - err = unpopulate(val, "ContextAccessToken", &f.ContextAccessToken) - delete(rawMsg, key) - case "contextPath": - err = unpopulate(val, "ContextPath", &f.ContextPath) - delete(rawMsg, key) - case "taskFilePath": - err = unpopulate(val, "TaskFilePath", &f.TaskFilePath) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &f.Type) - delete(rawMsg, key) - case "values": - err = unpopulate(val, "Values", &f.Values) - delete(rawMsg, key) - case "valuesFilePath": - err = unpopulate(val, "ValuesFilePath", &f.ValuesFilePath) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type FileTaskStepUpdateParameters. -func (f FileTaskStepUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "contextAccessToken", f.ContextAccessToken) - populate(objectMap, "contextPath", f.ContextPath) - populate(objectMap, "taskFilePath", f.TaskFilePath) - objectMap["type"] = StepTypeFileTask - populate(objectMap, "values", f.Values) - populate(objectMap, "valuesFilePath", f.ValuesFilePath) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FileTaskStepUpdateParameters. -func (f *FileTaskStepUpdateParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "contextAccessToken": - err = unpopulate(val, "ContextAccessToken", &f.ContextAccessToken) - delete(rawMsg, key) - case "contextPath": - err = unpopulate(val, "ContextPath", &f.ContextPath) - delete(rawMsg, key) - case "taskFilePath": - err = unpopulate(val, "TaskFilePath", &f.TaskFilePath) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &f.Type) - delete(rawMsg, key) - case "values": - err = unpopulate(val, "Values", &f.Values) - delete(rawMsg, key) - case "valuesFilePath": - err = unpopulate(val, "ValuesFilePath", &f.ValuesFilePath) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GarbageCollectionProperties. -func (g GarbageCollectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "enabled", g.Enabled) - populate(objectMap, "schedule", g.Schedule) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GarbageCollectionProperties. -func (g *GarbageCollectionProperties) 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", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "enabled": - err = unpopulate(val, "Enabled", &g.Enabled) - delete(rawMsg, key) - case "schedule": - err = unpopulate(val, "Schedule", &g.Schedule) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GenerateCredentialsParameters. -func (g GenerateCredentialsParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "expiry", g.Expiry) - populate(objectMap, "name", g.Name) - populate(objectMap, "tokenId", g.TokenID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GenerateCredentialsParameters. -func (g *GenerateCredentialsParameters) 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", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "expiry": - err = unpopulateDateTimeRFC3339(val, "Expiry", &g.Expiry) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &g.Name) - delete(rawMsg, key) - case "tokenId": - err = unpopulate(val, "TokenID", &g.TokenID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GenerateCredentialsResult. -func (g GenerateCredentialsResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "passwords", g.Passwords) - populate(objectMap, "username", g.Username) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GenerateCredentialsResult. -func (g *GenerateCredentialsResult) 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", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "passwords": - err = unpopulate(val, "Passwords", &g.Passwords) - delete(rawMsg, key) - case "username": - err = unpopulate(val, "Username", &g.Username) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type IPRule. -func (i IPRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "action", i.Action) - populate(objectMap, "value", i.IPAddressOrRange) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IPRule. -func (i *IPRule) 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", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "action": - err = unpopulate(val, "Action", &i.Action) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "IPAddressOrRange", &i.IPAddressOrRange) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type IdentityProperties. -func (i IdentityProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "principalId", i.PrincipalID) - populate(objectMap, "tenantId", i.TenantID) - populate(objectMap, "type", i.Type) - populate(objectMap, "userAssignedIdentities", i.UserAssignedIdentities) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IdentityProperties. -func (i *IdentityProperties) 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", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "principalId": - err = unpopulate(val, "PrincipalID", &i.PrincipalID) - delete(rawMsg, key) - case "tenantId": - err = unpopulate(val, "TenantID", &i.TenantID) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &i.Type) - delete(rawMsg, key) - case "userAssignedIdentities": - err = unpopulate(val, "UserAssignedIdentities", &i.UserAssignedIdentities) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ImageDescriptor. -func (i ImageDescriptor) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "digest", i.Digest) - populate(objectMap, "registry", i.Registry) - populate(objectMap, "repository", i.Repository) - populate(objectMap, "tag", i.Tag) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ImageDescriptor. -func (i *ImageDescriptor) 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", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "digest": - err = unpopulate(val, "Digest", &i.Digest) - delete(rawMsg, key) - case "registry": - err = unpopulate(val, "Registry", &i.Registry) - delete(rawMsg, key) - case "repository": - err = unpopulate(val, "Repository", &i.Repository) - delete(rawMsg, key) - case "tag": - err = unpopulate(val, "Tag", &i.Tag) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ImageUpdateTrigger. -func (i ImageUpdateTrigger) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", i.ID) - populate(objectMap, "images", i.Images) - populateDateTimeRFC3339(objectMap, "timestamp", i.Timestamp) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ImageUpdateTrigger. -func (i *ImageUpdateTrigger) 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", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &i.ID) - delete(rawMsg, key) - case "images": - err = unpopulate(val, "Images", &i.Images) - delete(rawMsg, key) - case "timestamp": - err = unpopulateDateTimeRFC3339(val, "Timestamp", &i.Timestamp) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ImportImageParameters. -func (i ImportImageParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "mode", i.Mode) - populate(objectMap, "source", i.Source) - populate(objectMap, "targetTags", i.TargetTags) - populate(objectMap, "untaggedTargetRepositories", i.UntaggedTargetRepositories) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ImportImageParameters. -func (i *ImportImageParameters) 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", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "mode": - err = unpopulate(val, "Mode", &i.Mode) - delete(rawMsg, key) - case "source": - err = unpopulate(val, "Source", &i.Source) - delete(rawMsg, key) - case "targetTags": - err = unpopulate(val, "TargetTags", &i.TargetTags) - delete(rawMsg, key) - case "untaggedTargetRepositories": - err = unpopulate(val, "UntaggedTargetRepositories", &i.UntaggedTargetRepositories) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ImportSource. -func (i ImportSource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "credentials", i.Credentials) - populate(objectMap, "registryUri", i.RegistryURI) - populate(objectMap, "resourceId", i.ResourceID) - populate(objectMap, "sourceImage", i.SourceImage) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ImportSource. -func (i *ImportSource) 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", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "credentials": - err = unpopulate(val, "Credentials", &i.Credentials) - delete(rawMsg, key) - case "registryUri": - err = unpopulate(val, "RegistryURI", &i.RegistryURI) - delete(rawMsg, key) - case "resourceId": - err = unpopulate(val, "ResourceID", &i.ResourceID) - delete(rawMsg, key) - case "sourceImage": - err = unpopulate(val, "SourceImage", &i.SourceImage) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ImportSourceCredentials. -func (i ImportSourceCredentials) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "password", i.Password) - populate(objectMap, "username", i.Username) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ImportSourceCredentials. -func (i *ImportSourceCredentials) 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", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "password": - err = unpopulate(val, "Password", &i.Password) - delete(rawMsg, key) - case "username": - err = unpopulate(val, "Username", &i.Username) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type KeyVaultProperties. -func (k KeyVaultProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "identity", k.Identity) - populate(objectMap, "keyIdentifier", k.KeyIdentifier) - populate(objectMap, "keyRotationEnabled", k.KeyRotationEnabled) - populateDateTimeRFC3339(objectMap, "lastKeyRotationTimestamp", k.LastKeyRotationTimestamp) - populate(objectMap, "versionedKeyIdentifier", k.VersionedKeyIdentifier) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultProperties. -func (k *KeyVaultProperties) 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", k, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "identity": - err = unpopulate(val, "Identity", &k.Identity) - delete(rawMsg, key) - case "keyIdentifier": - err = unpopulate(val, "KeyIdentifier", &k.KeyIdentifier) - delete(rawMsg, key) - case "keyRotationEnabled": - err = unpopulate(val, "KeyRotationEnabled", &k.KeyRotationEnabled) - delete(rawMsg, key) - case "lastKeyRotationTimestamp": - err = unpopulateDateTimeRFC3339(val, "LastKeyRotationTimestamp", &k.LastKeyRotationTimestamp) - delete(rawMsg, key) - case "versionedKeyIdentifier": - err = unpopulate(val, "VersionedKeyIdentifier", &k.VersionedKeyIdentifier) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LoggingProperties. -func (l LoggingProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "auditLogStatus", l.AuditLogStatus) - populate(objectMap, "logLevel", l.LogLevel) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LoggingProperties. -func (l *LoggingProperties) 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 "auditLogStatus": - err = unpopulate(val, "AuditLogStatus", &l.AuditLogStatus) - delete(rawMsg, key) - case "logLevel": - err = unpopulate(val, "LogLevel", &l.LogLevel) - 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 LoginServerProperties. -func (l LoginServerProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "host", l.Host) - populate(objectMap, "tls", l.TLS) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LoginServerProperties. -func (l *LoginServerProperties) 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 "host": - err = unpopulate(val, "Host", &l.Host) - delete(rawMsg, key) - case "tls": - err = unpopulate(val, "TLS", &l.TLS) - 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 NetworkRuleSet. -func (n NetworkRuleSet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "defaultAction", n.DefaultAction) - populate(objectMap, "ipRules", n.IPRules) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkRuleSet. -func (n *NetworkRuleSet) 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", n, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "defaultAction": - err = unpopulate(val, "DefaultAction", &n.DefaultAction) - delete(rawMsg, key) - case "ipRules": - err = unpopulate(val, "IPRules", &n.IPRules) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OperationDefinition. -func (o OperationDefinition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "display", o.Display) - populate(objectMap, "isDataAction", o.IsDataAction) - populate(objectMap, "name", o.Name) - populate(objectMap, "origin", o.Origin) - populate(objectMap, "properties", o.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDefinition. -func (o *OperationDefinition) 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", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "display": - err = unpopulate(val, "Display", &o.Display) - delete(rawMsg, key) - case "isDataAction": - err = unpopulate(val, "IsDataAction", &o.IsDataAction) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &o.Name) - delete(rawMsg, key) - case "origin": - err = unpopulate(val, "Origin", &o.Origin) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &o.Properties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OperationDisplayDefinition. -func (o OperationDisplayDefinition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "description", o.Description) - populate(objectMap, "operation", o.Operation) - populate(objectMap, "provider", o.Provider) - populate(objectMap, "resource", o.Resource) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplayDefinition. -func (o *OperationDisplayDefinition) 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", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "description": - err = unpopulate(val, "Description", &o.Description) - delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &o.Operation) - delete(rawMsg, key) - case "provider": - err = unpopulate(val, "Provider", &o.Provider) - delete(rawMsg, key) - case "resource": - err = unpopulate(val, "Resource", &o.Resource) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OperationListResult. -func (o OperationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", o.NextLink) - populate(objectMap, "value", o.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult. -func (o *OperationListResult) 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", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &o.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &o.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OperationLogSpecificationDefinition. -func (o OperationLogSpecificationDefinition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "blobDuration", o.BlobDuration) - populate(objectMap, "displayName", o.DisplayName) - populate(objectMap, "name", o.Name) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationLogSpecificationDefinition. -func (o *OperationLogSpecificationDefinition) 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", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "blobDuration": - err = unpopulate(val, "BlobDuration", &o.BlobDuration) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &o.DisplayName) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &o.Name) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OperationMetricSpecificationDefinition. -func (o OperationMetricSpecificationDefinition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "aggregationType", o.AggregationType) - populate(objectMap, "displayDescription", o.DisplayDescription) - populate(objectMap, "displayName", o.DisplayName) - populate(objectMap, "internalMetricName", o.InternalMetricName) - populate(objectMap, "name", o.Name) - populate(objectMap, "unit", o.Unit) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationMetricSpecificationDefinition. -func (o *OperationMetricSpecificationDefinition) 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", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "aggregationType": - err = unpopulate(val, "AggregationType", &o.AggregationType) - delete(rawMsg, key) - case "displayDescription": - err = unpopulate(val, "DisplayDescription", &o.DisplayDescription) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &o.DisplayName) - delete(rawMsg, key) - case "internalMetricName": - err = unpopulate(val, "InternalMetricName", &o.InternalMetricName) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &o.Name) - delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &o.Unit) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OperationPropertiesDefinition. -func (o OperationPropertiesDefinition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "serviceSpecification", o.ServiceSpecification) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationPropertiesDefinition. -func (o *OperationPropertiesDefinition) 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", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "serviceSpecification": - err = unpopulate(val, "ServiceSpecification", &o.ServiceSpecification) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OperationServiceSpecificationDefinition. -func (o OperationServiceSpecificationDefinition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "logSpecifications", o.LogSpecifications) - populate(objectMap, "metricSpecifications", o.MetricSpecifications) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationServiceSpecificationDefinition. -func (o *OperationServiceSpecificationDefinition) 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", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "logSpecifications": - err = unpopulate(val, "LogSpecifications", &o.LogSpecifications) - delete(rawMsg, key) - case "metricSpecifications": - err = unpopulate(val, "MetricSpecifications", &o.MetricSpecifications) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OverrideTaskStepProperties. -func (o OverrideTaskStepProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "arguments", o.Arguments) - populate(objectMap, "contextPath", o.ContextPath) - populate(objectMap, "file", o.File) - populate(objectMap, "target", o.Target) - populate(objectMap, "updateTriggerToken", o.UpdateTriggerToken) - populate(objectMap, "values", o.Values) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OverrideTaskStepProperties. -func (o *OverrideTaskStepProperties) 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", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "arguments": - err = unpopulate(val, "Arguments", &o.Arguments) - delete(rawMsg, key) - case "contextPath": - err = unpopulate(val, "ContextPath", &o.ContextPath) - delete(rawMsg, key) - case "file": - err = unpopulate(val, "File", &o.File) - delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &o.Target) - delete(rawMsg, key) - case "updateTriggerToken": - err = unpopulate(val, "UpdateTriggerToken", &o.UpdateTriggerToken) - delete(rawMsg, key) - case "values": - err = unpopulate(val, "Values", &o.Values) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ParentProperties. -func (p ParentProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - populate(objectMap, "syncProperties", p.SyncProperties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ParentProperties. -func (p *ParentProperties) 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", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "syncProperties": - err = unpopulate(val, "SyncProperties", &p.SyncProperties) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PlatformProperties. -func (p PlatformProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "architecture", p.Architecture) - populate(objectMap, "os", p.OS) - populate(objectMap, "variant", p.Variant) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PlatformProperties. -func (p *PlatformProperties) 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", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "architecture": - err = unpopulate(val, "Architecture", &p.Architecture) - delete(rawMsg, key) - case "os": - err = unpopulate(val, "OS", &p.OS) - delete(rawMsg, key) - case "variant": - err = unpopulate(val, "Variant", &p.Variant) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PlatformUpdateParameters. -func (p PlatformUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "architecture", p.Architecture) - populate(objectMap, "os", p.OS) - populate(objectMap, "variant", p.Variant) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PlatformUpdateParameters. -func (p *PlatformUpdateParameters) 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", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "architecture": - err = unpopulate(val, "Architecture", &p.Architecture) - delete(rawMsg, key) - case "os": - err = unpopulate(val, "OS", &p.OS) - delete(rawMsg, key) - case "variant": - err = unpopulate(val, "Variant", &p.Variant) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Policies. -func (p Policies) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "azureADAuthenticationAsArmPolicy", p.AzureADAuthenticationAsArmPolicy) - populate(objectMap, "exportPolicy", p.ExportPolicy) - populate(objectMap, "quarantinePolicy", p.QuarantinePolicy) - populate(objectMap, "retentionPolicy", p.RetentionPolicy) - populate(objectMap, "trustPolicy", p.TrustPolicy) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Policies. -func (p *Policies) 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", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "azureADAuthenticationAsArmPolicy": - err = unpopulate(val, "AzureADAuthenticationAsArmPolicy", &p.AzureADAuthenticationAsArmPolicy) - delete(rawMsg, key) - case "exportPolicy": - err = unpopulate(val, "ExportPolicy", &p.ExportPolicy) - delete(rawMsg, key) - case "quarantinePolicy": - err = unpopulate(val, "QuarantinePolicy", &p.QuarantinePolicy) - delete(rawMsg, key) - case "retentionPolicy": - err = unpopulate(val, "RetentionPolicy", &p.RetentionPolicy) - delete(rawMsg, key) - case "trustPolicy": - err = unpopulate(val, "TrustPolicy", &p.TrustPolicy) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpoint. -func (p PrivateEndpoint) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpoint. -func (p *PrivateEndpoint) 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", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection. -func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "systemData", p.SystemData) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnection. -func (p *PrivateEndpointConnection) 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", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &p.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult. -func (p PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionListResult. -func (p *PrivateEndpointConnectionListResult) 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", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &p.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &p.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties. -func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "privateEndpoint", p.PrivateEndpoint) - populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) - populate(objectMap, "provisioningState", p.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionProperties. -func (p *PrivateEndpointConnectionProperties) 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", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "privateEndpoint": - err = unpopulate(val, "PrivateEndpoint", &p.PrivateEndpoint) - delete(rawMsg, key) - case "privateLinkServiceConnectionState": - err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource. -func (p PrivateLinkResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "systemData", p.SystemData) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResource. -func (p *PrivateLinkResource) 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", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &p.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult. -func (p PrivateLinkResourceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceListResult. -func (p *PrivateLinkResourceListResult) 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", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &p.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &p.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties. -func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "groupId", p.GroupID) - populate(objectMap, "requiredMembers", p.RequiredMembers) - populate(objectMap, "requiredZoneNames", p.RequiredZoneNames) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceProperties. -func (p *PrivateLinkResourceProperties) 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", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "groupId": - err = unpopulate(val, "GroupID", &p.GroupID) - delete(rawMsg, key) - case "requiredMembers": - err = unpopulate(val, "RequiredMembers", &p.RequiredMembers) - delete(rawMsg, key) - case "requiredZoneNames": - err = unpopulate(val, "RequiredZoneNames", &p.RequiredZoneNames) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionState. -func (p PrivateLinkServiceConnectionState) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "actionsRequired", p.ActionsRequired) - populate(objectMap, "description", p.Description) - populate(objectMap, "status", p.Status) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceConnectionState. -func (p *PrivateLinkServiceConnectionState) 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", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "actionsRequired": - err = unpopulate(val, "ActionsRequired", &p.ActionsRequired) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &p.Description) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &p.Status) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type QuarantinePolicy. -func (q QuarantinePolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "status", q.Status) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type QuarantinePolicy. -func (q *QuarantinePolicy) 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", q, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "status": - err = unpopulate(val, "Status", &q.Status) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RegenerateCredentialParameters. -func (r RegenerateCredentialParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", r.Name) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RegenerateCredentialParameters. -func (r *RegenerateCredentialParameters) 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", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Registry. -func (r Registry) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", r.ID) - populate(objectMap, "identity", r.Identity) - populate(objectMap, "location", r.Location) - populate(objectMap, "name", r.Name) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "sku", r.SKU) - populate(objectMap, "systemData", r.SystemData) - populate(objectMap, "tags", r.Tags) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Registry. -func (r *Registry) 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", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &r.Identity) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &r.Location) + case "expiry": + err = unpopulateTime[datetime.RFC3339](val, "Expiry", &g.Expiry) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &r.Properties) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &r.SKU) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &r.SystemData) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &r.Tags) + err = unpopulate(val, "Name", &g.Name) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) + case "tokenId": + err = unpopulate(val, "TokenID", &g.TokenID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RegistryListCredentialsResult. -func (r RegistryListCredentialsResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GenerateCredentialsResult. +func (g GenerateCredentialsResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "passwords", r.Passwords) - populate(objectMap, "username", r.Username) + populate(objectMap, "passwords", g.Passwords) + populate(objectMap, "username", g.Username) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RegistryListCredentialsResult. -func (r *RegistryListCredentialsResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GenerateCredentialsResult. +func (g *GenerateCredentialsResult) 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", r, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { case "passwords": - err = unpopulate(val, "Passwords", &r.Passwords) + err = unpopulate(val, "Passwords", &g.Passwords) delete(rawMsg, key) case "username": - err = unpopulate(val, "Username", &r.Username) + err = unpopulate(val, "Username", &g.Username) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RegistryListResult. -func (r RegistryListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type IPRule. +func (i IPRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", r.NextLink) - populate(objectMap, "value", r.Value) + populate(objectMap, "action", i.Action) + populate(objectMap, "value", i.IPAddressOrRange) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RegistryListResult. -func (r *RegistryListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type IPRule. +func (i *IPRule) 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", r, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &r.NextLink) + case "action": + err = unpopulate(val, "Action", &i.Action) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &r.Value) + err = unpopulate(val, "IPAddressOrRange", &i.IPAddressOrRange) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RegistryNameCheckRequest. -func (r RegistryNameCheckRequest) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type IdentityProperties. +func (i IdentityProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "autoGeneratedDomainNameLabelScope", r.AutoGeneratedDomainNameLabelScope) - populate(objectMap, "name", r.Name) - populate(objectMap, "resourceGroupName", r.ResourceGroupName) - objectMap["type"] = "Microsoft.ContainerRegistry/registries" + populate(objectMap, "principalId", i.PrincipalID) + populate(objectMap, "tenantId", i.TenantID) + populate(objectMap, "type", i.Type) + populate(objectMap, "userAssignedIdentities", i.UserAssignedIdentities) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RegistryNameCheckRequest. -func (r *RegistryNameCheckRequest) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type IdentityProperties. +func (i *IdentityProperties) 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", r, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "autoGeneratedDomainNameLabelScope": - err = unpopulate(val, "AutoGeneratedDomainNameLabelScope", &r.AutoGeneratedDomainNameLabelScope) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) + case "principalId": + err = unpopulate(val, "PrincipalID", &i.PrincipalID) delete(rawMsg, key) - case "resourceGroupName": - err = unpopulate(val, "ResourceGroupName", &r.ResourceGroupName) + case "tenantId": + err = unpopulate(val, "TenantID", &i.TenantID) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &r.Type) + err = unpopulate(val, "Type", &i.Type) + delete(rawMsg, key) + case "userAssignedIdentities": + err = unpopulate(val, "UserAssignedIdentities", &i.UserAssignedIdentities) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RegistryNameStatus. -func (r RegistryNameStatus) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ImportImageParameters. +func (i ImportImageParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "availableLoginServerName", r.AvailableLoginServerName) - populate(objectMap, "message", r.Message) - populate(objectMap, "nameAvailable", r.NameAvailable) - populate(objectMap, "reason", r.Reason) + populate(objectMap, "mode", i.Mode) + populate(objectMap, "source", i.Source) + populate(objectMap, "targetTags", i.TargetTags) + populate(objectMap, "untaggedTargetRepositories", i.UntaggedTargetRepositories) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RegistryNameStatus. -func (r *RegistryNameStatus) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ImportImageParameters. +func (i *ImportImageParameters) 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", r, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "availableLoginServerName": - err = unpopulate(val, "AvailableLoginServerName", &r.AvailableLoginServerName) - delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &r.Message) - delete(rawMsg, key) - case "nameAvailable": - err = unpopulate(val, "NameAvailable", &r.NameAvailable) + case "mode": + err = unpopulate(val, "Mode", &i.Mode) delete(rawMsg, key) - case "reason": - err = unpopulate(val, "Reason", &r.Reason) + case "source": + err = unpopulate(val, "Source", &i.Source) delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RegistryPassword. -func (r RegistryPassword) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", r.Name) - populate(objectMap, "value", r.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RegistryPassword. -func (r *RegistryPassword) 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", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &r.Name) + case "targetTags": + err = unpopulate(val, "TargetTags", &i.TargetTags) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &r.Value) + case "untaggedTargetRepositories": + err = unpopulate(val, "UntaggedTargetRepositories", &i.UntaggedTargetRepositories) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RegistryProperties. -func (r RegistryProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ImportSource. +func (i ImportSource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "adminUserEnabled", r.AdminUserEnabled) - populate(objectMap, "anonymousPullEnabled", r.AnonymousPullEnabled) - populate(objectMap, "autoGeneratedDomainNameLabelScope", r.AutoGeneratedDomainNameLabelScope) - populateDateTimeRFC3339(objectMap, "creationDate", r.CreationDate) - populate(objectMap, "dataEndpointEnabled", r.DataEndpointEnabled) - populate(objectMap, "dataEndpointHostNames", r.DataEndpointHostNames) - populate(objectMap, "encryption", r.Encryption) - populate(objectMap, "loginServer", r.LoginServer) - populate(objectMap, "networkRuleBypassAllowedForTasks", r.NetworkRuleBypassAllowedForTasks) - populate(objectMap, "networkRuleBypassOptions", r.NetworkRuleBypassOptions) - populate(objectMap, "networkRuleSet", r.NetworkRuleSet) - populate(objectMap, "policies", r.Policies) - populate(objectMap, "privateEndpointConnections", r.PrivateEndpointConnections) - populate(objectMap, "provisioningState", r.ProvisioningState) - populate(objectMap, "publicNetworkAccess", r.PublicNetworkAccess) - populate(objectMap, "roleAssignmentMode", r.RoleAssignmentMode) - populate(objectMap, "status", r.Status) - populate(objectMap, "zoneRedundancy", r.ZoneRedundancy) + populate(objectMap, "credentials", i.Credentials) + populate(objectMap, "registryUri", i.RegistryURI) + populate(objectMap, "resourceId", i.ResourceID) + populate(objectMap, "sourceImage", i.SourceImage) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RegistryProperties. -func (r *RegistryProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ImportSource. +func (i *ImportSource) 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", r, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "adminUserEnabled": - err = unpopulate(val, "AdminUserEnabled", &r.AdminUserEnabled) - delete(rawMsg, key) - case "anonymousPullEnabled": - err = unpopulate(val, "AnonymousPullEnabled", &r.AnonymousPullEnabled) - delete(rawMsg, key) - case "autoGeneratedDomainNameLabelScope": - err = unpopulate(val, "AutoGeneratedDomainNameLabelScope", &r.AutoGeneratedDomainNameLabelScope) - delete(rawMsg, key) - case "creationDate": - err = unpopulateDateTimeRFC3339(val, "CreationDate", &r.CreationDate) - delete(rawMsg, key) - case "dataEndpointEnabled": - err = unpopulate(val, "DataEndpointEnabled", &r.DataEndpointEnabled) - delete(rawMsg, key) - case "dataEndpointHostNames": - err = unpopulate(val, "DataEndpointHostNames", &r.DataEndpointHostNames) - delete(rawMsg, key) - case "encryption": - err = unpopulate(val, "Encryption", &r.Encryption) - delete(rawMsg, key) - case "loginServer": - err = unpopulate(val, "LoginServer", &r.LoginServer) - delete(rawMsg, key) - case "networkRuleBypassAllowedForTasks": - err = unpopulate(val, "NetworkRuleBypassAllowedForTasks", &r.NetworkRuleBypassAllowedForTasks) - delete(rawMsg, key) - case "networkRuleBypassOptions": - err = unpopulate(val, "NetworkRuleBypassOptions", &r.NetworkRuleBypassOptions) - delete(rawMsg, key) - case "networkRuleSet": - err = unpopulate(val, "NetworkRuleSet", &r.NetworkRuleSet) - delete(rawMsg, key) - case "policies": - err = unpopulate(val, "Policies", &r.Policies) - delete(rawMsg, key) - case "privateEndpointConnections": - err = unpopulate(val, "PrivateEndpointConnections", &r.PrivateEndpointConnections) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) - delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &r.PublicNetworkAccess) + case "credentials": + err = unpopulate(val, "Credentials", &i.Credentials) delete(rawMsg, key) - case "roleAssignmentMode": - err = unpopulate(val, "RoleAssignmentMode", &r.RoleAssignmentMode) + case "registryUri": + err = unpopulate(val, "RegistryURI", &i.RegistryURI) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &r.Status) + case "resourceId": + err = unpopulate(val, "ResourceID", &i.ResourceID) delete(rawMsg, key) - case "zoneRedundancy": - err = unpopulate(val, "ZoneRedundancy", &r.ZoneRedundancy) + case "sourceImage": + err = unpopulate(val, "SourceImage", &i.SourceImage) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RegistryPropertiesUpdateParameters. -func (r RegistryPropertiesUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ImportSourceCredentials. +func (i ImportSourceCredentials) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "adminUserEnabled", r.AdminUserEnabled) - populate(objectMap, "anonymousPullEnabled", r.AnonymousPullEnabled) - populate(objectMap, "dataEndpointEnabled", r.DataEndpointEnabled) - populate(objectMap, "encryption", r.Encryption) - populate(objectMap, "networkRuleBypassAllowedForTasks", r.NetworkRuleBypassAllowedForTasks) - populate(objectMap, "networkRuleBypassOptions", r.NetworkRuleBypassOptions) - populate(objectMap, "networkRuleSet", r.NetworkRuleSet) - populate(objectMap, "policies", r.Policies) - populate(objectMap, "publicNetworkAccess", r.PublicNetworkAccess) - populate(objectMap, "roleAssignmentMode", r.RoleAssignmentMode) + populate(objectMap, "password", i.Password) + populate(objectMap, "username", i.Username) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RegistryPropertiesUpdateParameters. -func (r *RegistryPropertiesUpdateParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ImportSourceCredentials. +func (i *ImportSourceCredentials) 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", r, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "adminUserEnabled": - err = unpopulate(val, "AdminUserEnabled", &r.AdminUserEnabled) - delete(rawMsg, key) - case "anonymousPullEnabled": - err = unpopulate(val, "AnonymousPullEnabled", &r.AnonymousPullEnabled) - delete(rawMsg, key) - case "dataEndpointEnabled": - err = unpopulate(val, "DataEndpointEnabled", &r.DataEndpointEnabled) - delete(rawMsg, key) - case "encryption": - err = unpopulate(val, "Encryption", &r.Encryption) - delete(rawMsg, key) - case "networkRuleBypassAllowedForTasks": - err = unpopulate(val, "NetworkRuleBypassAllowedForTasks", &r.NetworkRuleBypassAllowedForTasks) - delete(rawMsg, key) - case "networkRuleBypassOptions": - err = unpopulate(val, "NetworkRuleBypassOptions", &r.NetworkRuleBypassOptions) - delete(rawMsg, key) - case "networkRuleSet": - err = unpopulate(val, "NetworkRuleSet", &r.NetworkRuleSet) - delete(rawMsg, key) - case "policies": - err = unpopulate(val, "Policies", &r.Policies) - delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &r.PublicNetworkAccess) + case "password": + err = unpopulate(val, "Password", &i.Password) delete(rawMsg, key) - case "roleAssignmentMode": - err = unpopulate(val, "RoleAssignmentMode", &r.RoleAssignmentMode) + case "username": + err = unpopulate(val, "Username", &i.Username) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RegistryUpdateParameters. -func (r RegistryUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type KeyVaultProperties. +func (k KeyVaultProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "identity", r.Identity) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "sku", r.SKU) - populate(objectMap, "tags", r.Tags) + populate(objectMap, "identity", k.Identity) + populate(objectMap, "keyIdentifier", k.KeyIdentifier) + populate(objectMap, "keyRotationEnabled", k.KeyRotationEnabled) + populateTime[datetime.RFC3339](objectMap, "lastKeyRotationTimestamp", k.LastKeyRotationTimestamp) + populate(objectMap, "versionedKeyIdentifier", k.VersionedKeyIdentifier) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RegistryUpdateParameters. -func (r *RegistryUpdateParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultProperties. +func (k *KeyVaultProperties) 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", r, err) + return fmt.Errorf("unmarshalling type %T: %v", k, err) } for key, val := range rawMsg { var err error switch key { case "identity": - err = unpopulate(val, "Identity", &r.Identity) + err = unpopulate(val, "Identity", &k.Identity) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &r.Properties) + case "keyIdentifier": + err = unpopulate(val, "KeyIdentifier", &k.KeyIdentifier) delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &r.SKU) + case "keyRotationEnabled": + err = unpopulate(val, "KeyRotationEnabled", &k.KeyRotationEnabled) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &r.Tags) + case "lastKeyRotationTimestamp": + err = unpopulateTime[datetime.RFC3339](val, "LastKeyRotationTimestamp", &k.LastKeyRotationTimestamp) + delete(rawMsg, key) + case "versionedKeyIdentifier": + err = unpopulate(val, "VersionedKeyIdentifier", &k.VersionedKeyIdentifier) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", k, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RegistryUsage. -func (r RegistryUsage) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LoggingProperties. +func (l LoggingProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "currentValue", r.CurrentValue) - populate(objectMap, "limit", r.Limit) - populate(objectMap, "name", r.Name) - populate(objectMap, "unit", r.Unit) + populate(objectMap, "auditLogStatus", l.AuditLogStatus) + populate(objectMap, "logLevel", l.LogLevel) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RegistryUsage. -func (r *RegistryUsage) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LoggingProperties. +func (l *LoggingProperties) 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", r, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "currentValue": - err = unpopulate(val, "CurrentValue", &r.CurrentValue) - delete(rawMsg, key) - case "limit": - err = unpopulate(val, "Limit", &r.Limit) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) + case "auditLogStatus": + err = unpopulate(val, "AuditLogStatus", &l.AuditLogStatus) delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &r.Unit) + case "logLevel": + err = unpopulate(val, "LogLevel", &l.LogLevel) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RegistryUsageListResult. -func (r RegistryUsageListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LoginServerProperties. +func (l LoginServerProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", r.Value) + populate(objectMap, "host", l.Host) + populate(objectMap, "tls", l.TLS) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RegistryUsageListResult. -func (r *RegistryUsageListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LoginServerProperties. +func (l *LoginServerProperties) 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", r, err) + 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", &r.Value) + case "host": + err = unpopulate(val, "Host", &l.Host) + delete(rawMsg, key) + case "tls": + err = unpopulate(val, "TLS", &l.TLS) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Replication. -func (r Replication) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkRuleSet. +func (n NetworkRuleSet) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", r.ID) - populate(objectMap, "location", r.Location) - populate(objectMap, "name", r.Name) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "systemData", r.SystemData) - populate(objectMap, "tags", r.Tags) - populate(objectMap, "type", r.Type) + populate(objectMap, "defaultAction", n.DefaultAction) + populate(objectMap, "ipRules", n.IPRules) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Replication. -func (r *Replication) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkRuleSet. +func (n *NetworkRuleSet) 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", r, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &r.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &r.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &r.SystemData) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &r.Tags) + case "defaultAction": + err = unpopulate(val, "DefaultAction", &n.DefaultAction) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) + case "ipRules": + err = unpopulate(val, "IPRules", &n.IPRules) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ReplicationListResult. -func (r ReplicationListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OperationDefinition. +func (o OperationDefinition) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", r.NextLink) - populate(objectMap, "value", r.Value) + populate(objectMap, "display", o.Display) + populate(objectMap, "isDataAction", o.IsDataAction) + populate(objectMap, "name", o.Name) + populate(objectMap, "origin", o.Origin) + populate(objectMap, "properties", o.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicationListResult. -func (r *ReplicationListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDefinition. +func (o *OperationDefinition) 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", r, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &r.NextLink) + case "display": + err = unpopulate(val, "Display", &o.Display) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &r.Value) + case "isDataAction": + err = unpopulate(val, "IsDataAction", &o.IsDataAction) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "origin": + err = unpopulate(val, "Origin", &o.Origin) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ReplicationProperties. -func (r ReplicationProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OperationDisplayDefinition. +func (o OperationDisplayDefinition) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "provisioningState", r.ProvisioningState) - populate(objectMap, "regionEndpointEnabled", r.RegionEndpointEnabled) - populate(objectMap, "status", r.Status) - populate(objectMap, "zoneRedundancy", r.ZoneRedundancy) + populate(objectMap, "description", o.Description) + populate(objectMap, "operation", o.Operation) + populate(objectMap, "provider", o.Provider) + populate(objectMap, "resource", o.Resource) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicationProperties. -func (r *ReplicationProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplayDefinition. +func (o *OperationDisplayDefinition) 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", r, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) + case "description": + err = unpopulate(val, "Description", &o.Description) delete(rawMsg, key) - case "regionEndpointEnabled": - err = unpopulate(val, "RegionEndpointEnabled", &r.RegionEndpointEnabled) + case "operation": + err = unpopulate(val, "Operation", &o.Operation) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &r.Status) + case "provider": + err = unpopulate(val, "Provider", &o.Provider) delete(rawMsg, key) - case "zoneRedundancy": - err = unpopulate(val, "ZoneRedundancy", &r.ZoneRedundancy) + case "resource": + err = unpopulate(val, "Resource", &o.Resource) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ReplicationUpdateParameters. -func (r ReplicationUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OperationListResult. +func (o OperationListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "tags", r.Tags) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicationUpdateParameters. -func (r *ReplicationUpdateParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult. +func (o *OperationListResult) 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", r, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &r.Properties) + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &r.Tags) + case "value": + err = unpopulate(val, "Value", &o.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ReplicationUpdateParametersProperties. -func (r ReplicationUpdateParametersProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OperationLogSpecificationDefinition. +func (o OperationLogSpecificationDefinition) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "regionEndpointEnabled", r.RegionEndpointEnabled) + populate(objectMap, "blobDuration", o.BlobDuration) + populate(objectMap, "displayName", o.DisplayName) + populate(objectMap, "name", o.Name) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicationUpdateParametersProperties. -func (r *ReplicationUpdateParametersProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationLogSpecificationDefinition. +func (o *OperationLogSpecificationDefinition) 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", r, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "regionEndpointEnabled": - err = unpopulate(val, "RegionEndpointEnabled", &r.RegionEndpointEnabled) + case "blobDuration": + err = unpopulate(val, "BlobDuration", &o.BlobDuration) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &o.DisplayName) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Request. -func (r Request) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OperationMetricSpecificationDefinition. +func (o OperationMetricSpecificationDefinition) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "addr", r.Addr) - populate(objectMap, "host", r.Host) - populate(objectMap, "id", r.ID) - populate(objectMap, "method", r.Method) - populate(objectMap, "useragent", r.Useragent) + populate(objectMap, "aggregationType", o.AggregationType) + populate(objectMap, "displayDescription", o.DisplayDescription) + populate(objectMap, "displayName", o.DisplayName) + populate(objectMap, "internalMetricName", o.InternalMetricName) + populate(objectMap, "name", o.Name) + populate(objectMap, "unit", o.Unit) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Request. -func (r *Request) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationMetricSpecificationDefinition. +func (o *OperationMetricSpecificationDefinition) 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", r, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "addr": - err = unpopulate(val, "Addr", &r.Addr) + case "aggregationType": + err = unpopulate(val, "AggregationType", &o.AggregationType) delete(rawMsg, key) - case "host": - err = unpopulate(val, "Host", &r.Host) + case "displayDescription": + err = unpopulate(val, "DisplayDescription", &o.DisplayDescription) delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &r.ID) + case "displayName": + err = unpopulate(val, "DisplayName", &o.DisplayName) delete(rawMsg, key) - case "method": - err = unpopulate(val, "Method", &r.Method) + case "internalMetricName": + err = unpopulate(val, "InternalMetricName", &o.InternalMetricName) delete(rawMsg, key) - case "useragent": - err = unpopulate(val, "Useragent", &r.Useragent) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &o.Unit) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RetentionPolicy. -func (r RetentionPolicy) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OperationPropertiesDefinition. +func (o OperationPropertiesDefinition) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "days", r.Days) - populateDateTimeRFC3339(objectMap, "lastUpdatedTime", r.LastUpdatedTime) - populate(objectMap, "status", r.Status) + populate(objectMap, "serviceSpecification", o.ServiceSpecification) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RetentionPolicy. -func (r *RetentionPolicy) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationPropertiesDefinition. +func (o *OperationPropertiesDefinition) 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", r, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "days": - err = unpopulate(val, "Days", &r.Days) - delete(rawMsg, key) - case "lastUpdatedTime": - err = unpopulateDateTimeRFC3339(val, "LastUpdatedTime", &r.LastUpdatedTime) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &r.Status) + case "serviceSpecification": + err = unpopulate(val, "ServiceSpecification", &o.ServiceSpecification) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Run. -func (r Run) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OperationServiceSpecificationDefinition. +func (o OperationServiceSpecificationDefinition) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", r.ID) - populate(objectMap, "name", r.Name) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "systemData", r.SystemData) - populate(objectMap, "type", r.Type) + populate(objectMap, "logSpecifications", o.LogSpecifications) + populate(objectMap, "metricSpecifications", o.MetricSpecifications) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Run. -func (r *Run) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationServiceSpecificationDefinition. +func (o *OperationServiceSpecificationDefinition) 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", r, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &r.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &r.SystemData) + case "logSpecifications": + err = unpopulate(val, "LogSpecifications", &o.LogSpecifications) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) + case "metricSpecifications": + err = unpopulate(val, "MetricSpecifications", &o.MetricSpecifications) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RunGetLogResult. -func (r RunGetLogResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ParentProperties. +func (p ParentProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "logArtifactLink", r.LogArtifactLink) - populate(objectMap, "logLink", r.LogLink) + populate(objectMap, "id", p.ID) + populate(objectMap, "syncProperties", p.SyncProperties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RunGetLogResult. -func (r *RunGetLogResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ParentProperties. +func (p *ParentProperties) 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", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "logArtifactLink": - err = unpopulate(val, "LogArtifactLink", &r.LogArtifactLink) + case "id": + err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) - case "logLink": - err = unpopulate(val, "LogLink", &r.LogLink) + case "syncProperties": + err = unpopulate(val, "SyncProperties", &p.SyncProperties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RunListResult. -func (r RunListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Policies. +func (p Policies) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", r.NextLink) - populate(objectMap, "value", r.Value) + populate(objectMap, "azureADAuthenticationAsArmPolicy", p.AzureADAuthenticationAsArmPolicy) + populate(objectMap, "exportPolicy", p.ExportPolicy) + populate(objectMap, "quarantinePolicy", p.QuarantinePolicy) + populate(objectMap, "retentionPolicy", p.RetentionPolicy) + populate(objectMap, "trustPolicy", p.TrustPolicy) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RunListResult. -func (r *RunListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Policies. +func (p *Policies) 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", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &r.NextLink) + case "azureADAuthenticationAsArmPolicy": + err = unpopulate(val, "AzureADAuthenticationAsArmPolicy", &p.AzureADAuthenticationAsArmPolicy) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &r.Value) + case "exportPolicy": + err = unpopulate(val, "ExportPolicy", &p.ExportPolicy) + delete(rawMsg, key) + case "quarantinePolicy": + err = unpopulate(val, "QuarantinePolicy", &p.QuarantinePolicy) + delete(rawMsg, key) + case "retentionPolicy": + err = unpopulate(val, "RetentionPolicy", &p.RetentionPolicy) + delete(rawMsg, key) + case "trustPolicy": + err = unpopulate(val, "TrustPolicy", &p.TrustPolicy) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RunProperties. -func (r RunProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpoint. +func (p PrivateEndpoint) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "agentConfiguration", r.AgentConfiguration) - populate(objectMap, "agentPoolName", r.AgentPoolName) - populateDateTimeRFC3339(objectMap, "createTime", r.CreateTime) - populate(objectMap, "customRegistries", r.CustomRegistries) - populateDateTimeRFC3339(objectMap, "finishTime", r.FinishTime) - populate(objectMap, "imageUpdateTrigger", r.ImageUpdateTrigger) - populate(objectMap, "isArchiveEnabled", r.IsArchiveEnabled) - populateDateTimeRFC3339(objectMap, "lastUpdatedTime", r.LastUpdatedTime) - populate(objectMap, "logArtifact", r.LogArtifact) - populate(objectMap, "outputImages", r.OutputImages) - populate(objectMap, "platform", r.Platform) - populate(objectMap, "provisioningState", r.ProvisioningState) - populate(objectMap, "runErrorMessage", r.RunErrorMessage) - populate(objectMap, "runId", r.RunID) - populate(objectMap, "runType", r.RunType) - populate(objectMap, "sourceRegistryAuth", r.SourceRegistryAuth) - populate(objectMap, "sourceTrigger", r.SourceTrigger) - populateDateTimeRFC3339(objectMap, "startTime", r.StartTime) - populate(objectMap, "status", r.Status) - populate(objectMap, "task", r.Task) - populate(objectMap, "timerTrigger", r.TimerTrigger) - populate(objectMap, "updateTriggerToken", r.UpdateTriggerToken) + populate(objectMap, "id", p.ID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RunProperties. -func (r *RunProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpoint. +func (p *PrivateEndpoint) 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", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "agentConfiguration": - err = unpopulate(val, "AgentConfiguration", &r.AgentConfiguration) - delete(rawMsg, key) - case "agentPoolName": - err = unpopulate(val, "AgentPoolName", &r.AgentPoolName) - delete(rawMsg, key) - case "createTime": - err = unpopulateDateTimeRFC3339(val, "CreateTime", &r.CreateTime) - delete(rawMsg, key) - case "customRegistries": - err = unpopulate(val, "CustomRegistries", &r.CustomRegistries) - delete(rawMsg, key) - case "finishTime": - err = unpopulateDateTimeRFC3339(val, "FinishTime", &r.FinishTime) - delete(rawMsg, key) - case "imageUpdateTrigger": - err = unpopulate(val, "ImageUpdateTrigger", &r.ImageUpdateTrigger) - delete(rawMsg, key) - case "isArchiveEnabled": - err = unpopulate(val, "IsArchiveEnabled", &r.IsArchiveEnabled) - delete(rawMsg, key) - case "lastUpdatedTime": - err = unpopulateDateTimeRFC3339(val, "LastUpdatedTime", &r.LastUpdatedTime) - delete(rawMsg, key) - case "logArtifact": - err = unpopulate(val, "LogArtifact", &r.LogArtifact) - delete(rawMsg, key) - case "outputImages": - err = unpopulate(val, "OutputImages", &r.OutputImages) - delete(rawMsg, key) - case "platform": - err = unpopulate(val, "Platform", &r.Platform) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) - delete(rawMsg, key) - case "runErrorMessage": - err = unpopulate(val, "RunErrorMessage", &r.RunErrorMessage) - delete(rawMsg, key) - case "runId": - err = unpopulate(val, "RunID", &r.RunID) - delete(rawMsg, key) - case "runType": - err = unpopulate(val, "RunType", &r.RunType) - delete(rawMsg, key) - case "sourceRegistryAuth": - err = unpopulate(val, "SourceRegistryAuth", &r.SourceRegistryAuth) - delete(rawMsg, key) - case "sourceTrigger": - err = unpopulate(val, "SourceTrigger", &r.SourceTrigger) - delete(rawMsg, key) - case "startTime": - err = unpopulateDateTimeRFC3339(val, "StartTime", &r.StartTime) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &r.Status) - delete(rawMsg, key) - case "task": - err = unpopulate(val, "Task", &r.Task) - delete(rawMsg, key) - case "timerTrigger": - err = unpopulate(val, "TimerTrigger", &r.TimerTrigger) - delete(rawMsg, key) - case "updateTriggerToken": - err = unpopulate(val, "UpdateTriggerToken", &r.UpdateTriggerToken) + case "id": + err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RunRequest. -func (r RunRequest) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection. +func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "agentPoolName", r.AgentPoolName) - populate(objectMap, "isArchiveEnabled", r.IsArchiveEnabled) - populate(objectMap, "logTemplate", r.LogTemplate) - objectMap["type"] = r.Type + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RunRequest. -func (r *RunRequest) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnection. +func (p *PrivateEndpointConnection) 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", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "agentPoolName": - err = unpopulate(val, "AgentPoolName", &r.AgentPoolName) + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) - case "isArchiveEnabled": - err = unpopulate(val, "IsArchiveEnabled", &r.IsArchiveEnabled) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) - case "logTemplate": - err = unpopulate(val, "LogTemplate", &r.LogTemplate) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &r.Type) + err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RunUpdateParameters. -func (r RunUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult. +func (p PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "isArchiveEnabled", r.IsArchiveEnabled) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RunUpdateParameters. -func (r *RunUpdateParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionListResult. +func (p *PrivateEndpointConnectionListResult) 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", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "isArchiveEnabled": - err = unpopulate(val, "IsArchiveEnabled", &r.IsArchiveEnabled) + case "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type SKU. -func (s SKU) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties. +func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "name", s.Name) - populate(objectMap, "tier", s.Tier) + populate(objectMap, "privateEndpoint", p.PrivateEndpoint) + populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) + populate(objectMap, "provisioningState", p.ProvisioningState) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SKU. -func (s *SKU) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionProperties. +func (p *PrivateEndpointConnectionProperties) 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", s, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "name": - err = unpopulate(val, "Name", &s.Name) + case "privateEndpoint": + err = unpopulate(val, "PrivateEndpoint", &p.PrivateEndpoint) delete(rawMsg, key) - case "tier": - err = unpopulate(val, "Tier", &s.Tier) + case "privateLinkServiceConnectionState": + err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ScopeMap. -func (s ScopeMap) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource. +func (p PrivateLinkResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", s.ID) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "systemData", s.SystemData) - populate(objectMap, "type", s.Type) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ScopeMap. -func (s *ScopeMap) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResource. +func (p *PrivateLinkResource) 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", s, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { case "id": - err = unpopulate(val, "ID", &s.ID) + err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &s.Name) + err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &s.Properties) + err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) case "systemData": - err = unpopulate(val, "SystemData", &s.SystemData) + err = unpopulate(val, "SystemData", &p.SystemData) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &s.Type) + err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ScopeMapListResult. -func (s ScopeMapListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult. +func (p PrivateLinkResourceListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ScopeMapListResult. -func (s *ScopeMapListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceListResult. +func (p *PrivateLinkResourceListResult) 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", s, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) + err = unpopulate(val, "NextLink", &p.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &s.Value) + err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ScopeMapProperties. -func (s ScopeMapProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties. +func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "actions", s.Actions) - populateDateTimeRFC3339(objectMap, "creationDate", s.CreationDate) - populate(objectMap, "description", s.Description) - populate(objectMap, "provisioningState", s.ProvisioningState) - populate(objectMap, "type", s.Type) + populate(objectMap, "groupId", p.GroupID) + populate(objectMap, "requiredMembers", p.RequiredMembers) + populate(objectMap, "requiredZoneNames", p.RequiredZoneNames) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ScopeMapProperties. -func (s *ScopeMapProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceProperties. +func (p *PrivateLinkResourceProperties) 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", s, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "actions": - err = unpopulate(val, "Actions", &s.Actions) - delete(rawMsg, key) - case "creationDate": - err = unpopulateDateTimeRFC3339(val, "CreationDate", &s.CreationDate) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &s.Description) + case "groupId": + err = unpopulate(val, "GroupID", &p.GroupID) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + case "requiredMembers": + err = unpopulate(val, "RequiredMembers", &p.RequiredMembers) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) + case "requiredZoneNames": + err = unpopulate(val, "RequiredZoneNames", &p.RequiredZoneNames) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ScopeMapPropertiesUpdateParameters. -func (s ScopeMapPropertiesUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionState. +func (p PrivateLinkServiceConnectionState) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "actions", s.Actions) - populate(objectMap, "description", s.Description) + populate(objectMap, "actionsRequired", p.ActionsRequired) + populate(objectMap, "description", p.Description) + populate(objectMap, "status", p.Status) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ScopeMapPropertiesUpdateParameters. -func (s *ScopeMapPropertiesUpdateParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceConnectionState. +func (p *PrivateLinkServiceConnectionState) 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", s, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "actions": - err = unpopulate(val, "Actions", &s.Actions) + case "actionsRequired": + err = unpopulate(val, "ActionsRequired", &p.ActionsRequired) delete(rawMsg, key) case "description": - err = unpopulate(val, "Description", &s.Description) + err = unpopulate(val, "Description", &p.Description) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &p.Status) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ScopeMapUpdateParameters. -func (s ScopeMapUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type QuarantinePolicy. +func (q QuarantinePolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", s.Properties) + populate(objectMap, "status", q.Status) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ScopeMapUpdateParameters. -func (s *ScopeMapUpdateParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type QuarantinePolicy. +func (q *QuarantinePolicy) 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", s, err) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &s.Properties) + case "status": + err = unpopulate(val, "Status", &q.Status) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type SecretObject. -func (s SecretObject) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RegenerateCredentialParameters. +func (r RegenerateCredentialParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "type", s.Type) - populate(objectMap, "value", s.Value) + populate(objectMap, "name", r.Name) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SecretObject. -func (s *SecretObject) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RegenerateCredentialParameters. +func (r *RegenerateCredentialParameters) 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", s, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "type": - err = unpopulate(val, "Type", &s.Type) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Registry. +func (r Registry) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", r.ID) + populate(objectMap, "identity", r.Identity) + populate(objectMap, "location", r.Location) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "sku", r.SKU) + populate(objectMap, "systemData", r.SystemData) + populate(objectMap, "tags", r.Tags) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Registry. +func (r *Registry) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &r.Identity) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &r.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) + case "sku": + err = unpopulate(val, "SKU", &r.SKU) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &r.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &r.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type SetValue. -func (s SetValue) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RegistryListCredentialsResult. +func (r RegistryListCredentialsResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "isSecret", s.IsSecret) - populate(objectMap, "name", s.Name) - populate(objectMap, "value", s.Value) + populate(objectMap, "passwords", r.Passwords) + populate(objectMap, "username", r.Username) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SetValue. -func (s *SetValue) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RegistryListCredentialsResult. +func (r *RegistryListCredentialsResult) 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", s, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "isSecret": - err = unpopulate(val, "IsSecret", &s.IsSecret) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) + case "passwords": + err = unpopulate(val, "Passwords", &r.Passwords) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) + case "username": + err = unpopulate(val, "Username", &r.Username) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Source. -func (s Source) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RegistryListResult. +func (r RegistryListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "addr", s.Addr) - populate(objectMap, "instanceID", s.InstanceID) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Source. -func (s *Source) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RegistryListResult. +func (r *RegistryListResult) 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", s, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "addr": - err = unpopulate(val, "Addr", &s.Addr) + case "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) delete(rawMsg, key) - case "instanceID": - err = unpopulate(val, "InstanceID", &s.InstanceID) + case "value": + err = unpopulate(val, "Value", &r.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type SourceProperties. -func (s SourceProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RegistryNameCheckRequest. +func (r RegistryNameCheckRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "branch", s.Branch) - populate(objectMap, "repositoryUrl", s.RepositoryURL) - populate(objectMap, "sourceControlAuthProperties", s.SourceControlAuthProperties) - populate(objectMap, "sourceControlType", s.SourceControlType) + populate(objectMap, "name", r.Name) + objectMap["type"] = "Microsoft.ContainerRegistry/registries" return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SourceProperties. -func (s *SourceProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RegistryNameCheckRequest. +func (r *RegistryNameCheckRequest) 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", s, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "branch": - err = unpopulate(val, "Branch", &s.Branch) - delete(rawMsg, key) - case "repositoryUrl": - err = unpopulate(val, "RepositoryURL", &s.RepositoryURL) - delete(rawMsg, key) - case "sourceControlAuthProperties": - err = unpopulate(val, "SourceControlAuthProperties", &s.SourceControlAuthProperties) + case "name": + err = unpopulate(val, "Name", &r.Name) delete(rawMsg, key) - case "sourceControlType": - err = unpopulate(val, "SourceControlType", &s.SourceControlType) + case "type": + err = unpopulate(val, "Type", &r.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type SourceRegistryCredentials. -func (s SourceRegistryCredentials) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RegistryNameStatus. +func (r RegistryNameStatus) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "identity", s.Identity) - populate(objectMap, "loginMode", s.LoginMode) + populate(objectMap, "message", r.Message) + populate(objectMap, "nameAvailable", r.NameAvailable) + populate(objectMap, "reason", r.Reason) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SourceRegistryCredentials. -func (s *SourceRegistryCredentials) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RegistryNameStatus. +func (r *RegistryNameStatus) 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", s, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "identity": - err = unpopulate(val, "Identity", &s.Identity) + case "message": + err = unpopulate(val, "Message", &r.Message) delete(rawMsg, key) - case "loginMode": - err = unpopulate(val, "LoginMode", &s.LoginMode) + case "nameAvailable": + err = unpopulate(val, "NameAvailable", &r.NameAvailable) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &r.Reason) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type SourceTrigger. -func (s SourceTrigger) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RegistryPassword. +func (r RegistryPassword) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "name", s.Name) - populate(objectMap, "sourceRepository", s.SourceRepository) - populate(objectMap, "sourceTriggerEvents", s.SourceTriggerEvents) - populate(objectMap, "status", s.Status) + populate(objectMap, "name", r.Name) + populate(objectMap, "value", r.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SourceTrigger. -func (s *SourceTrigger) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RegistryPassword. +func (r *RegistryPassword) 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", s, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "sourceRepository": - err = unpopulate(val, "SourceRepository", &s.SourceRepository) - delete(rawMsg, key) - case "sourceTriggerEvents": - err = unpopulate(val, "SourceTriggerEvents", &s.SourceTriggerEvents) + err = unpopulate(val, "Name", &r.Name) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &s.Status) + case "value": + err = unpopulate(val, "Value", &r.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type SourceTriggerDescriptor. -func (s SourceTriggerDescriptor) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RegistryProperties. +func (r RegistryProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "branchName", s.BranchName) - populate(objectMap, "commitId", s.CommitID) - populate(objectMap, "eventType", s.EventType) - populate(objectMap, "id", s.ID) - populate(objectMap, "providerType", s.ProviderType) - populate(objectMap, "pullRequestId", s.PullRequestID) - populate(objectMap, "repositoryUrl", s.RepositoryURL) + populate(objectMap, "adminUserEnabled", r.AdminUserEnabled) + populate(objectMap, "anonymousPullEnabled", r.AnonymousPullEnabled) + populateTime[datetime.RFC3339](objectMap, "creationDate", r.CreationDate) + populate(objectMap, "dataEndpointEnabled", r.DataEndpointEnabled) + populate(objectMap, "dataEndpointHostNames", r.DataEndpointHostNames) + populate(objectMap, "encryption", r.Encryption) + populate(objectMap, "loginServer", r.LoginServer) + populate(objectMap, "networkRuleBypassAllowedForTasks", r.NetworkRuleBypassAllowedForTasks) + populate(objectMap, "networkRuleBypassOptions", r.NetworkRuleBypassOptions) + populate(objectMap, "networkRuleSet", r.NetworkRuleSet) + populate(objectMap, "policies", r.Policies) + populate(objectMap, "privateEndpointConnections", r.PrivateEndpointConnections) + populate(objectMap, "provisioningState", r.ProvisioningState) + populate(objectMap, "publicNetworkAccess", r.PublicNetworkAccess) + populate(objectMap, "roleAssignmentMode", r.RoleAssignmentMode) + populate(objectMap, "status", r.Status) + populate(objectMap, "zoneRedundancy", r.ZoneRedundancy) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SourceTriggerDescriptor. -func (s *SourceTriggerDescriptor) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RegistryProperties. +func (r *RegistryProperties) 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", s, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "branchName": - err = unpopulate(val, "BranchName", &s.BranchName) + case "adminUserEnabled": + err = unpopulate(val, "AdminUserEnabled", &r.AdminUserEnabled) delete(rawMsg, key) - case "commitId": - err = unpopulate(val, "CommitID", &s.CommitID) + case "anonymousPullEnabled": + err = unpopulate(val, "AnonymousPullEnabled", &r.AnonymousPullEnabled) delete(rawMsg, key) - case "eventType": - err = unpopulate(val, "EventType", &s.EventType) + case "creationDate": + err = unpopulateTime[datetime.RFC3339](val, "CreationDate", &r.CreationDate) delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &s.ID) + case "dataEndpointEnabled": + err = unpopulate(val, "DataEndpointEnabled", &r.DataEndpointEnabled) delete(rawMsg, key) - case "providerType": - err = unpopulate(val, "ProviderType", &s.ProviderType) + case "dataEndpointHostNames": + err = unpopulate(val, "DataEndpointHostNames", &r.DataEndpointHostNames) delete(rawMsg, key) - case "pullRequestId": - err = unpopulate(val, "PullRequestID", &s.PullRequestID) + case "encryption": + err = unpopulate(val, "Encryption", &r.Encryption) delete(rawMsg, key) - case "repositoryUrl": - err = unpopulate(val, "RepositoryURL", &s.RepositoryURL) + case "loginServer": + err = unpopulate(val, "LoginServer", &r.LoginServer) delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SourceTriggerUpdateParameters. -func (s SourceTriggerUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", s.Name) - populate(objectMap, "sourceRepository", s.SourceRepository) - populate(objectMap, "sourceTriggerEvents", s.SourceTriggerEvents) - populate(objectMap, "status", s.Status) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SourceTriggerUpdateParameters. -func (s *SourceTriggerUpdateParameters) 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", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &s.Name) + case "networkRuleBypassAllowedForTasks": + err = unpopulate(val, "NetworkRuleBypassAllowedForTasks", &r.NetworkRuleBypassAllowedForTasks) delete(rawMsg, key) - case "sourceRepository": - err = unpopulate(val, "SourceRepository", &s.SourceRepository) + case "networkRuleBypassOptions": + err = unpopulate(val, "NetworkRuleBypassOptions", &r.NetworkRuleBypassOptions) + delete(rawMsg, key) + case "networkRuleSet": + err = unpopulate(val, "NetworkRuleSet", &r.NetworkRuleSet) + delete(rawMsg, key) + case "policies": + err = unpopulate(val, "Policies", &r.Policies) + delete(rawMsg, key) + case "privateEndpointConnections": + err = unpopulate(val, "PrivateEndpointConnections", &r.PrivateEndpointConnections) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) + delete(rawMsg, key) + case "publicNetworkAccess": + err = unpopulate(val, "PublicNetworkAccess", &r.PublicNetworkAccess) delete(rawMsg, key) - case "sourceTriggerEvents": - err = unpopulate(val, "SourceTriggerEvents", &s.SourceTriggerEvents) + case "roleAssignmentMode": + err = unpopulate(val, "RoleAssignmentMode", &r.RoleAssignmentMode) delete(rawMsg, key) case "status": - err = unpopulate(val, "Status", &s.Status) + err = unpopulate(val, "Status", &r.Status) + delete(rawMsg, key) + case "zoneRedundancy": + err = unpopulate(val, "ZoneRedundancy", &r.ZoneRedundancy) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type SourceUpdateParameters. -func (s SourceUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RegistryPropertiesUpdateParameters. +func (r RegistryPropertiesUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "branch", s.Branch) - populate(objectMap, "repositoryUrl", s.RepositoryURL) - populate(objectMap, "sourceControlAuthProperties", s.SourceControlAuthProperties) - populate(objectMap, "sourceControlType", s.SourceControlType) + populate(objectMap, "adminUserEnabled", r.AdminUserEnabled) + populate(objectMap, "anonymousPullEnabled", r.AnonymousPullEnabled) + populate(objectMap, "dataEndpointEnabled", r.DataEndpointEnabled) + populate(objectMap, "encryption", r.Encryption) + populate(objectMap, "networkRuleBypassAllowedForTasks", r.NetworkRuleBypassAllowedForTasks) + populate(objectMap, "networkRuleBypassOptions", r.NetworkRuleBypassOptions) + populate(objectMap, "networkRuleSet", r.NetworkRuleSet) + populate(objectMap, "policies", r.Policies) + populate(objectMap, "publicNetworkAccess", r.PublicNetworkAccess) + populate(objectMap, "roleAssignmentMode", r.RoleAssignmentMode) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SourceUpdateParameters. -func (s *SourceUpdateParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RegistryPropertiesUpdateParameters. +func (r *RegistryPropertiesUpdateParameters) 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", s, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "branch": - err = unpopulate(val, "Branch", &s.Branch) + case "adminUserEnabled": + err = unpopulate(val, "AdminUserEnabled", &r.AdminUserEnabled) + delete(rawMsg, key) + case "anonymousPullEnabled": + err = unpopulate(val, "AnonymousPullEnabled", &r.AnonymousPullEnabled) + delete(rawMsg, key) + case "dataEndpointEnabled": + err = unpopulate(val, "DataEndpointEnabled", &r.DataEndpointEnabled) + delete(rawMsg, key) + case "encryption": + err = unpopulate(val, "Encryption", &r.Encryption) + delete(rawMsg, key) + case "networkRuleBypassAllowedForTasks": + err = unpopulate(val, "NetworkRuleBypassAllowedForTasks", &r.NetworkRuleBypassAllowedForTasks) delete(rawMsg, key) - case "repositoryUrl": - err = unpopulate(val, "RepositoryURL", &s.RepositoryURL) + case "networkRuleBypassOptions": + err = unpopulate(val, "NetworkRuleBypassOptions", &r.NetworkRuleBypassOptions) + delete(rawMsg, key) + case "networkRuleSet": + err = unpopulate(val, "NetworkRuleSet", &r.NetworkRuleSet) + delete(rawMsg, key) + case "policies": + err = unpopulate(val, "Policies", &r.Policies) delete(rawMsg, key) - case "sourceControlAuthProperties": - err = unpopulate(val, "SourceControlAuthProperties", &s.SourceControlAuthProperties) + case "publicNetworkAccess": + err = unpopulate(val, "PublicNetworkAccess", &r.PublicNetworkAccess) delete(rawMsg, key) - case "sourceControlType": - err = unpopulate(val, "SourceControlType", &s.SourceControlType) + case "roleAssignmentMode": + err = unpopulate(val, "RoleAssignmentMode", &r.RoleAssignmentMode) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type SourceUploadDefinition. -func (s SourceUploadDefinition) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RegistryUpdateParameters. +func (r RegistryUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "relativePath", s.RelativePath) - populate(objectMap, "uploadUrl", s.UploadURL) + populate(objectMap, "identity", r.Identity) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "sku", r.SKU) + populate(objectMap, "tags", r.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SourceUploadDefinition. -func (s *SourceUploadDefinition) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RegistryUpdateParameters. +func (r *RegistryUpdateParameters) 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", s, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "relativePath": - err = unpopulate(val, "RelativePath", &s.RelativePath) + case "identity": + err = unpopulate(val, "Identity", &r.Identity) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &r.SKU) delete(rawMsg, key) - case "uploadUrl": - err = unpopulate(val, "UploadURL", &s.UploadURL) + case "tags": + err = unpopulate(val, "Tags", &r.Tags) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Status. -func (s Status) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RegistryUsage. +func (r RegistryUsage) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "displayStatus", s.DisplayStatus) - populate(objectMap, "message", s.Message) - populateDateTimeRFC3339(objectMap, "timestamp", s.Timestamp) + populate(objectMap, "currentValue", r.CurrentValue) + populate(objectMap, "limit", r.Limit) + populate(objectMap, "name", r.Name) + populate(objectMap, "unit", r.Unit) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Status. -func (s *Status) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RegistryUsage. +func (r *RegistryUsage) 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", s, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "displayStatus": - err = unpopulate(val, "DisplayStatus", &s.DisplayStatus) + case "currentValue": + err = unpopulate(val, "CurrentValue", &r.CurrentValue) delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &s.Message) + case "limit": + err = unpopulate(val, "Limit", &r.Limit) delete(rawMsg, key) - case "timestamp": - err = unpopulateDateTimeRFC3339(val, "Timestamp", &s.Timestamp) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &r.Unit) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type StatusDetailProperties. -func (s StatusDetailProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RegistryUsageListResult. +func (r RegistryUsageListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "code", s.Code) - populate(objectMap, "correlationId", s.CorrelationID) - populate(objectMap, "description", s.Description) - populateDateTimeRFC3339(objectMap, "timestamp", s.Timestamp) - populate(objectMap, "type", s.Type) + populate(objectMap, "value", r.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type StatusDetailProperties. -func (s *StatusDetailProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RegistryUsageListResult. +func (r *RegistryUsageListResult) 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", s, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "code": - err = unpopulate(val, "Code", &s.Code) - delete(rawMsg, key) - case "correlationId": - err = unpopulate(val, "CorrelationID", &s.CorrelationID) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &s.Description) - delete(rawMsg, key) - case "timestamp": - err = unpopulateDateTimeRFC3339(val, "Timestamp", &s.Timestamp) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) + case "value": + err = unpopulate(val, "Value", &r.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type SyncProperties. -func (s SyncProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Replication. +func (r Replication) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "gatewayEndpoint", s.GatewayEndpoint) - populateDateTimeRFC3339(objectMap, "lastSyncTime", s.LastSyncTime) - populate(objectMap, "messageTtl", s.MessageTTL) - populate(objectMap, "schedule", s.Schedule) - populate(objectMap, "syncWindow", s.SyncWindow) - populate(objectMap, "tokenId", s.TokenID) + populate(objectMap, "id", r.ID) + populate(objectMap, "location", r.Location) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "systemData", r.SystemData) + populate(objectMap, "tags", r.Tags) + populate(objectMap, "type", r.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SyncProperties. -func (s *SyncProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Replication. +func (r *Replication) 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", s, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "gatewayEndpoint": - err = unpopulate(val, "GatewayEndpoint", &s.GatewayEndpoint) + case "id": + err = unpopulate(val, "ID", &r.ID) delete(rawMsg, key) - case "lastSyncTime": - err = unpopulateDateTimeRFC3339(val, "LastSyncTime", &s.LastSyncTime) + case "location": + err = unpopulate(val, "Location", &r.Location) delete(rawMsg, key) - case "messageTtl": - err = unpopulate(val, "MessageTTL", &s.MessageTTL) + case "name": + err = unpopulate(val, "Name", &r.Name) delete(rawMsg, key) - case "schedule": - err = unpopulate(val, "Schedule", &s.Schedule) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) delete(rawMsg, key) - case "syncWindow": - err = unpopulate(val, "SyncWindow", &s.SyncWindow) + case "systemData": + err = unpopulate(val, "SystemData", &r.SystemData) delete(rawMsg, key) - case "tokenId": - err = unpopulate(val, "TokenID", &s.TokenID) + case "tags": + err = unpopulate(val, "Tags", &r.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type SyncUpdateProperties. -func (s SyncUpdateProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ReplicationListResult. +func (r ReplicationListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "messageTtl", s.MessageTTL) - populate(objectMap, "schedule", s.Schedule) - populate(objectMap, "syncWindow", s.SyncWindow) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SyncUpdateProperties. -func (s *SyncUpdateProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicationListResult. +func (r *ReplicationListResult) 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", s, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "messageTtl": - err = unpopulate(val, "MessageTTL", &s.MessageTTL) - delete(rawMsg, key) - case "schedule": - err = unpopulate(val, "Schedule", &s.Schedule) + case "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) delete(rawMsg, key) - case "syncWindow": - err = unpopulate(val, "SyncWindow", &s.SyncWindow) + case "value": + err = unpopulate(val, "Value", &r.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type SystemData. -func (s SystemData) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ReplicationProperties. +func (r ReplicationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) - populate(objectMap, "createdBy", s.CreatedBy) - populate(objectMap, "createdByType", s.CreatedByType) - populateDateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) - populate(objectMap, "lastModifiedBy", s.LastModifiedBy) - populate(objectMap, "lastModifiedByType", s.LastModifiedByType) + populate(objectMap, "provisioningState", r.ProvisioningState) + populate(objectMap, "regionEndpointEnabled", r.RegionEndpointEnabled) + populate(objectMap, "status", r.Status) + populate(objectMap, "zoneRedundancy", r.ZoneRedundancy) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. -func (s *SystemData) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicationProperties. +func (r *ReplicationProperties) 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", s, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "createdAt": - err = unpopulateDateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) - delete(rawMsg, key) - case "createdBy": - err = unpopulate(val, "CreatedBy", &s.CreatedBy) - delete(rawMsg, key) - case "createdByType": - err = unpopulate(val, "CreatedByType", &s.CreatedByType) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) delete(rawMsg, key) - case "lastModifiedAt": - err = unpopulateDateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) + case "regionEndpointEnabled": + err = unpopulate(val, "RegionEndpointEnabled", &r.RegionEndpointEnabled) delete(rawMsg, key) - case "lastModifiedBy": - err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) + case "status": + err = unpopulate(val, "Status", &r.Status) delete(rawMsg, key) - case "lastModifiedByType": - err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) + case "zoneRedundancy": + err = unpopulate(val, "ZoneRedundancy", &r.ZoneRedundancy) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type TLSCertificateProperties. -func (t TLSCertificateProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ReplicationUpdateParameters. +func (r ReplicationUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "location", t.Location) - populate(objectMap, "type", t.Type) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "tags", r.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type TLSCertificateProperties. -func (t *TLSCertificateProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicationUpdateParameters. +func (r *ReplicationUpdateParameters) 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", t, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "location": - err = unpopulate(val, "Location", &t.Location) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &t.Type) + case "tags": + err = unpopulate(val, "Tags", &r.Tags) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type TLSProperties. -func (t TLSProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ReplicationUpdateParametersProperties. +func (r ReplicationUpdateParametersProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "certificate", t.Certificate) - populate(objectMap, "status", t.Status) + populate(objectMap, "regionEndpointEnabled", r.RegionEndpointEnabled) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type TLSProperties. -func (t *TLSProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicationUpdateParametersProperties. +func (r *ReplicationUpdateParametersProperties) 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", t, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "certificate": - err = unpopulate(val, "Certificate", &t.Certificate) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &t.Status) + case "regionEndpointEnabled": + err = unpopulate(val, "RegionEndpointEnabled", &r.RegionEndpointEnabled) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Target. -func (t Target) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Request. +func (r Request) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "digest", t.Digest) - populate(objectMap, "length", t.Length) - populate(objectMap, "mediaType", t.MediaType) - populate(objectMap, "name", t.Name) - populate(objectMap, "repository", t.Repository) - populate(objectMap, "size", t.Size) - populate(objectMap, "tag", t.Tag) - populate(objectMap, "url", t.URL) - populate(objectMap, "version", t.Version) + populate(objectMap, "addr", r.Addr) + populate(objectMap, "host", r.Host) + populate(objectMap, "id", r.ID) + populate(objectMap, "method", r.Method) + populate(objectMap, "useragent", r.Useragent) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Target. -func (t *Target) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Request. +func (r *Request) 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", t, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "digest": - err = unpopulate(val, "Digest", &t.Digest) - delete(rawMsg, key) - case "length": - err = unpopulate(val, "Length", &t.Length) - delete(rawMsg, key) - case "mediaType": - err = unpopulate(val, "MediaType", &t.MediaType) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &t.Name) - delete(rawMsg, key) - case "repository": - err = unpopulate(val, "Repository", &t.Repository) + case "addr": + err = unpopulate(val, "Addr", &r.Addr) delete(rawMsg, key) - case "size": - err = unpopulate(val, "Size", &t.Size) + case "host": + err = unpopulate(val, "Host", &r.Host) delete(rawMsg, key) - case "tag": - err = unpopulate(val, "Tag", &t.Tag) + case "id": + err = unpopulate(val, "ID", &r.ID) delete(rawMsg, key) - case "url": - err = unpopulate(val, "URL", &t.URL) + case "method": + err = unpopulate(val, "Method", &r.Method) delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &t.Version) + case "useragent": + err = unpopulate(val, "Useragent", &r.Useragent) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Task. -func (t Task) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RetentionPolicy. +func (r RetentionPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", t.ID) - populate(objectMap, "identity", t.Identity) - populate(objectMap, "location", t.Location) - populate(objectMap, "name", t.Name) - populate(objectMap, "properties", t.Properties) - populate(objectMap, "systemData", t.SystemData) - populate(objectMap, "tags", t.Tags) - populate(objectMap, "type", t.Type) + populate(objectMap, "days", r.Days) + populateTime[datetime.RFC3339](objectMap, "lastUpdatedTime", r.LastUpdatedTime) + populate(objectMap, "status", r.Status) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Task. -func (t *Task) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RetentionPolicy. +func (r *RetentionPolicy) 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", t, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &t.ID) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &t.Identity) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &t.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &t.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &t.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &t.SystemData) + case "days": + err = unpopulate(val, "Days", &r.Days) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &t.Tags) + case "lastUpdatedTime": + err = unpopulateTime[datetime.RFC3339](val, "LastUpdatedTime", &r.LastUpdatedTime) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &t.Type) + case "status": + err = unpopulate(val, "Status", &r.Status) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type TaskListResult. -func (t TaskListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SKU. +func (s SKU) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", t.NextLink) - populate(objectMap, "value", t.Value) + populate(objectMap, "name", s.Name) + populate(objectMap, "tier", s.Tier) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type TaskListResult. -func (t *TaskListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SKU. +func (s *SKU) 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", t, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &t.NextLink) + case "name": + err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &t.Value) + case "tier": + err = unpopulate(val, "Tier", &s.Tier) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type TaskProperties. -func (t TaskProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ScopeMap. +func (s ScopeMap) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "agentConfiguration", t.AgentConfiguration) - populate(objectMap, "agentPoolName", t.AgentPoolName) - populateDateTimeRFC3339(objectMap, "creationDate", t.CreationDate) - populate(objectMap, "credentials", t.Credentials) - populate(objectMap, "isSystemTask", t.IsSystemTask) - populate(objectMap, "logTemplate", t.LogTemplate) - populate(objectMap, "platform", t.Platform) - populate(objectMap, "provisioningState", t.ProvisioningState) - populate(objectMap, "status", t.Status) - populate(objectMap, "step", t.Step) - populate(objectMap, "timeout", t.Timeout) - populate(objectMap, "trigger", t.Trigger) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "type", s.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type TaskProperties. -func (t *TaskProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ScopeMap. +func (s *ScopeMap) 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", t, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "agentConfiguration": - err = unpopulate(val, "AgentConfiguration", &t.AgentConfiguration) - delete(rawMsg, key) - case "agentPoolName": - err = unpopulate(val, "AgentPoolName", &t.AgentPoolName) - delete(rawMsg, key) - case "creationDate": - err = unpopulateDateTimeRFC3339(val, "CreationDate", &t.CreationDate) - delete(rawMsg, key) - case "credentials": - err = unpopulate(val, "Credentials", &t.Credentials) - delete(rawMsg, key) - case "isSystemTask": - err = unpopulate(val, "IsSystemTask", &t.IsSystemTask) - delete(rawMsg, key) - case "logTemplate": - err = unpopulate(val, "LogTemplate", &t.LogTemplate) - delete(rawMsg, key) - case "platform": - err = unpopulate(val, "Platform", &t.Platform) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &t.ProvisioningState) + case "id": + err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &t.Status) + case "name": + err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) - case "step": - t.Step, err = unmarshalTaskStepPropertiesClassification(val) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) - case "timeout": - err = unpopulate(val, "Timeout", &t.Timeout) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) delete(rawMsg, key) - case "trigger": - err = unpopulate(val, "Trigger", &t.Trigger) + case "type": + err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type TaskPropertiesUpdateParameters. -func (t TaskPropertiesUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ScopeMapListResult. +func (s ScopeMapListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "agentConfiguration", t.AgentConfiguration) - populate(objectMap, "agentPoolName", t.AgentPoolName) - populate(objectMap, "credentials", t.Credentials) - populate(objectMap, "logTemplate", t.LogTemplate) - populate(objectMap, "platform", t.Platform) - populate(objectMap, "status", t.Status) - populate(objectMap, "step", t.Step) - populate(objectMap, "timeout", t.Timeout) - populate(objectMap, "trigger", t.Trigger) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type TaskPropertiesUpdateParameters. -func (t *TaskPropertiesUpdateParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ScopeMapListResult. +func (s *ScopeMapListResult) 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", t, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "agentConfiguration": - err = unpopulate(val, "AgentConfiguration", &t.AgentConfiguration) - delete(rawMsg, key) - case "agentPoolName": - err = unpopulate(val, "AgentPoolName", &t.AgentPoolName) - delete(rawMsg, key) - case "credentials": - err = unpopulate(val, "Credentials", &t.Credentials) - delete(rawMsg, key) - case "logTemplate": - err = unpopulate(val, "LogTemplate", &t.LogTemplate) - delete(rawMsg, key) - case "platform": - err = unpopulate(val, "Platform", &t.Platform) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &t.Status) - delete(rawMsg, key) - case "step": - t.Step, err = unmarshalTaskStepUpdateParametersClassification(val) - delete(rawMsg, key) - case "timeout": - err = unpopulate(val, "Timeout", &t.Timeout) + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) delete(rawMsg, key) - case "trigger": - err = unpopulate(val, "Trigger", &t.Trigger) + case "value": + err = unpopulate(val, "Value", &s.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type TaskRun. -func (t TaskRun) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ScopeMapProperties. +func (s ScopeMapProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", t.ID) - populate(objectMap, "identity", t.Identity) - populate(objectMap, "location", t.Location) - populate(objectMap, "name", t.Name) - populate(objectMap, "properties", t.Properties) - populate(objectMap, "systemData", t.SystemData) - populate(objectMap, "type", t.Type) + populate(objectMap, "actions", s.Actions) + populateTime[datetime.RFC3339](objectMap, "creationDate", s.CreationDate) + populate(objectMap, "description", s.Description) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "type", s.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type TaskRun. -func (t *TaskRun) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ScopeMapProperties. +func (s *ScopeMapProperties) 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", t, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &t.ID) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &t.Identity) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &t.Location) + case "actions": + err = unpopulate(val, "Actions", &s.Actions) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &t.Name) + case "creationDate": + err = unpopulateTime[datetime.RFC3339](val, "CreationDate", &s.CreationDate) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &t.Properties) + case "description": + err = unpopulate(val, "Description", &s.Description) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &t.SystemData) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &t.Type) + err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type TaskRunListResult. -func (t TaskRunListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ScopeMapPropertiesUpdateParameters. +func (s ScopeMapPropertiesUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", t.NextLink) - populate(objectMap, "value", t.Value) + populate(objectMap, "actions", s.Actions) + populate(objectMap, "description", s.Description) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type TaskRunListResult. -func (t *TaskRunListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ScopeMapPropertiesUpdateParameters. +func (s *ScopeMapPropertiesUpdateParameters) 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", t, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &t.NextLink) + case "actions": + err = unpopulate(val, "Actions", &s.Actions) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &t.Value) + case "description": + err = unpopulate(val, "Description", &s.Description) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type TaskRunProperties. -func (t TaskRunProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ScopeMapUpdateParameters. +func (s ScopeMapUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "forceUpdateTag", t.ForceUpdateTag) - populate(objectMap, "provisioningState", t.ProvisioningState) - populate(objectMap, "runRequest", t.RunRequest) - populate(objectMap, "runResult", t.RunResult) + populate(objectMap, "properties", s.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type TaskRunProperties. -func (t *TaskRunProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ScopeMapUpdateParameters. +func (s *ScopeMapUpdateParameters) 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", t, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "forceUpdateTag": - err = unpopulate(val, "ForceUpdateTag", &t.ForceUpdateTag) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &t.ProvisioningState) - delete(rawMsg, key) - case "runRequest": - t.RunRequest, err = unmarshalRunRequestClassification(val) - delete(rawMsg, key) - case "runResult": - err = unpopulate(val, "RunResult", &t.RunResult) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type TaskRunPropertiesUpdateParameters. -func (t TaskRunPropertiesUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Source. +func (s Source) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "forceUpdateTag", t.ForceUpdateTag) - populate(objectMap, "runRequest", t.RunRequest) + populate(objectMap, "addr", s.Addr) + populate(objectMap, "instanceID", s.InstanceID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type TaskRunPropertiesUpdateParameters. -func (t *TaskRunPropertiesUpdateParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Source. +func (s *Source) 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", t, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "forceUpdateTag": - err = unpopulate(val, "ForceUpdateTag", &t.ForceUpdateTag) + case "addr": + err = unpopulate(val, "Addr", &s.Addr) delete(rawMsg, key) - case "runRequest": - t.RunRequest, err = unmarshalRunRequestClassification(val) + case "instanceID": + err = unpopulate(val, "InstanceID", &s.InstanceID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type TaskRunRequest. -func (t TaskRunRequest) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Status. +func (s Status) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "agentPoolName", t.AgentPoolName) - populate(objectMap, "isArchiveEnabled", t.IsArchiveEnabled) - populate(objectMap, "logTemplate", t.LogTemplate) - populate(objectMap, "overrideTaskStepProperties", t.OverrideTaskStepProperties) - populate(objectMap, "taskId", t.TaskID) - objectMap["type"] = "TaskRunRequest" + populate(objectMap, "displayStatus", s.DisplayStatus) + populate(objectMap, "message", s.Message) + populateTime[datetime.RFC3339](objectMap, "timestamp", s.Timestamp) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type TaskRunRequest. -func (t *TaskRunRequest) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Status. +func (s *Status) 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", t, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "agentPoolName": - err = unpopulate(val, "AgentPoolName", &t.AgentPoolName) - delete(rawMsg, key) - case "isArchiveEnabled": - err = unpopulate(val, "IsArchiveEnabled", &t.IsArchiveEnabled) - delete(rawMsg, key) - case "logTemplate": - err = unpopulate(val, "LogTemplate", &t.LogTemplate) - delete(rawMsg, key) - case "overrideTaskStepProperties": - err = unpopulate(val, "OverrideTaskStepProperties", &t.OverrideTaskStepProperties) + case "displayStatus": + err = unpopulate(val, "DisplayStatus", &s.DisplayStatus) delete(rawMsg, key) - case "taskId": - err = unpopulate(val, "TaskID", &t.TaskID) + case "message": + err = unpopulate(val, "Message", &s.Message) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &t.Type) + case "timestamp": + err = unpopulateTime[datetime.RFC3339](val, "Timestamp", &s.Timestamp) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type TaskRunUpdateParameters. -func (t TaskRunUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type StatusDetailProperties. +func (s StatusDetailProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "identity", t.Identity) - populate(objectMap, "location", t.Location) - populate(objectMap, "properties", t.Properties) - populate(objectMap, "tags", t.Tags) + populate(objectMap, "code", s.Code) + populate(objectMap, "correlationId", s.CorrelationID) + populate(objectMap, "description", s.Description) + populateTime[datetime.RFC3339](objectMap, "timestamp", s.Timestamp) + populate(objectMap, "type", s.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type TaskRunUpdateParameters. -func (t *TaskRunUpdateParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type StatusDetailProperties. +func (s *StatusDetailProperties) 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", t, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "identity": - err = unpopulate(val, "Identity", &t.Identity) + case "code": + err = unpopulate(val, "Code", &s.Code) delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &t.Location) + case "correlationId": + err = unpopulate(val, "CorrelationID", &s.CorrelationID) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &t.Properties) + case "description": + err = unpopulate(val, "Description", &s.Description) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &t.Tags) + case "timestamp": + err = unpopulateTime[datetime.RFC3339](val, "Timestamp", &s.Timestamp) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type TaskStepProperties. -func (t TaskStepProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SyncProperties. +func (s SyncProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "baseImageDependencies", t.BaseImageDependencies) - populate(objectMap, "contextAccessToken", t.ContextAccessToken) - populate(objectMap, "contextPath", t.ContextPath) - objectMap["type"] = t.Type + populate(objectMap, "gatewayEndpoint", s.GatewayEndpoint) + populateTime[datetime.RFC3339](objectMap, "lastSyncTime", s.LastSyncTime) + populate(objectMap, "messageTtl", s.MessageTTL) + populate(objectMap, "schedule", s.Schedule) + populate(objectMap, "syncWindow", s.SyncWindow) + populate(objectMap, "tokenId", s.TokenID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type TaskStepProperties. -func (t *TaskStepProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncProperties. +func (s *SyncProperties) 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", t, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "baseImageDependencies": - err = unpopulate(val, "BaseImageDependencies", &t.BaseImageDependencies) + case "gatewayEndpoint": + err = unpopulate(val, "GatewayEndpoint", &s.GatewayEndpoint) delete(rawMsg, key) - case "contextAccessToken": - err = unpopulate(val, "ContextAccessToken", &t.ContextAccessToken) + case "lastSyncTime": + err = unpopulateTime[datetime.RFC3339](val, "LastSyncTime", &s.LastSyncTime) delete(rawMsg, key) - case "contextPath": - err = unpopulate(val, "ContextPath", &t.ContextPath) + case "messageTtl": + err = unpopulate(val, "MessageTTL", &s.MessageTTL) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &t.Type) + case "schedule": + err = unpopulate(val, "Schedule", &s.Schedule) + delete(rawMsg, key) + case "syncWindow": + err = unpopulate(val, "SyncWindow", &s.SyncWindow) + delete(rawMsg, key) + case "tokenId": + err = unpopulate(val, "TokenID", &s.TokenID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type TaskStepUpdateParameters. -func (t TaskStepUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SyncUpdateProperties. +func (s SyncUpdateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "contextAccessToken", t.ContextAccessToken) - populate(objectMap, "contextPath", t.ContextPath) - objectMap["type"] = t.Type + populate(objectMap, "messageTtl", s.MessageTTL) + populate(objectMap, "schedule", s.Schedule) + populate(objectMap, "syncWindow", s.SyncWindow) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type TaskStepUpdateParameters. -func (t *TaskStepUpdateParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncUpdateProperties. +func (s *SyncUpdateProperties) 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", t, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "contextAccessToken": - err = unpopulate(val, "ContextAccessToken", &t.ContextAccessToken) + case "messageTtl": + err = unpopulate(val, "MessageTTL", &s.MessageTTL) delete(rawMsg, key) - case "contextPath": - err = unpopulate(val, "ContextPath", &t.ContextPath) + case "schedule": + err = unpopulate(val, "Schedule", &s.Schedule) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &t.Type) + case "syncWindow": + err = unpopulate(val, "SyncWindow", &s.SyncWindow) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type TaskUpdateParameters. -func (t TaskUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SystemData. +func (s SystemData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "identity", t.Identity) - populate(objectMap, "properties", t.Properties) - populate(objectMap, "tags", t.Tags) + populateTime[datetime.RFC3339](objectMap, "createdAt", s.CreatedAt) + populate(objectMap, "createdBy", s.CreatedBy) + populate(objectMap, "createdByType", s.CreatedByType) + populateTime[datetime.RFC3339](objectMap, "lastModifiedAt", s.LastModifiedAt) + populate(objectMap, "lastModifiedBy", s.LastModifiedBy) + populate(objectMap, "lastModifiedByType", s.LastModifiedByType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type TaskUpdateParameters. -func (t *TaskUpdateParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. +func (s *SystemData) 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", t, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "identity": - err = unpopulate(val, "Identity", &t.Identity) + case "createdAt": + err = unpopulateTime[datetime.RFC3339](val, "CreatedAt", &s.CreatedAt) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &t.Properties) + case "createdBy": + err = unpopulate(val, "CreatedBy", &s.CreatedBy) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &t.Tags) + case "createdByType": + err = unpopulate(val, "CreatedByType", &s.CreatedByType) + delete(rawMsg, key) + case "lastModifiedAt": + err = unpopulateTime[datetime.RFC3339](val, "LastModifiedAt", &s.LastModifiedAt) + delete(rawMsg, key) + case "lastModifiedBy": + err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) + delete(rawMsg, key) + case "lastModifiedByType": + err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type TimerTrigger. -func (t TimerTrigger) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type TLSCertificateProperties. +func (t TLSCertificateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "name", t.Name) - populate(objectMap, "schedule", t.Schedule) - populate(objectMap, "status", t.Status) + populate(objectMap, "location", t.Location) + populate(objectMap, "type", t.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type TimerTrigger. -func (t *TimerTrigger) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type TLSCertificateProperties. +func (t *TLSCertificateProperties) 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", t, err) @@ -5924,14 +3320,11 @@ func (t *TimerTrigger) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "name": - err = unpopulate(val, "Name", &t.Name) - delete(rawMsg, key) - case "schedule": - err = unpopulate(val, "Schedule", &t.Schedule) + case "location": + err = unpopulate(val, "Location", &t.Location) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &t.Status) + case "type": + err = unpopulate(val, "Type", &t.Type) delete(rawMsg, key) } if err != nil { @@ -5941,16 +3334,16 @@ func (t *TimerTrigger) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type TimerTriggerDescriptor. -func (t TimerTriggerDescriptor) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type TLSProperties. +func (t TLSProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "scheduleOccurrence", t.ScheduleOccurrence) - populate(objectMap, "timerTriggerName", t.TimerTriggerName) + populate(objectMap, "certificate", t.Certificate) + populate(objectMap, "status", t.Status) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type TimerTriggerDescriptor. -func (t *TimerTriggerDescriptor) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type TLSProperties. +func (t *TLSProperties) 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", t, err) @@ -5958,11 +3351,11 @@ func (t *TimerTriggerDescriptor) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "scheduleOccurrence": - err = unpopulate(val, "ScheduleOccurrence", &t.ScheduleOccurrence) + case "certificate": + err = unpopulate(val, "Certificate", &t.Certificate) delete(rawMsg, key) - case "timerTriggerName": - err = unpopulate(val, "TimerTriggerName", &t.TimerTriggerName) + case "status": + err = unpopulate(val, "Status", &t.Status) delete(rawMsg, key) } if err != nil { @@ -5972,17 +3365,23 @@ func (t *TimerTriggerDescriptor) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type TimerTriggerUpdateParameters. -func (t TimerTriggerUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Target. +func (t Target) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "digest", t.Digest) + populate(objectMap, "length", t.Length) + populate(objectMap, "mediaType", t.MediaType) populate(objectMap, "name", t.Name) - populate(objectMap, "schedule", t.Schedule) - populate(objectMap, "status", t.Status) + populate(objectMap, "repository", t.Repository) + populate(objectMap, "size", t.Size) + populate(objectMap, "tag", t.Tag) + populate(objectMap, "url", t.URL) + populate(objectMap, "version", t.Version) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type TimerTriggerUpdateParameters. -func (t *TimerTriggerUpdateParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Target. +func (t *Target) 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", t, err) @@ -5990,14 +3389,32 @@ func (t *TimerTriggerUpdateParameters) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "digest": + err = unpopulate(val, "Digest", &t.Digest) + delete(rawMsg, key) + case "length": + err = unpopulate(val, "Length", &t.Length) + delete(rawMsg, key) + case "mediaType": + err = unpopulate(val, "MediaType", &t.MediaType) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &t.Name) delete(rawMsg, key) - case "schedule": - err = unpopulate(val, "Schedule", &t.Schedule) + case "repository": + err = unpopulate(val, "Repository", &t.Repository) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &t.Status) + case "size": + err = unpopulate(val, "Size", &t.Size) + delete(rawMsg, key) + case "tag": + err = unpopulate(val, "Tag", &t.Tag) + delete(rawMsg, key) + case "url": + err = unpopulate(val, "URL", &t.URL) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &t.Version) delete(rawMsg, key) } if err != nil { @@ -6054,7 +3471,7 @@ func (t *Token) UnmarshalJSON(data []byte) error { func (t TokenCertificate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "encodedPemCertificate", t.EncodedPemCertificate) - populateDateTimeRFC3339(objectMap, "expiry", t.Expiry) + populateTime[datetime.RFC3339](objectMap, "expiry", t.Expiry) populate(objectMap, "name", t.Name) populate(objectMap, "thumbprint", t.Thumbprint) return json.Marshal(objectMap) @@ -6073,7 +3490,7 @@ func (t *TokenCertificate) UnmarshalJSON(data []byte) error { err = unpopulate(val, "EncodedPemCertificate", &t.EncodedPemCertificate) delete(rawMsg, key) case "expiry": - err = unpopulateDateTimeRFC3339(val, "Expiry", &t.Expiry) + err = unpopulateTime[datetime.RFC3339](val, "Expiry", &t.Expiry) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &t.Name) @@ -6154,8 +3571,8 @@ func (t *TokenListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TokenPassword. func (t TokenPassword) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "creationTime", t.CreationTime) - populateDateTimeRFC3339(objectMap, "expiry", t.Expiry) + populateTime[datetime.RFC3339](objectMap, "creationTime", t.CreationTime) + populateTime[datetime.RFC3339](objectMap, "expiry", t.Expiry) populate(objectMap, "name", t.Name) populate(objectMap, "value", t.Value) return json.Marshal(objectMap) @@ -6171,10 +3588,10 @@ func (t *TokenPassword) UnmarshalJSON(data []byte) error { var err error switch key { case "creationTime": - err = unpopulateDateTimeRFC3339(val, "CreationTime", &t.CreationTime) + err = unpopulateTime[datetime.RFC3339](val, "CreationTime", &t.CreationTime) delete(rawMsg, key) case "expiry": - err = unpopulateDateTimeRFC3339(val, "Expiry", &t.Expiry) + err = unpopulateTime[datetime.RFC3339](val, "Expiry", &t.Expiry) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &t.Name) @@ -6193,7 +3610,7 @@ func (t *TokenPassword) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TokenProperties. func (t TokenProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "creationDate", t.CreationDate) + populateTime[datetime.RFC3339](objectMap, "creationDate", t.CreationDate) populate(objectMap, "credentials", t.Credentials) populate(objectMap, "provisioningState", t.ProvisioningState) populate(objectMap, "scopeMapId", t.ScopeMapID) @@ -6211,7 +3628,7 @@ func (t *TokenProperties) UnmarshalJSON(data []byte) error { var err error switch key { case "creationDate": - err = unpopulateDateTimeRFC3339(val, "CreationDate", &t.CreationDate) + err = unpopulateTime[datetime.RFC3339](val, "CreationDate", &t.CreationDate) delete(rawMsg, key) case "credentials": err = unpopulate(val, "Credentials", &t.Credentials) @@ -6295,76 +3712,6 @@ func (t *TokenUpdateProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type TriggerProperties. -func (t TriggerProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "baseImageTrigger", t.BaseImageTrigger) - populate(objectMap, "sourceTriggers", t.SourceTriggers) - populate(objectMap, "timerTriggers", t.TimerTriggers) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TriggerProperties. -func (t *TriggerProperties) 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", t, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "baseImageTrigger": - err = unpopulate(val, "BaseImageTrigger", &t.BaseImageTrigger) - delete(rawMsg, key) - case "sourceTriggers": - err = unpopulate(val, "SourceTriggers", &t.SourceTriggers) - delete(rawMsg, key) - case "timerTriggers": - err = unpopulate(val, "TimerTriggers", &t.TimerTriggers) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type TriggerUpdateParameters. -func (t TriggerUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "baseImageTrigger", t.BaseImageTrigger) - populate(objectMap, "sourceTriggers", t.SourceTriggers) - populate(objectMap, "timerTriggers", t.TimerTriggers) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TriggerUpdateParameters. -func (t *TriggerUpdateParameters) 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", t, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "baseImageTrigger": - err = unpopulate(val, "BaseImageTrigger", &t.BaseImageTrigger) - delete(rawMsg, key) - case "sourceTriggers": - err = unpopulate(val, "SourceTriggers", &t.SourceTriggers) - delete(rawMsg, key) - case "timerTriggers": - err = unpopulate(val, "TimerTriggers", &t.TimerTriggers) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type TrustPolicy. func (t TrustPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -6710,6 +4057,17 @@ func populate(m map[string]any, k string, v any) { } } +func populateTime[T dateTimeConstraints](m map[string]any, k string, t *time.Time) { + if t == nil { + return + } else if azcore.IsNullValue(t) { + m[k] = nil + } else if !reflect.ValueOf(t).IsNil() { + newTime := T(*t) + m[k] = (*T)(&newTime) + } +} + func unpopulate(data json.RawMessage, fn string, v any) error { if data == nil || string(data) == "null" { return nil @@ -6719,3 +4077,20 @@ func unpopulate(data json.RawMessage, fn string, v any) error { } return nil } + +func unpopulateTime[T dateTimeConstraints](data json.RawMessage, fn string, t **time.Time) error { + if data == nil || string(data) == "null" { + return nil + } + var aux T + if err := json.Unmarshal(data, &aux); err != nil { + return fmt.Errorf("struct field %s: %v", fn, err) + } + newTime := time.Time(aux) + *t = &newTime + return nil +} + +type dateTimeConstraints interface { + datetime.PlainDate | datetime.PlainTime | datetime.RFC1123 | datetime.RFC3339 | datetime.Unix +} diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/operations_client.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/operations_client.go index 71deb5141eaa..5ed264aec08b 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/operations_client.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/operations_client.go @@ -1,7 +1,6 @@ // 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armcontainerregistry diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/operations_client_example_test.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/operations_client_example_test.go index a5d3165b5855..8a3b24d22479 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/operations_client_example_test.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/operations_client_example_test.go @@ -1,27 +1,24 @@ // 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. -// DO NOT EDIT. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armcontainerregistry_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry/v3" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/OperationList.json +// Generated from example definition: 2025-11-01/OperationList.json func ExampleOperationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -36,17 +33,20 @@ func ExampleOperationsClient_NewListPager() { _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationListResult = armcontainerregistry.OperationListResult{ - // Value: []*armcontainerregistry.OperationDefinition{ - // { - // Name: to.Ptr("Microsoft.ContainerRegistry/locations/deleteVirtualNetworkOrSubnets/action"), - // Display: &armcontainerregistry.OperationDisplayDefinition{ - // Description: to.Ptr("Notifies Microsoft.ContainerRegistry that virtual network or subnet is being deleted"), - // Operation: to.Ptr("Delete virtual network or subnets notifications"), - // Provider: to.Ptr("Microsoft ContainerRegistry"), - // Resource: to.Ptr(""), + // page = armcontainerregistry.OperationsClientListResponse{ + // OperationListResult: armcontainerregistry.OperationListResult{ + // Value: []*armcontainerregistry.OperationDefinition{ + // { + // Name: to.Ptr("Microsoft.ContainerRegistry/locations/deleteVirtualNetworkOrSubnets/action"), + // Display: &armcontainerregistry.OperationDisplayDefinition{ + // Provider: to.Ptr("Microsoft ContainerRegistry"), + // Resource: to.Ptr(""), + // Operation: to.Ptr("Delete virtual network or subnets notifications"), + // Description: to.Ptr("Notifies Microsoft.ContainerRegistry that virtual network or subnet is being deleted"), + // }, // }, - // }}, + // }, + // }, // } } } diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/options.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/options.go index dbafdd19f73b..edf8b10a85ea 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/options.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/options.go @@ -1,43 +1,9 @@ // 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armcontainerregistry -// AgentPoolsClientBeginCreateOptions contains the optional parameters for the AgentPoolsClient.BeginCreate method. -type AgentPoolsClientBeginCreateOptions struct { - // Resumes the long-running operation from the provided token. - ResumeToken string -} - -// AgentPoolsClientBeginDeleteOptions contains the optional parameters for the AgentPoolsClient.BeginDelete method. -type AgentPoolsClientBeginDeleteOptions struct { - // Resumes the long-running operation from the provided token. - ResumeToken string -} - -// AgentPoolsClientBeginUpdateOptions contains the optional parameters for the AgentPoolsClient.BeginUpdate method. -type AgentPoolsClientBeginUpdateOptions struct { - // Resumes the long-running operation from the provided token. - ResumeToken string -} - -// AgentPoolsClientGetOptions contains the optional parameters for the AgentPoolsClient.Get method. -type AgentPoolsClientGetOptions struct { - // placeholder for future optional parameters -} - -// AgentPoolsClientGetQueueStatusOptions contains the optional parameters for the AgentPoolsClient.GetQueueStatus method. -type AgentPoolsClientGetQueueStatusOptions struct { - // placeholder for future optional parameters -} - -// AgentPoolsClientListOptions contains the optional parameters for the AgentPoolsClient.NewListPager method. -type AgentPoolsClientListOptions struct { - // placeholder for future optional parameters -} - // CacheRulesClientBeginCreateOptions contains the optional parameters for the CacheRulesClient.BeginCreate method. type CacheRulesClientBeginCreateOptions struct { // Resumes the long-running operation from the provided token. @@ -102,8 +68,7 @@ type ConnectedRegistriesClientGetOptions struct { // ConnectedRegistriesClientListOptions contains the optional parameters for the ConnectedRegistriesClient.NewListPager method. type ConnectedRegistriesClientListOptions struct { // An OData filter expression that describes a subset of connectedRegistries to return. The parameters that can be filtered - // are parent.id (the resource id of the connectedRegistry parent), mode, and - // connectionState. The supported operator is eq. + // are parent.id (the resource id of the connectedRegistry parent), mode, and connectionState. The supported operator is eq. Filter *string } @@ -203,12 +168,6 @@ type RegistriesClientCheckNameAvailabilityOptions struct { // placeholder for future optional parameters } -// RegistriesClientGetBuildSourceUploadURLOptions contains the optional parameters for the RegistriesClient.GetBuildSourceUploadURL -// method. -type RegistriesClientGetBuildSourceUploadURLOptions struct { - // placeholder for future optional parameters -} - // RegistriesClientGetOptions contains the optional parameters for the RegistriesClient.Get method. type RegistriesClientGetOptions struct { // placeholder for future optional parameters @@ -253,11 +212,6 @@ type RegistriesClientRegenerateCredentialOptions struct { // placeholder for future optional parameters } -// RegistriesClientScheduleRunOptions contains the optional parameters for the RegistriesClient.ScheduleRun method. -type RegistriesClientScheduleRunOptions struct { - // placeholder for future optional parameters -} - // ReplicationsClientBeginCreateOptions contains the optional parameters for the ReplicationsClient.BeginCreate method. type ReplicationsClientBeginCreateOptions struct { // Resumes the long-running operation from the provided token. @@ -286,36 +240,6 @@ type ReplicationsClientListOptions struct { // placeholder for future optional parameters } -// RunsClientCancelOptions contains the optional parameters for the RunsClient.Cancel method. -type RunsClientCancelOptions struct { - // placeholder for future optional parameters -} - -// RunsClientGetLogSasURLOptions contains the optional parameters for the RunsClient.GetLogSasURL method. -type RunsClientGetLogSasURLOptions struct { - // placeholder for future optional parameters -} - -// RunsClientGetOptions contains the optional parameters for the RunsClient.Get method. -type RunsClientGetOptions struct { - // placeholder for future optional parameters -} - -// RunsClientListOptions contains the optional parameters for the RunsClient.NewListPager method. -type RunsClientListOptions struct { - // The runs filter to apply on the operation. Arithmetic operators are not supported. The allowed string function is 'contains'. - // All logical operators except 'Not', 'Has', 'All' are allowed. - Filter *string - - // $top is supported for get list of runs, which limits the maximum number of runs to return. - Top *int32 -} - -// RunsClientUpdateOptions contains the optional parameters for the RunsClient.Update method. -type RunsClientUpdateOptions struct { - // placeholder for future optional parameters -} - // ScopeMapsClientBeginCreateOptions contains the optional parameters for the ScopeMapsClient.BeginCreate method. type ScopeMapsClientBeginCreateOptions struct { // Resumes the long-running operation from the provided token. @@ -344,68 +268,6 @@ type ScopeMapsClientListOptions struct { // placeholder for future optional parameters } -// TaskRunsClientBeginCreateOptions contains the optional parameters for the TaskRunsClient.BeginCreate method. -type TaskRunsClientBeginCreateOptions struct { - // Resumes the long-running operation from the provided token. - ResumeToken string -} - -// TaskRunsClientBeginUpdateOptions contains the optional parameters for the TaskRunsClient.BeginUpdate method. -type TaskRunsClientBeginUpdateOptions struct { - // Resumes the long-running operation from the provided token. - ResumeToken string -} - -// TaskRunsClientDeleteOptions contains the optional parameters for the TaskRunsClient.Delete method. -type TaskRunsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// TaskRunsClientGetDetailsOptions contains the optional parameters for the TaskRunsClient.GetDetails method. -type TaskRunsClientGetDetailsOptions struct { - // placeholder for future optional parameters -} - -// TaskRunsClientGetOptions contains the optional parameters for the TaskRunsClient.Get method. -type TaskRunsClientGetOptions struct { - // placeholder for future optional parameters -} - -// TaskRunsClientListOptions contains the optional parameters for the TaskRunsClient.NewListPager method. -type TaskRunsClientListOptions struct { - // placeholder for future optional parameters -} - -// TasksClientCreateOptions contains the optional parameters for the TasksClient.Create method. -type TasksClientCreateOptions struct { - // placeholder for future optional parameters -} - -// TasksClientDeleteOptions contains the optional parameters for the TasksClient.Delete method. -type TasksClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// TasksClientGetDetailsOptions contains the optional parameters for the TasksClient.GetDetails method. -type TasksClientGetDetailsOptions struct { - // placeholder for future optional parameters -} - -// TasksClientGetOptions contains the optional parameters for the TasksClient.Get method. -type TasksClientGetOptions struct { - // placeholder for future optional parameters -} - -// TasksClientListOptions contains the optional parameters for the TasksClient.NewListPager method. -type TasksClientListOptions struct { - // placeholder for future optional parameters -} - -// TasksClientUpdateOptions contains the optional parameters for the TasksClient.Update method. -type TasksClientUpdateOptions struct { - // placeholder for future optional parameters -} - // TokensClientBeginCreateOptions contains the optional parameters for the TokensClient.BeginCreate method. type TokensClientBeginCreateOptions struct { // Resumes the long-running operation from the provided token. diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/polymorphic_helpers.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/polymorphic_helpers.go deleted file mode 100644 index 30fd366bf429..000000000000 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/polymorphic_helpers.go +++ /dev/null @@ -1,85 +0,0 @@ -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcontainerregistry - -import "encoding/json" - -func unmarshalRunRequestClassification(rawMsg json.RawMessage) (RunRequestClassification, error) { - if rawMsg == nil || string(rawMsg) == "null" { - return nil, nil - } - var m map[string]any - if err := json.Unmarshal(rawMsg, &m); err != nil { - return nil, err - } - var b RunRequestClassification - switch m["type"] { - case "DockerBuildRequest": - b = &DockerBuildRequest{} - case "EncodedTaskRunRequest": - b = &EncodedTaskRunRequest{} - case "FileTaskRunRequest": - b = &FileTaskRunRequest{} - case "TaskRunRequest": - b = &TaskRunRequest{} - default: - b = &RunRequest{} - } - if err := json.Unmarshal(rawMsg, b); err != nil { - return nil, err - } - return b, nil -} - -func unmarshalTaskStepPropertiesClassification(rawMsg json.RawMessage) (TaskStepPropertiesClassification, error) { - if rawMsg == nil || string(rawMsg) == "null" { - return nil, nil - } - var m map[string]any - if err := json.Unmarshal(rawMsg, &m); err != nil { - return nil, err - } - var b TaskStepPropertiesClassification - switch m["type"] { - case string(StepTypeDocker): - b = &DockerBuildStep{} - case string(StepTypeEncodedTask): - b = &EncodedTaskStep{} - case string(StepTypeFileTask): - b = &FileTaskStep{} - default: - b = &TaskStepProperties{} - } - if err := json.Unmarshal(rawMsg, b); err != nil { - return nil, err - } - return b, nil -} - -func unmarshalTaskStepUpdateParametersClassification(rawMsg json.RawMessage) (TaskStepUpdateParametersClassification, error) { - if rawMsg == nil || string(rawMsg) == "null" { - return nil, nil - } - var m map[string]any - if err := json.Unmarshal(rawMsg, &m); err != nil { - return nil, err - } - var b TaskStepUpdateParametersClassification - switch m["type"] { - case string(StepTypeDocker): - b = &DockerBuildStepUpdateParameters{} - case string(StepTypeEncodedTask): - b = &EncodedTaskStepUpdateParameters{} - case string(StepTypeFileTask): - b = &FileTaskStepUpdateParameters{} - default: - b = &TaskStepUpdateParameters{} - } - if err := json.Unmarshal(rawMsg, b); err != nil { - return nil, err - } - return b, nil -} diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/privateendpointconnections_client.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/privateendpointconnections_client.go index 61347b8c9383..8d4a5b272d96 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/privateendpointconnections_client.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/privateendpointconnections_client.go @@ -1,7 +1,6 @@ // 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armcontainerregistry @@ -57,8 +56,7 @@ func (client *PrivateEndpointConnectionsClient) BeginCreateOrUpdate(ctx context. return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrivateEndpointConnectionsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -120,6 +118,7 @@ func (client *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx reqQP.Set("api-version", "2025-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, privateEndpointConnection); err != nil { return nil, err } @@ -142,8 +141,7 @@ func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrivateEndpointConnectionsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -204,7 +202,6 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2025-11-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/privateendpointconnections_client_example_test.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/privateendpointconnections_client_example_test.go index 3afc68dcc270..ccf34e431ac9 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/privateendpointconnections_client_example_test.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/privateendpointconnections_client_example_test.go @@ -1,164 +1,173 @@ // 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. -// DO NOT EDIT. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armcontainerregistry_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/containerregistry/armcontainerregistry/v3" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/PrivateEndpointConnectionList.json -func ExamplePrivateEndpointConnectionsClient_NewListPager() { +// Generated from example definition: 2025-11-01/PrivateEndpointConnectionCreateOrUpdate.json +func ExamplePrivateEndpointConnectionsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewPrivateEndpointConnectionsClient().NewListPager("myResourceGroup", "myRegistry", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PrivateEndpointConnectionListResult = armcontainerregistry.PrivateEndpointConnectionListResult{ - // Value: []*armcontainerregistry.PrivateEndpointConnection{ - // { - // Name: to.Ptr("myConnection"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/privateEndpointConnections/myConnection"), - // Properties: &armcontainerregistry.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armcontainerregistry.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/peexample01"), - // }, - // PrivateLinkServiceConnectionState: &armcontainerregistry.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // ActionsRequired: to.Ptr(armcontainerregistry.ActionsRequiredNone), - // Status: to.Ptr(armcontainerregistry.ConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // }, - // }}, - // } + poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myRegistry", "myConnection", armcontainerregistry.PrivateEndpointConnection{ + Properties: &armcontainerregistry.PrivateEndpointConnectionProperties{ + PrivateLinkServiceConnectionState: &armcontainerregistry.PrivateLinkServiceConnectionState{ + Status: to.Ptr(armcontainerregistry.ConnectionStatusApproved), + Description: to.Ptr("Auto-Approved"), + }, + }, + }, 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) } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armcontainerregistry.PrivateEndpointConnectionsClientCreateOrUpdateResponse{ + // PrivateEndpointConnection: &armcontainerregistry.PrivateEndpointConnection{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/privateEndpointConnections/myConnection"), + // Name: to.Ptr("myConnection"), + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/privateEndpointConnections"), + // Properties: &armcontainerregistry.PrivateEndpointConnectionProperties{ + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // PrivateEndpoint: &armcontainerregistry.PrivateEndpoint{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/peexample01"), + // }, + // PrivateLinkServiceConnectionState: &armcontainerregistry.PrivateLinkServiceConnectionState{ + // Status: to.Ptr(armcontainerregistry.ConnectionStatusApproved), + // Description: to.Ptr("Auto-Approved"), + // ActionsRequired: to.Ptr(armcontainerregistry.ActionsRequiredNone), + // }, + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/PrivateEndpointConnectionGet.json -func ExamplePrivateEndpointConnectionsClient_Get() { +// Generated from example definition: 2025-11-01/PrivateEndpointConnectionDelete.json +func ExamplePrivateEndpointConnectionsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewPrivateEndpointConnectionsClient().Get(ctx, "myResourceGroup", "myRegistry", "myConnection", nil) + poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginDelete(ctx, "myResourceGroup", "myRegistry", "myConnection", 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) + } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpointConnection = armcontainerregistry.PrivateEndpointConnection{ - // Name: to.Ptr("myConnection"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/privateEndpointConnections/myConnection"), - // Properties: &armcontainerregistry.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armcontainerregistry.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/peexample01"), - // }, - // PrivateLinkServiceConnectionState: &armcontainerregistry.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // ActionsRequired: to.Ptr(armcontainerregistry.ActionsRequiredNone), - // Status: to.Ptr(armcontainerregistry.ConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // }, + // res = armcontainerregistry.PrivateEndpointConnectionsClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/PrivateEndpointConnectionCreateOrUpdate.json -func ExamplePrivateEndpointConnectionsClient_BeginCreateOrUpdate() { +// Generated from example definition: 2025-11-01/PrivateEndpointConnectionGet.json +func ExamplePrivateEndpointConnectionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myRegistry", "myConnection", armcontainerregistry.PrivateEndpointConnection{ - Properties: &armcontainerregistry.PrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armcontainerregistry.PrivateLinkServiceConnectionState{ - Description: to.Ptr("Auto-Approved"), - Status: to.Ptr(armcontainerregistry.ConnectionStatusApproved), - }, - }, - }, nil) + res, err := clientFactory.NewPrivateEndpointConnectionsClient().Get(ctx, "myResourceGroup", "myRegistry", "myConnection", 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) - } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpointConnection = armcontainerregistry.PrivateEndpointConnection{ - // Name: to.Ptr("myConnection"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/privateEndpointConnections/myConnection"), - // Properties: &armcontainerregistry.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armcontainerregistry.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/peexample01"), - // }, - // PrivateLinkServiceConnectionState: &armcontainerregistry.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // ActionsRequired: to.Ptr(armcontainerregistry.ActionsRequiredNone), - // Status: to.Ptr(armcontainerregistry.ConnectionStatusApproved), + // res = armcontainerregistry.PrivateEndpointConnectionsClientGetResponse{ + // PrivateEndpointConnection: &armcontainerregistry.PrivateEndpointConnection{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/privateEndpointConnections/myConnection"), + // Name: to.Ptr("myConnection"), + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/privateEndpointConnections"), + // Properties: &armcontainerregistry.PrivateEndpointConnectionProperties{ + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // PrivateEndpoint: &armcontainerregistry.PrivateEndpoint{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/peexample01"), + // }, + // PrivateLinkServiceConnectionState: &armcontainerregistry.PrivateLinkServiceConnectionState{ + // Status: to.Ptr(armcontainerregistry.ConnectionStatusApproved), + // Description: to.Ptr("Auto-Approved"), + // ActionsRequired: to.Ptr(armcontainerregistry.ActionsRequiredNone), + // }, // }, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/PrivateEndpointConnectionDelete.json -func ExamplePrivateEndpointConnectionsClient_BeginDelete() { +// Generated from example definition: 2025-11-01/PrivateEndpointConnectionList.json +func ExamplePrivateEndpointConnectionsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginDelete(ctx, "myResourceGroup", "myRegistry", "myConnection", 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) + pager := clientFactory.NewPrivateEndpointConnectionsClient().NewListPager("myResourceGroup", "myRegistry", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page = armcontainerregistry.PrivateEndpointConnectionsClientListResponse{ + // PrivateEndpointConnectionListResult: armcontainerregistry.PrivateEndpointConnectionListResult{ + // Value: []*armcontainerregistry.PrivateEndpointConnection{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/privateEndpointConnections/myConnection"), + // Name: to.Ptr("myConnection"), + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/privateEndpointConnections"), + // Properties: &armcontainerregistry.PrivateEndpointConnectionProperties{ + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // PrivateEndpoint: &armcontainerregistry.PrivateEndpoint{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/peexample01"), + // }, + // PrivateLinkServiceConnectionState: &armcontainerregistry.PrivateLinkServiceConnectionState{ + // Status: to.Ptr(armcontainerregistry.ConnectionStatusApproved), + // Description: to.Ptr("Auto-Approved"), + // ActionsRequired: to.Ptr(armcontainerregistry.ActionsRequiredNone), + // }, + // }, + // }, + // }, + // }, + // } } } diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/registries_client.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/registries_client.go index b18ce1a1bfd7..91a51cb5ccea 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/registries_client.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/registries_client.go @@ -1,7 +1,6 @@ // 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armcontainerregistry @@ -85,6 +84,7 @@ func (client *RegistriesClient) checkNameAvailabilityCreateRequest(ctx context.C reqQP.Set("api-version", "2025-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, registryNameCheckRequest); err != nil { return nil, err } @@ -115,8 +115,7 @@ func (client *RegistriesClient) BeginCreate(ctx context.Context, resourceGroupNa return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RegistriesClientCreateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -174,6 +173,7 @@ func (client *RegistriesClient) createCreateRequest(ctx context.Context, resourc reqQP.Set("api-version", "2025-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, registry); err != nil { return nil, err } @@ -194,8 +194,7 @@ func (client *RegistriesClient) BeginDelete(ctx context.Context, resourceGroupNa return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RegistriesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -252,7 +251,6 @@ func (client *RegistriesClient) deleteCreateRequest(ctx context.Context, resourc reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2025-11-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -272,8 +270,7 @@ func (client *RegistriesClient) BeginGenerateCredentials(ctx context.Context, re return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RegistriesClientGenerateCredentialsResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -331,6 +328,7 @@ func (client *RegistriesClient) generateCredentialsCreateRequest(ctx context.Con reqQP.Set("api-version", "2025-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, generateCredentialsParameters); err != nil { return nil, err } @@ -401,71 +399,6 @@ func (client *RegistriesClient) getHandleResponse(resp *http.Response) (Registri return result, nil } -// GetBuildSourceUploadURL - Get the upload location for the user to be able to upload the source. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-03-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - registryName - The name of the container registry. -// - options - RegistriesClientGetBuildSourceUploadURLOptions contains the optional parameters for the RegistriesClient.GetBuildSourceUploadURL -// method. -func (client *RegistriesClient) GetBuildSourceUploadURL(ctx context.Context, resourceGroupName string, registryName string, options *RegistriesClientGetBuildSourceUploadURLOptions) (RegistriesClientGetBuildSourceUploadURLResponse, error) { - var err error - const operationName = "RegistriesClient.GetBuildSourceUploadURL" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getBuildSourceUploadURLCreateRequest(ctx, resourceGroupName, registryName, options) - if err != nil { - return RegistriesClientGetBuildSourceUploadURLResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return RegistriesClientGetBuildSourceUploadURLResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return RegistriesClientGetBuildSourceUploadURLResponse{}, err - } - resp, err := client.getBuildSourceUploadURLHandleResponse(httpResp) - return resp, err -} - -// getBuildSourceUploadURLCreateRequest creates the GetBuildSourceUploadURL request. -func (client *RegistriesClient) getBuildSourceUploadURLCreateRequest(ctx context.Context, resourceGroupName string, registryName string, _ *RegistriesClientGetBuildSourceUploadURLOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listBuildSourceUploadUrl" - 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 registryName == "" { - return nil, errors.New("parameter registryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getBuildSourceUploadURLHandleResponse handles the GetBuildSourceUploadURL response. -func (client *RegistriesClient) getBuildSourceUploadURLHandleResponse(resp *http.Response) (RegistriesClientGetBuildSourceUploadURLResponse, error) { - result := RegistriesClientGetBuildSourceUploadURLResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SourceUploadDefinition); err != nil { - return RegistriesClientGetBuildSourceUploadURLResponse{}, err - } - return result, nil -} - // GetPrivateLinkResource - Gets a private link resource by a specified group name for a container registry. // If the operation fails it returns an *azcore.ResponseError type. // @@ -552,8 +485,7 @@ func (client *RegistriesClient) BeginImportImage(ctx context.Context, resourceGr return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RegistriesClientImportImageResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -610,7 +542,7 @@ func (client *RegistriesClient) importImageCreateRequest(ctx context.Context, re reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2025-11-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -979,6 +911,7 @@ func (client *RegistriesClient) regenerateCredentialCreateRequest(ctx context.Co reqQP.Set("api-version", "2025-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, regenerateCredentialParameters); err != nil { return nil, err } @@ -994,74 +927,6 @@ func (client *RegistriesClient) regenerateCredentialHandleResponse(resp *http.Re return result, nil } -// ScheduleRun - Schedules a new run based on the request parameters and add it to the run queue. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-03-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - registryName - The name of the container registry. -// - runRequest - The request body -// - options - RegistriesClientScheduleRunOptions contains the optional parameters for the RegistriesClient.ScheduleRun method. -func (client *RegistriesClient) ScheduleRun(ctx context.Context, resourceGroupName string, registryName string, runRequest RunRequestClassification, options *RegistriesClientScheduleRunOptions) (RegistriesClientScheduleRunResponse, error) { - var err error - const operationName = "RegistriesClient.ScheduleRun" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.scheduleRunCreateRequest(ctx, resourceGroupName, registryName, runRequest, options) - if err != nil { - return RegistriesClientScheduleRunResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return RegistriesClientScheduleRunResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return RegistriesClientScheduleRunResponse{}, err - } - resp, err := client.scheduleRunHandleResponse(httpResp) - return resp, err -} - -// scheduleRunCreateRequest creates the ScheduleRun request. -func (client *RegistriesClient) scheduleRunCreateRequest(ctx context.Context, resourceGroupName string, registryName string, runRequest RunRequestClassification, _ *RegistriesClientScheduleRunOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scheduleRun" - 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 registryName == "" { - return nil, errors.New("parameter registryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, runRequest); err != nil { - return nil, err - } - return req, nil -} - -// scheduleRunHandleResponse handles the ScheduleRun response. -func (client *RegistriesClient) scheduleRunHandleResponse(resp *http.Response) (RegistriesClientScheduleRunResponse, error) { - result := RegistriesClientScheduleRunResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Run); err != nil { - return RegistriesClientScheduleRunResponse{}, err - } - return result, nil -} - // BeginUpdate - Updates a container registry with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // @@ -1077,8 +942,7 @@ func (client *RegistriesClient) BeginUpdate(ctx context.Context, resourceGroupNa return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RegistriesClientUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -1136,6 +1000,7 @@ func (client *RegistriesClient) updateCreateRequest(ctx context.Context, resourc reqQP.Set("api-version", "2025-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, registryUpdateParameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/registries_client_example_test.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/registries_client_example_test.go index d024a167b451..2019e261ce15 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/registries_client_example_test.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/registries_client_example_test.go @@ -1,30 +1,26 @@ // 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. -// DO NOT EDIT. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armcontainerregistry_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/containerregistry/armcontainerregistry/v3" + "log" + "time" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/RegistryCheckNameAvailable.json +// Generated from example definition: 2025-11-01/RegistryCheckNameAvailable.json func ExampleRegistriesClient_CheckNameAvailability_registryCheckNameAvailable() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -38,19 +34,21 @@ func ExampleRegistriesClient_CheckNameAvailability_registryCheckNameAvailable() // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RegistryNameStatus = armcontainerregistry.RegistryNameStatus{ - // NameAvailable: to.Ptr(true), + // res = armcontainerregistry.RegistriesClientCheckNameAvailabilityResponse{ + // RegistryNameStatus: &armcontainerregistry.RegistryNameStatus{ + // NameAvailable: to.Ptr(true), + // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/RegistryCheckNameNotAvailable.json +// Generated from example definition: 2025-11-01/RegistryCheckNameNotAvailable.json func ExampleRegistriesClient_CheckNameAvailability_registryCheckNameNotAvailable() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -64,271 +62,118 @@ func ExampleRegistriesClient_CheckNameAvailability_registryCheckNameNotAvailable // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RegistryNameStatus = armcontainerregistry.RegistryNameStatus{ - // Message: to.Ptr("The registry myRegistry is already in use."), - // NameAvailable: to.Ptr(false), - // Reason: to.Ptr("AlreadyExists"), + // res = armcontainerregistry.RegistriesClientCheckNameAvailabilityResponse{ + // RegistryNameStatus: &armcontainerregistry.RegistryNameStatus{ + // NameAvailable: to.Ptr(false), + // Reason: to.Ptr("AlreadyExists"), + // Message: to.Ptr("The registry myRegistry is already in use."), + // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/RegistryList.json -func ExampleRegistriesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRegistriesClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.RegistryListResult = armcontainerregistry.RegistryListResult{ - // Value: []*armcontainerregistry.Registry{ - // { - // Name: to.Ptr("myRegistry"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Properties: &armcontainerregistry.RegistryProperties{ - // AdminUserEnabled: to.Ptr(false), - // AnonymousPullEnabled: to.Ptr(false), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:38:26.153Z"); return t}()), - // DataEndpointEnabled: to.Ptr(false), - // DataEndpointHostNames: []*string{ - // }, - // Encryption: &armcontainerregistry.EncryptionProperty{ - // Status: to.Ptr(armcontainerregistry.EncryptionStatusDisabled), - // }, - // LoginServer: to.Ptr("myRegistry.azurecr.io"), - // NetworkRuleBypassAllowedForTasks: to.Ptr(false), - // NetworkRuleBypassOptions: to.Ptr(armcontainerregistry.NetworkRuleBypassOptionsAzureServices), - // NetworkRuleSet: &armcontainerregistry.NetworkRuleSet{ - // DefaultAction: to.Ptr(armcontainerregistry.DefaultActionAllow), - // IPRules: []*armcontainerregistry.IPRule{ - // }, - // }, - // Policies: &armcontainerregistry.Policies{ - // AzureADAuthenticationAsArmPolicy: &armcontainerregistry.AzureADAuthenticationAsArmPolicy{ - // Status: to.Ptr(armcontainerregistry.AzureADAuthenticationAsArmPolicyStatusEnabled), - // }, - // ExportPolicy: &armcontainerregistry.ExportPolicy{ - // Status: to.Ptr(armcontainerregistry.ExportPolicyStatusEnabled), - // }, - // QuarantinePolicy: &armcontainerregistry.QuarantinePolicy{ - // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), - // }, - // RetentionPolicy: &armcontainerregistry.RetentionPolicy{ - // Days: to.Ptr[int32](7), - // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:40:12.850Z"); return t}()), - // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), - // }, - // TrustPolicy: &armcontainerregistry.TrustPolicy{ - // Type: to.Ptr(armcontainerregistry.TrustPolicyTypeNotary), - // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), - // }, - // }, - // PrivateEndpointConnections: []*armcontainerregistry.PrivateEndpointConnection{ - // }, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armcontainerregistry.PublicNetworkAccessEnabled), - // RoleAssignmentMode: to.Ptr(armcontainerregistry.RoleAssignmentModeLegacyRegistryPermissions), - // ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyDisabled), - // }, - // SKU: &armcontainerregistry.SKU{ - // Name: to.Ptr(armcontainerregistry.SKUNameStandard), - // Tier: to.Ptr(armcontainerregistry.SKUTierStandard), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/RegistryListByResourceGroup.json -func ExampleRegistriesClient_NewListByResourceGroupPager() { +// Generated from example definition: 2025-11-01/RegistryCreate.json +func ExampleRegistriesClient_BeginCreate_registryCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewRegistriesClient().NewListByResourceGroupPager("myResourceGroup", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.RegistryListResult = armcontainerregistry.RegistryListResult{ - // Value: []*armcontainerregistry.Registry{ - // { - // Name: to.Ptr("myRegistry"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Properties: &armcontainerregistry.RegistryProperties{ - // AdminUserEnabled: to.Ptr(false), - // AnonymousPullEnabled: to.Ptr(false), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:38:26.153Z"); return t}()), - // DataEndpointEnabled: to.Ptr(false), - // DataEndpointHostNames: []*string{ - // }, - // Encryption: &armcontainerregistry.EncryptionProperty{ - // Status: to.Ptr(armcontainerregistry.EncryptionStatusDisabled), - // }, - // LoginServer: to.Ptr("myRegistry.azurecr.io"), - // NetworkRuleBypassAllowedForTasks: to.Ptr(false), - // NetworkRuleBypassOptions: to.Ptr(armcontainerregistry.NetworkRuleBypassOptionsAzureServices), - // NetworkRuleSet: &armcontainerregistry.NetworkRuleSet{ - // DefaultAction: to.Ptr(armcontainerregistry.DefaultActionAllow), - // IPRules: []*armcontainerregistry.IPRule{ - // }, - // }, - // Policies: &armcontainerregistry.Policies{ - // AzureADAuthenticationAsArmPolicy: &armcontainerregistry.AzureADAuthenticationAsArmPolicy{ - // Status: to.Ptr(armcontainerregistry.AzureADAuthenticationAsArmPolicyStatusEnabled), - // }, - // ExportPolicy: &armcontainerregistry.ExportPolicy{ - // Status: to.Ptr(armcontainerregistry.ExportPolicyStatusEnabled), - // }, - // QuarantinePolicy: &armcontainerregistry.QuarantinePolicy{ - // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), - // }, - // RetentionPolicy: &armcontainerregistry.RetentionPolicy{ - // Days: to.Ptr[int32](7), - // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:40:12.850Z"); return t}()), - // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), - // }, - // TrustPolicy: &armcontainerregistry.TrustPolicy{ - // Type: to.Ptr(armcontainerregistry.TrustPolicyTypeNotary), - // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), - // }, - // }, - // PrivateEndpointConnections: []*armcontainerregistry.PrivateEndpointConnection{ - // }, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armcontainerregistry.PublicNetworkAccessEnabled), - // RoleAssignmentMode: to.Ptr(armcontainerregistry.RoleAssignmentModeLegacyRegistryPermissions), - // ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyDisabled), - // }, - // SKU: &armcontainerregistry.SKU{ - // Name: to.Ptr(armcontainerregistry.SKUNameStandard), - // Tier: to.Ptr(armcontainerregistry.SKUTierStandard), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/RegistryGet.json -func ExampleRegistriesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + poller, err := clientFactory.NewRegistriesClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", armcontainerregistry.Registry{ + Location: to.Ptr("westus"), + Tags: map[string]*string{ + "key": to.Ptr("value"), + }, + SKU: &armcontainerregistry.SKU{ + Name: to.Ptr(armcontainerregistry.SKUNameStandard), + }, + Properties: &armcontainerregistry.RegistryProperties{ + AdminUserEnabled: to.Ptr(true), + }, + }, nil) if err != nil { - log.Fatalf("failed to create client: %v", err) + log.Fatalf("failed to finish the request: %v", err) } - res, err := clientFactory.NewRegistriesClient().Get(ctx, "myResourceGroup", "myRegistry", nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to finish the request: %v", err) + log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Registry = armcontainerregistry.Registry{ - // Name: to.Ptr("myRegistry"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Properties: &armcontainerregistry.RegistryProperties{ - // AdminUserEnabled: to.Ptr(false), - // AnonymousPullEnabled: to.Ptr(false), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:38:26.153Z"); return t}()), - // DataEndpointEnabled: to.Ptr(false), - // DataEndpointHostNames: []*string{ + // res = armcontainerregistry.RegistriesClientCreateResponse{ + // Registry: &armcontainerregistry.Registry{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry"), + // Name: to.Ptr("myRegistry"), + // Type: to.Ptr("Microsoft.ContainerRegistry/registries"), + // Location: to.Ptr("westus"), + // Tags: map[string]*string{ + // "key": to.Ptr("value"), // }, - // Encryption: &armcontainerregistry.EncryptionProperty{ - // Status: to.Ptr(armcontainerregistry.EncryptionStatusDisabled), + // SKU: &armcontainerregistry.SKU{ + // Name: to.Ptr(armcontainerregistry.SKUNameStandard), + // Tier: to.Ptr(armcontainerregistry.SKUTierStandard), // }, - // LoginServer: to.Ptr("myRegistry.azurecr.io"), - // NetworkRuleBypassAllowedForTasks: to.Ptr(false), - // NetworkRuleBypassOptions: to.Ptr(armcontainerregistry.NetworkRuleBypassOptionsAzureServices), - // NetworkRuleSet: &armcontainerregistry.NetworkRuleSet{ - // DefaultAction: to.Ptr(armcontainerregistry.DefaultActionAllow), - // IPRules: []*armcontainerregistry.IPRule{ + // Properties: &armcontainerregistry.RegistryProperties{ + // LoginServer: to.Ptr("myRegistry.azurecr.io"), + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:38:26.1537861Z"); return t}()), + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // AdminUserEnabled: to.Ptr(true), + // NetworkRuleSet: &armcontainerregistry.NetworkRuleSet{ + // DefaultAction: to.Ptr(armcontainerregistry.DefaultActionAllow), + // IPRules: []*armcontainerregistry.IPRule{ + // }, // }, - // }, - // Policies: &armcontainerregistry.Policies{ - // AzureADAuthenticationAsArmPolicy: &armcontainerregistry.AzureADAuthenticationAsArmPolicy{ - // Status: to.Ptr(armcontainerregistry.AzureADAuthenticationAsArmPolicyStatusEnabled), + // Policies: &armcontainerregistry.Policies{ + // QuarantinePolicy: &armcontainerregistry.QuarantinePolicy{ + // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), + // }, + // TrustPolicy: &armcontainerregistry.TrustPolicy{ + // Type: to.Ptr(armcontainerregistry.TrustPolicyTypeNotary), + // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), + // }, + // RetentionPolicy: &armcontainerregistry.RetentionPolicy{ + // Days: to.Ptr[int32](7), + // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:40:12.8506835+00:00"); return t}()), + // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), + // }, + // ExportPolicy: &armcontainerregistry.ExportPolicy{ + // Status: to.Ptr(armcontainerregistry.ExportPolicyStatusEnabled), + // }, + // AzureADAuthenticationAsArmPolicy: &armcontainerregistry.AzureADAuthenticationAsArmPolicy{ + // Status: to.Ptr(armcontainerregistry.AzureADAuthenticationAsArmPolicyStatusEnabled), + // }, // }, - // ExportPolicy: &armcontainerregistry.ExportPolicy{ - // Status: to.Ptr(armcontainerregistry.ExportPolicyStatusEnabled), + // Encryption: &armcontainerregistry.EncryptionProperty{ + // Status: to.Ptr(armcontainerregistry.EncryptionStatusDisabled), // }, - // QuarantinePolicy: &armcontainerregistry.QuarantinePolicy{ - // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), + // DataEndpointEnabled: to.Ptr(false), + // DataEndpointHostNames: []*string{ // }, - // RetentionPolicy: &armcontainerregistry.RetentionPolicy{ - // Days: to.Ptr[int32](7), - // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:40:12.850Z"); return t}()), - // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), + // PrivateEndpointConnections: []*armcontainerregistry.PrivateEndpointConnection{ // }, - // TrustPolicy: &armcontainerregistry.TrustPolicy{ - // Type: to.Ptr(armcontainerregistry.TrustPolicyTypeNotary), - // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), - // }, - // }, - // PrivateEndpointConnections: []*armcontainerregistry.PrivateEndpointConnection{ + // PublicNetworkAccess: to.Ptr(armcontainerregistry.PublicNetworkAccessEnabled), + // NetworkRuleBypassOptions: to.Ptr(armcontainerregistry.NetworkRuleBypassOptionsAzureServices), + // NetworkRuleBypassAllowedForTasks: to.Ptr(false), + // ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyDisabled), + // AnonymousPullEnabled: to.Ptr(false), + // RoleAssignmentMode: to.Ptr(armcontainerregistry.RoleAssignmentModeLegacyRegistryPermissions), // }, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armcontainerregistry.PublicNetworkAccessEnabled), - // RoleAssignmentMode: to.Ptr(armcontainerregistry.RoleAssignmentModeLegacyRegistryPermissions), - // ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyDisabled), - // }, - // SKU: &armcontainerregistry.SKU{ - // Name: to.Ptr(armcontainerregistry.SKUNameStandard), - // Tier: to.Ptr(armcontainerregistry.SKUTierStandard), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/RegistryCreate.json -func ExampleRegistriesClient_BeginCreate_registryCreate() { +// Generated from example definition: 2025-11-01/RegistryCreateAbac.json +func ExampleRegistriesClient_BeginCreate_registryCreateAbac() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -337,12 +182,12 @@ func ExampleRegistriesClient_BeginCreate_registryCreate() { Tags: map[string]*string{ "key": to.Ptr("value"), }, - Properties: &armcontainerregistry.RegistryProperties{ - AdminUserEnabled: to.Ptr(true), - }, SKU: &armcontainerregistry.SKU{ Name: to.Ptr(armcontainerregistry.SKUNameStandard), }, + Properties: &armcontainerregistry.RegistryProperties{ + RoleAssignmentMode: to.Ptr(armcontainerregistry.RoleAssignmentModeAbacRepositoryPermissions), + }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -354,74 +199,73 @@ func ExampleRegistriesClient_BeginCreate_registryCreate() { // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Registry = armcontainerregistry.Registry{ - // Name: to.Ptr("myRegistry"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Properties: &armcontainerregistry.RegistryProperties{ - // AdminUserEnabled: to.Ptr(true), - // AnonymousPullEnabled: to.Ptr(false), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:38:26.153Z"); return t}()), - // DataEndpointEnabled: to.Ptr(false), - // DataEndpointHostNames: []*string{ - // }, - // Encryption: &armcontainerregistry.EncryptionProperty{ - // Status: to.Ptr(armcontainerregistry.EncryptionStatusDisabled), + // res = armcontainerregistry.RegistriesClientCreateResponse{ + // Registry: &armcontainerregistry.Registry{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry"), + // Name: to.Ptr("myRegistry"), + // Type: to.Ptr("Microsoft.ContainerRegistry/registries"), + // Location: to.Ptr("westus"), + // Tags: map[string]*string{ + // "key": to.Ptr("value"), // }, - // LoginServer: to.Ptr("myRegistry.azurecr.io"), - // NetworkRuleBypassAllowedForTasks: to.Ptr(false), - // NetworkRuleBypassOptions: to.Ptr(armcontainerregistry.NetworkRuleBypassOptionsAzureServices), - // NetworkRuleSet: &armcontainerregistry.NetworkRuleSet{ - // DefaultAction: to.Ptr(armcontainerregistry.DefaultActionAllow), - // IPRules: []*armcontainerregistry.IPRule{ - // }, + // SKU: &armcontainerregistry.SKU{ + // Name: to.Ptr(armcontainerregistry.SKUNameStandard), + // Tier: to.Ptr(armcontainerregistry.SKUTierStandard), // }, - // Policies: &armcontainerregistry.Policies{ - // AzureADAuthenticationAsArmPolicy: &armcontainerregistry.AzureADAuthenticationAsArmPolicy{ - // Status: to.Ptr(armcontainerregistry.AzureADAuthenticationAsArmPolicyStatusEnabled), + // Properties: &armcontainerregistry.RegistryProperties{ + // LoginServer: to.Ptr("myRegistry.azurecr.io"), + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:38:26.1537861Z"); return t}()), + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // AdminUserEnabled: to.Ptr(true), + // NetworkRuleSet: &armcontainerregistry.NetworkRuleSet{ + // DefaultAction: to.Ptr(armcontainerregistry.DefaultActionAllow), + // IPRules: []*armcontainerregistry.IPRule{ + // }, // }, - // ExportPolicy: &armcontainerregistry.ExportPolicy{ - // Status: to.Ptr(armcontainerregistry.ExportPolicyStatusEnabled), + // Policies: &armcontainerregistry.Policies{ + // QuarantinePolicy: &armcontainerregistry.QuarantinePolicy{ + // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), + // }, + // TrustPolicy: &armcontainerregistry.TrustPolicy{ + // Type: to.Ptr(armcontainerregistry.TrustPolicyTypeNotary), + // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), + // }, + // RetentionPolicy: &armcontainerregistry.RetentionPolicy{ + // Days: to.Ptr[int32](7), + // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:40:12.8506835+00:00"); return t}()), + // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), + // }, + // ExportPolicy: &armcontainerregistry.ExportPolicy{ + // Status: to.Ptr(armcontainerregistry.ExportPolicyStatusEnabled), + // }, // }, - // QuarantinePolicy: &armcontainerregistry.QuarantinePolicy{ - // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), + // Encryption: &armcontainerregistry.EncryptionProperty{ + // Status: to.Ptr(armcontainerregistry.EncryptionStatusDisabled), // }, - // RetentionPolicy: &armcontainerregistry.RetentionPolicy{ - // Days: to.Ptr[int32](7), - // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:40:12.850Z"); return t}()), - // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), + // DataEndpointEnabled: to.Ptr(false), + // DataEndpointHostNames: []*string{ // }, - // TrustPolicy: &armcontainerregistry.TrustPolicy{ - // Type: to.Ptr(armcontainerregistry.TrustPolicyTypeNotary), - // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), + // PrivateEndpointConnections: []*armcontainerregistry.PrivateEndpointConnection{ // }, + // PublicNetworkAccess: to.Ptr(armcontainerregistry.PublicNetworkAccessEnabled), + // NetworkRuleBypassOptions: to.Ptr(armcontainerregistry.NetworkRuleBypassOptionsAzureServices), + // NetworkRuleBypassAllowedForTasks: to.Ptr(false), + // ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyDisabled), + // AnonymousPullEnabled: to.Ptr(false), + // RoleAssignmentMode: to.Ptr(armcontainerregistry.RoleAssignmentModeAbacRepositoryPermissions), // }, - // PrivateEndpointConnections: []*armcontainerregistry.PrivateEndpointConnection{ - // }, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armcontainerregistry.PublicNetworkAccessEnabled), - // RoleAssignmentMode: to.Ptr(armcontainerregistry.RoleAssignmentModeLegacyRegistryPermissions), - // ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyDisabled), - // }, - // SKU: &armcontainerregistry.SKU{ - // Name: to.Ptr(armcontainerregistry.SKUNameStandard), - // Tier: to.Ptr(armcontainerregistry.SKUTierStandard), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/RegistryCreateAbac.json -func ExampleRegistriesClient_BeginCreate_registryCreateAbac() { +// Generated from example definition: 2025-11-01/RegistryCreateZoneRedundant.json +func ExampleRegistriesClient_BeginCreate_registryCreateZoneRedundant() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -430,12 +274,12 @@ func ExampleRegistriesClient_BeginCreate_registryCreateAbac() { Tags: map[string]*string{ "key": to.Ptr("value"), }, - Properties: &armcontainerregistry.RegistryProperties{ - RoleAssignmentMode: to.Ptr(armcontainerregistry.RoleAssignmentModeAbacRepositoryPermissions), - }, SKU: &armcontainerregistry.SKU{ Name: to.Ptr(armcontainerregistry.SKUNameStandard), }, + Properties: &armcontainerregistry.RegistryProperties{ + ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyEnabled), + }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -447,86 +291,80 @@ func ExampleRegistriesClient_BeginCreate_registryCreateAbac() { // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Registry = armcontainerregistry.Registry{ - // Name: to.Ptr("myRegistry"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Properties: &armcontainerregistry.RegistryProperties{ - // AdminUserEnabled: to.Ptr(true), - // AnonymousPullEnabled: to.Ptr(false), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:38:26.153Z"); return t}()), - // DataEndpointEnabled: to.Ptr(false), - // DataEndpointHostNames: []*string{ + // res = armcontainerregistry.RegistriesClientCreateResponse{ + // Registry: &armcontainerregistry.Registry{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry"), + // Name: to.Ptr("myRegistry"), + // Type: to.Ptr("Microsoft.ContainerRegistry/registries"), + // Location: to.Ptr("westus"), + // Tags: map[string]*string{ + // "key": to.Ptr("value"), // }, - // Encryption: &armcontainerregistry.EncryptionProperty{ - // Status: to.Ptr(armcontainerregistry.EncryptionStatusDisabled), + // SKU: &armcontainerregistry.SKU{ + // Name: to.Ptr(armcontainerregistry.SKUNameStandard), + // Tier: to.Ptr(armcontainerregistry.SKUTierStandard), // }, - // LoginServer: to.Ptr("myRegistry.azurecr.io"), - // NetworkRuleBypassAllowedForTasks: to.Ptr(false), - // NetworkRuleBypassOptions: to.Ptr(armcontainerregistry.NetworkRuleBypassOptionsAzureServices), - // NetworkRuleSet: &armcontainerregistry.NetworkRuleSet{ - // DefaultAction: to.Ptr(armcontainerregistry.DefaultActionAllow), - // IPRules: []*armcontainerregistry.IPRule{ + // Properties: &armcontainerregistry.RegistryProperties{ + // LoginServer: to.Ptr("myRegistry.azurecr.io"), + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:38:26.1537861Z"); return t}()), + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // AdminUserEnabled: to.Ptr(false), + // NetworkRuleSet: &armcontainerregistry.NetworkRuleSet{ + // DefaultAction: to.Ptr(armcontainerregistry.DefaultActionAllow), + // IPRules: []*armcontainerregistry.IPRule{ + // }, // }, - // }, - // Policies: &armcontainerregistry.Policies{ - // ExportPolicy: &armcontainerregistry.ExportPolicy{ - // Status: to.Ptr(armcontainerregistry.ExportPolicyStatusEnabled), + // Policies: &armcontainerregistry.Policies{ + // QuarantinePolicy: &armcontainerregistry.QuarantinePolicy{ + // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), + // }, + // TrustPolicy: &armcontainerregistry.TrustPolicy{ + // Type: to.Ptr(armcontainerregistry.TrustPolicyTypeNotary), + // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), + // }, + // RetentionPolicy: &armcontainerregistry.RetentionPolicy{ + // Days: to.Ptr[int32](7), + // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:40:12.8506835+00:00"); return t}()), + // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), + // }, + // ExportPolicy: &armcontainerregistry.ExportPolicy{ + // Status: to.Ptr(armcontainerregistry.ExportPolicyStatusEnabled), + // }, + // AzureADAuthenticationAsArmPolicy: &armcontainerregistry.AzureADAuthenticationAsArmPolicy{ + // Status: to.Ptr(armcontainerregistry.AzureADAuthenticationAsArmPolicyStatusEnabled), + // }, // }, - // QuarantinePolicy: &armcontainerregistry.QuarantinePolicy{ - // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), + // Encryption: &armcontainerregistry.EncryptionProperty{ + // Status: to.Ptr(armcontainerregistry.EncryptionStatusDisabled), // }, - // RetentionPolicy: &armcontainerregistry.RetentionPolicy{ - // Days: to.Ptr[int32](7), - // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:40:12.850Z"); return t}()), - // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), + // DataEndpointEnabled: to.Ptr(false), + // DataEndpointHostNames: []*string{ // }, - // TrustPolicy: &armcontainerregistry.TrustPolicy{ - // Type: to.Ptr(armcontainerregistry.TrustPolicyTypeNotary), - // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), + // PrivateEndpointConnections: []*armcontainerregistry.PrivateEndpointConnection{ // }, + // PublicNetworkAccess: to.Ptr(armcontainerregistry.PublicNetworkAccessEnabled), + // NetworkRuleBypassOptions: to.Ptr(armcontainerregistry.NetworkRuleBypassOptionsAzureServices), + // NetworkRuleBypassAllowedForTasks: to.Ptr(false), + // ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyEnabled), + // AnonymousPullEnabled: to.Ptr(false), + // RoleAssignmentMode: to.Ptr(armcontainerregistry.RoleAssignmentModeLegacyRegistryPermissions), // }, - // PrivateEndpointConnections: []*armcontainerregistry.PrivateEndpointConnection{ - // }, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armcontainerregistry.PublicNetworkAccessEnabled), - // RoleAssignmentMode: to.Ptr(armcontainerregistry.RoleAssignmentModeAbacRepositoryPermissions), - // ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyDisabled), - // }, - // SKU: &armcontainerregistry.SKU{ - // Name: to.Ptr(armcontainerregistry.SKUNameStandard), - // Tier: to.Ptr(armcontainerregistry.SKUTierStandard), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/RegistryCreateZoneRedundant.json -func ExampleRegistriesClient_BeginCreate_registryCreateZoneRedundant() { +// Generated from example definition: 2025-11-01/RegistryDelete.json +func ExampleRegistriesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewRegistriesClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", armcontainerregistry.Registry{ - Location: to.Ptr("westus"), - Tags: map[string]*string{ - "key": to.Ptr("value"), - }, - Properties: &armcontainerregistry.RegistryProperties{ - ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyEnabled), - }, - SKU: &armcontainerregistry.SKU{ - Name: to.Ptr(armcontainerregistry.SKUNameStandard), - }, - }, nil) + poller, err := clientFactory.NewRegistriesClient().BeginDelete(ctx, "myResourceGroup", "myRegistry", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -537,88 +375,24 @@ func ExampleRegistriesClient_BeginCreate_registryCreateZoneRedundant() { // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Registry = armcontainerregistry.Registry{ - // Name: to.Ptr("myRegistry"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Properties: &armcontainerregistry.RegistryProperties{ - // AdminUserEnabled: to.Ptr(false), - // AnonymousPullEnabled: to.Ptr(false), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:38:26.153Z"); return t}()), - // DataEndpointEnabled: to.Ptr(false), - // DataEndpointHostNames: []*string{ - // }, - // Encryption: &armcontainerregistry.EncryptionProperty{ - // Status: to.Ptr(armcontainerregistry.EncryptionStatusDisabled), - // }, - // LoginServer: to.Ptr("myRegistry.azurecr.io"), - // NetworkRuleBypassAllowedForTasks: to.Ptr(false), - // NetworkRuleBypassOptions: to.Ptr(armcontainerregistry.NetworkRuleBypassOptionsAzureServices), - // NetworkRuleSet: &armcontainerregistry.NetworkRuleSet{ - // DefaultAction: to.Ptr(armcontainerregistry.DefaultActionAllow), - // IPRules: []*armcontainerregistry.IPRule{ - // }, - // }, - // Policies: &armcontainerregistry.Policies{ - // AzureADAuthenticationAsArmPolicy: &armcontainerregistry.AzureADAuthenticationAsArmPolicy{ - // Status: to.Ptr(armcontainerregistry.AzureADAuthenticationAsArmPolicyStatusEnabled), - // }, - // ExportPolicy: &armcontainerregistry.ExportPolicy{ - // Status: to.Ptr(armcontainerregistry.ExportPolicyStatusEnabled), - // }, - // QuarantinePolicy: &armcontainerregistry.QuarantinePolicy{ - // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), - // }, - // RetentionPolicy: &armcontainerregistry.RetentionPolicy{ - // Days: to.Ptr[int32](7), - // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:40:12.850Z"); return t}()), - // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), - // }, - // TrustPolicy: &armcontainerregistry.TrustPolicy{ - // Type: to.Ptr(armcontainerregistry.TrustPolicyTypeNotary), - // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), - // }, - // }, - // PrivateEndpointConnections: []*armcontainerregistry.PrivateEndpointConnection{ - // }, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armcontainerregistry.PublicNetworkAccessEnabled), - // RoleAssignmentMode: to.Ptr(armcontainerregistry.RoleAssignmentModeLegacyRegistryPermissions), - // ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyEnabled), - // }, - // SKU: &armcontainerregistry.SKU{ - // Name: to.Ptr(armcontainerregistry.SKUNameStandard), - // Tier: to.Ptr(armcontainerregistry.SKUTierStandard), - // }, + // res = armcontainerregistry.RegistriesClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/RegistryUpdate.json -func ExampleRegistriesClient_BeginUpdate() { +// Generated from example definition: 2025-11-01/RegistryGenerateCredentials.json +func ExampleRegistriesClient_BeginGenerateCredentials() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewRegistriesClient().BeginUpdate(ctx, "myResourceGroup", "myRegistry", armcontainerregistry.RegistryUpdateParameters{ - Properties: &armcontainerregistry.RegistryPropertiesUpdateParameters{ - AdminUserEnabled: to.Ptr(true), - RoleAssignmentMode: to.Ptr(armcontainerregistry.RoleAssignmentModeAbacRepositoryPermissions), - }, - SKU: &armcontainerregistry.SKU{ - Name: to.Ptr(armcontainerregistry.SKUNameStandard), - }, - Tags: map[string]*string{ - "key": to.Ptr("value"), - }, + poller, err := clientFactory.NewRegistriesClient().BeginGenerateCredentials(ctx, "myResourceGroup", "myRegistry", armcontainerregistry.GenerateCredentialsParameters{ + TokenID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/myToken"), + Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-31T15:59:59.0707808Z"); return t }()), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -630,300 +404,357 @@ func ExampleRegistriesClient_BeginUpdate() { // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Registry = armcontainerregistry.Registry{ - // Name: to.Ptr("myRegistry"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Properties: &armcontainerregistry.RegistryProperties{ - // AdminUserEnabled: to.Ptr(true), - // AnonymousPullEnabled: to.Ptr(false), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:38:26.153Z"); return t}()), - // DataEndpointEnabled: to.Ptr(false), - // DataEndpointHostNames: []*string{ - // }, - // Encryption: &armcontainerregistry.EncryptionProperty{ - // Status: to.Ptr(armcontainerregistry.EncryptionStatusDisabled), - // }, - // LoginServer: to.Ptr("myRegistry.azurecr.io"), - // NetworkRuleBypassAllowedForTasks: to.Ptr(false), - // NetworkRuleBypassOptions: to.Ptr(armcontainerregistry.NetworkRuleBypassOptionsAzureServices), - // NetworkRuleSet: &armcontainerregistry.NetworkRuleSet{ - // DefaultAction: to.Ptr(armcontainerregistry.DefaultActionAllow), - // IPRules: []*armcontainerregistry.IPRule{ - // }, - // }, - // Policies: &armcontainerregistry.Policies{ - // AzureADAuthenticationAsArmPolicy: &armcontainerregistry.AzureADAuthenticationAsArmPolicy{ - // Status: to.Ptr(armcontainerregistry.AzureADAuthenticationAsArmPolicyStatusEnabled), + // res = armcontainerregistry.RegistriesClientGenerateCredentialsResponse{ + // GenerateCredentialsResult: &armcontainerregistry.GenerateCredentialsResult{ + // Username: to.Ptr("myToken"), + // Passwords: []*armcontainerregistry.TokenPassword{ + // { + // Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-31T15:59:59.0707808Z"); return t}()), + // Name: to.Ptr(armcontainerregistry.TokenPasswordNamePassword1), + // Value: to.Ptr("00000000000000000000000000000000"), // }, - // ExportPolicy: &armcontainerregistry.ExportPolicy{ - // Status: to.Ptr(armcontainerregistry.ExportPolicyStatusEnabled), + // { + // Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-31T15:59:59.0707808Z"); return t}()), + // Name: to.Ptr(armcontainerregistry.TokenPasswordNamePassword2), + // Value: to.Ptr("00000000000000000000000000000000"), // }, - // QuarantinePolicy: &armcontainerregistry.QuarantinePolicy{ - // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), - // }, - // RetentionPolicy: &armcontainerregistry.RetentionPolicy{ - // Days: to.Ptr[int32](7), - // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:40:12.850Z"); return t}()), - // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), - // }, - // TrustPolicy: &armcontainerregistry.TrustPolicy{ - // Type: to.Ptr(armcontainerregistry.TrustPolicyTypeNotary), - // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), - // }, - // }, - // PrivateEndpointConnections: []*armcontainerregistry.PrivateEndpointConnection{ // }, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armcontainerregistry.PublicNetworkAccessEnabled), - // RoleAssignmentMode: to.Ptr(armcontainerregistry.RoleAssignmentModeAbacRepositoryPermissions), - // ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyDisabled), - // }, - // SKU: &armcontainerregistry.SKU{ - // Name: to.Ptr(armcontainerregistry.SKUNameStandard), - // Tier: to.Ptr(armcontainerregistry.SKUTierStandard), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/RegistryDelete.json -func ExampleRegistriesClient_BeginDelete() { +// Generated from example definition: 2025-11-01/RegistryGet.json +func ExampleRegistriesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewRegistriesClient().BeginDelete(ctx, "myResourceGroup", "myRegistry", nil) + res, err := clientFactory.NewRegistriesClient().Get(ctx, "myResourceGroup", "myRegistry", 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) - } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armcontainerregistry.RegistriesClientGetResponse{ + // Registry: &armcontainerregistry.Registry{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry"), + // Name: to.Ptr("myRegistry"), + // Type: to.Ptr("Microsoft.ContainerRegistry/registries"), + // Location: to.Ptr("westus"), + // Tags: map[string]*string{ + // "key": to.Ptr("value"), + // }, + // SKU: &armcontainerregistry.SKU{ + // Name: to.Ptr(armcontainerregistry.SKUNameStandard), + // Tier: to.Ptr(armcontainerregistry.SKUTierStandard), + // }, + // Properties: &armcontainerregistry.RegistryProperties{ + // LoginServer: to.Ptr("myRegistry.azurecr.io"), + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:38:26.1537861Z"); return t}()), + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // AdminUserEnabled: to.Ptr(false), + // NetworkRuleSet: &armcontainerregistry.NetworkRuleSet{ + // DefaultAction: to.Ptr(armcontainerregistry.DefaultActionAllow), + // IPRules: []*armcontainerregistry.IPRule{ + // }, + // }, + // Policies: &armcontainerregistry.Policies{ + // QuarantinePolicy: &armcontainerregistry.QuarantinePolicy{ + // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), + // }, + // TrustPolicy: &armcontainerregistry.TrustPolicy{ + // Type: to.Ptr(armcontainerregistry.TrustPolicyTypeNotary), + // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), + // }, + // RetentionPolicy: &armcontainerregistry.RetentionPolicy{ + // Days: to.Ptr[int32](7), + // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:40:12.8506835+00:00"); return t}()), + // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), + // }, + // ExportPolicy: &armcontainerregistry.ExportPolicy{ + // Status: to.Ptr(armcontainerregistry.ExportPolicyStatusEnabled), + // }, + // AzureADAuthenticationAsArmPolicy: &armcontainerregistry.AzureADAuthenticationAsArmPolicy{ + // Status: to.Ptr(armcontainerregistry.AzureADAuthenticationAsArmPolicyStatusEnabled), + // }, + // }, + // Encryption: &armcontainerregistry.EncryptionProperty{ + // Status: to.Ptr(armcontainerregistry.EncryptionStatusDisabled), + // }, + // DataEndpointEnabled: to.Ptr(false), + // DataEndpointHostNames: []*string{ + // }, + // PrivateEndpointConnections: []*armcontainerregistry.PrivateEndpointConnection{ + // }, + // PublicNetworkAccess: to.Ptr(armcontainerregistry.PublicNetworkAccessEnabled), + // NetworkRuleBypassOptions: to.Ptr(armcontainerregistry.NetworkRuleBypassOptionsAzureServices), + // NetworkRuleBypassAllowedForTasks: to.Ptr(false), + // ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyDisabled), + // AnonymousPullEnabled: to.Ptr(false), + // RoleAssignmentMode: to.Ptr(armcontainerregistry.RoleAssignmentModeLegacyRegistryPermissions), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/RegistryGenerateCredentials.json -func ExampleRegistriesClient_BeginGenerateCredentials() { +// Generated from example definition: 2025-11-01/RegistryGetPrivateLinkResource.json +func ExampleRegistriesClient_GetPrivateLinkResource() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewRegistriesClient().BeginGenerateCredentials(ctx, "myResourceGroup", "myRegistry", armcontainerregistry.GenerateCredentialsParameters{ - Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-31T15:59:59.070Z"); return t }()), - TokenID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/myToken"), - }, nil) + res, err := clientFactory.NewRegistriesClient().GetPrivateLinkResource(ctx, "myResourceGroup", "myRegistry", "registry", 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) - } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GenerateCredentialsResult = armcontainerregistry.GenerateCredentialsResult{ - // Passwords: []*armcontainerregistry.TokenPassword{ - // { - // Name: to.Ptr(armcontainerregistry.TokenPasswordNamePassword1), - // Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-31T15:59:59.070Z"); return t}()), - // Value: to.Ptr("00000000000000000000000000000000"), + // res = armcontainerregistry.RegistriesClientGetPrivateLinkResourceResponse{ + // PrivateLinkResource: &armcontainerregistry.PrivateLinkResource{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/privateLinkResources/registry"), + // Name: to.Ptr("registry"), + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/privateLinkResources"), + // Properties: &armcontainerregistry.PrivateLinkResourceProperties{ + // GroupID: to.Ptr("registry"), + // RequiredMembers: []*string{ + // to.Ptr("registry"), + // to.Ptr("registry_data_myregion"), + // }, + // RequiredZoneNames: []*string{ + // to.Ptr("privatelink.azurecr.io"), + // }, // }, - // { - // Name: to.Ptr(armcontainerregistry.TokenPasswordNamePassword2), - // Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-31T15:59:59.070Z"); return t}()), - // Value: to.Ptr("00000000000000000000000000000000"), - // }}, - // Username: to.Ptr("myToken"), + // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/ImportImageByManifestDigest.json +// Generated from example definition: 2025-11-01/ImportImageByManifestDigest.json func ExampleRegistriesClient_BeginImportImage_importImageByManifestDigest() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewRegistriesClient().BeginImportImage(ctx, "myResourceGroup", "myRegistry", armcontainerregistry.ImportImageParameters{ - Mode: to.Ptr(armcontainerregistry.ImportModeForce), Source: &armcontainerregistry.ImportSource{ ResourceID: to.Ptr("/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/sourceResourceGroup/providers/Microsoft.ContainerRegistry/registries/sourceRegistry"), SourceImage: to.Ptr("sourceRepository@sha256:0000000000000000000000000000000000000000000000000000000000000000"), }, TargetTags: []*string{ - to.Ptr("targetRepository:targetTag")}, + to.Ptr("targetRepository:targetTag"), + }, UntaggedTargetRepositories: []*string{ - to.Ptr("targetRepository1")}, + to.Ptr("targetRepository1"), + }, + Mode: to.Ptr(armcontainerregistry.ImportModeForce), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armcontainerregistry.RegistriesClientImportImageResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/ImportImageByTag.json +// Generated from example definition: 2025-11-01/ImportImageByTag.json func ExampleRegistriesClient_BeginImportImage_importImageByTag() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewRegistriesClient().BeginImportImage(ctx, "myResourceGroup", "myRegistry", armcontainerregistry.ImportImageParameters{ - Mode: to.Ptr(armcontainerregistry.ImportModeForce), Source: &armcontainerregistry.ImportSource{ ResourceID: to.Ptr("/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/sourceResourceGroup/providers/Microsoft.ContainerRegistry/registries/sourceRegistry"), SourceImage: to.Ptr("sourceRepository:sourceTag"), }, TargetTags: []*string{ - to.Ptr("targetRepository:targetTag")}, + to.Ptr("targetRepository:targetTag"), + }, UntaggedTargetRepositories: []*string{ - to.Ptr("targetRepository1")}, + to.Ptr("targetRepository1"), + }, + Mode: to.Ptr(armcontainerregistry.ImportModeForce), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armcontainerregistry.RegistriesClientImportImageResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/ImportImageFromPublicRegistry.json +// Generated from example definition: 2025-11-01/ImportImageFromPublicRegistry.json func ExampleRegistriesClient_BeginImportImage_importImageFromPublicRegistry() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewRegistriesClient().BeginImportImage(ctx, "myResourceGroup", "myRegistry", armcontainerregistry.ImportImageParameters{ - Mode: to.Ptr(armcontainerregistry.ImportModeForce), Source: &armcontainerregistry.ImportSource{ RegistryURI: to.Ptr("registry.hub.docker.com"), SourceImage: to.Ptr("library/hello-world"), }, TargetTags: []*string{ - to.Ptr("targetRepository:targetTag")}, + to.Ptr("targetRepository:targetTag"), + }, UntaggedTargetRepositories: []*string{ - to.Ptr("targetRepository1")}, + to.Ptr("targetRepository1"), + }, + Mode: to.Ptr(armcontainerregistry.ImportModeForce), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, 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/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/RegistryListCredentials.json -func ExampleRegistriesClient_ListCredentials() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRegistriesClient().ListCredentials(ctx, "myResourceGroup", "myRegistry", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RegistryListCredentialsResult = armcontainerregistry.RegistryListCredentialsResult{ - // Passwords: []*armcontainerregistry.RegistryPassword{ - // { - // Name: to.Ptr(armcontainerregistry.PasswordNamePassword), - // Value: to.Ptr("00000000000000000000000000000000"), - // }, - // { - // Name: to.Ptr(armcontainerregistry.PasswordNamePassword2), - // Value: to.Ptr("00000000000000000000000000000000"), - // }}, - // Username: to.Ptr("myRegistry"), + // res = armcontainerregistry.RegistriesClientImportImageResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/RegistryListUsages.json -func ExampleRegistriesClient_ListUsages() { +// Generated from example definition: 2025-11-01/RegistryList.json +func ExampleRegistriesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewRegistriesClient().ListUsages(ctx, "myResourceGroup", "myRegistry", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) + pager := clientFactory.NewRegistriesClient().NewListPager(nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page = armcontainerregistry.RegistriesClientListResponse{ + // RegistryListResult: armcontainerregistry.RegistryListResult{ + // Value: []*armcontainerregistry.Registry{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry"), + // Name: to.Ptr("myRegistry"), + // Type: to.Ptr("Microsoft.ContainerRegistry/registries"), + // Location: to.Ptr("westus"), + // Tags: map[string]*string{ + // "key": to.Ptr("value"), + // }, + // SKU: &armcontainerregistry.SKU{ + // Name: to.Ptr(armcontainerregistry.SKUNameStandard), + // Tier: to.Ptr(armcontainerregistry.SKUTierStandard), + // }, + // Properties: &armcontainerregistry.RegistryProperties{ + // LoginServer: to.Ptr("myRegistry.azurecr.io"), + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:38:26.1537861Z"); return t}()), + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // AdminUserEnabled: to.Ptr(false), + // NetworkRuleSet: &armcontainerregistry.NetworkRuleSet{ + // DefaultAction: to.Ptr(armcontainerregistry.DefaultActionAllow), + // IPRules: []*armcontainerregistry.IPRule{ + // }, + // }, + // Policies: &armcontainerregistry.Policies{ + // QuarantinePolicy: &armcontainerregistry.QuarantinePolicy{ + // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), + // }, + // TrustPolicy: &armcontainerregistry.TrustPolicy{ + // Type: to.Ptr(armcontainerregistry.TrustPolicyTypeNotary), + // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), + // }, + // RetentionPolicy: &armcontainerregistry.RetentionPolicy{ + // Days: to.Ptr[int32](7), + // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:40:12.8506835+00:00"); return t}()), + // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), + // }, + // ExportPolicy: &armcontainerregistry.ExportPolicy{ + // Status: to.Ptr(armcontainerregistry.ExportPolicyStatusEnabled), + // }, + // AzureADAuthenticationAsArmPolicy: &armcontainerregistry.AzureADAuthenticationAsArmPolicy{ + // Status: to.Ptr(armcontainerregistry.AzureADAuthenticationAsArmPolicyStatusEnabled), + // }, + // }, + // Encryption: &armcontainerregistry.EncryptionProperty{ + // Status: to.Ptr(armcontainerregistry.EncryptionStatusDisabled), + // }, + // DataEndpointEnabled: to.Ptr(false), + // DataEndpointHostNames: []*string{ + // }, + // PrivateEndpointConnections: []*armcontainerregistry.PrivateEndpointConnection{ + // }, + // PublicNetworkAccess: to.Ptr(armcontainerregistry.PublicNetworkAccessEnabled), + // NetworkRuleBypassOptions: to.Ptr(armcontainerregistry.NetworkRuleBypassOptionsAzureServices), + // NetworkRuleBypassAllowedForTasks: to.Ptr(false), + // ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyDisabled), + // AnonymousPullEnabled: to.Ptr(false), + // RoleAssignmentMode: to.Ptr(armcontainerregistry.RoleAssignmentModeLegacyRegistryPermissions), + // }, + // }, + // }, + // }, + // } } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RegistryUsageListResult = armcontainerregistry.RegistryUsageListResult{ - // Value: []*armcontainerregistry.RegistryUsage{ - // { - // Name: to.Ptr("Size"), - // CurrentValue: to.Ptr[int64](12345678), - // Limit: to.Ptr[int64](107374182400), - // Unit: to.Ptr(armcontainerregistry.RegistryUsageUnitBytes), - // }, - // { - // Name: to.Ptr("Webhooks"), - // CurrentValue: to.Ptr[int64](2), - // Limit: to.Ptr[int64](10), - // Unit: to.Ptr(armcontainerregistry.RegistryUsageUnitCount), - // }}, - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/RegistryListPrivateLinkResources.json -func ExampleRegistriesClient_NewListPrivateLinkResourcesPager() { +// Generated from example definition: 2025-11-01/RegistryListByResourceGroup.json +func ExampleRegistriesClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewRegistriesClient().NewListPrivateLinkResourcesPager("myResourceGroup", "myRegistry", nil) + pager := clientFactory.NewRegistriesClient().NewListByResourceGroupPager("myResourceGroup", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -934,385 +765,205 @@ func ExampleRegistriesClient_NewListPrivateLinkResourcesPager() { _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PrivateLinkResourceListResult = armcontainerregistry.PrivateLinkResourceListResult{ - // Value: []*armcontainerregistry.PrivateLinkResource{ - // { - // Name: to.Ptr("registry"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/privateLinkResources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/privateLinkResources/registry"), - // Properties: &armcontainerregistry.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("registry"), - // RequiredMembers: []*string{ - // to.Ptr("registry"), - // to.Ptr("registry_data_myregion")}, - // RequiredZoneNames: []*string{ - // to.Ptr("privatelink.azurecr.io")}, + // page = armcontainerregistry.RegistriesClientListByResourceGroupResponse{ + // RegistryListResult: armcontainerregistry.RegistryListResult{ + // Value: []*armcontainerregistry.Registry{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry"), + // Name: to.Ptr("myRegistry"), + // Type: to.Ptr("Microsoft.ContainerRegistry/registries"), + // Location: to.Ptr("westus"), + // Tags: map[string]*string{ + // "key": to.Ptr("value"), + // }, + // SKU: &armcontainerregistry.SKU{ + // Name: to.Ptr(armcontainerregistry.SKUNameStandard), + // Tier: to.Ptr(armcontainerregistry.SKUTierStandard), + // }, + // Properties: &armcontainerregistry.RegistryProperties{ + // LoginServer: to.Ptr("myRegistry.azurecr.io"), + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:38:26.1537861Z"); return t}()), + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // AdminUserEnabled: to.Ptr(false), + // NetworkRuleSet: &armcontainerregistry.NetworkRuleSet{ + // DefaultAction: to.Ptr(armcontainerregistry.DefaultActionAllow), + // IPRules: []*armcontainerregistry.IPRule{ + // }, + // }, + // Policies: &armcontainerregistry.Policies{ + // QuarantinePolicy: &armcontainerregistry.QuarantinePolicy{ + // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), + // }, + // TrustPolicy: &armcontainerregistry.TrustPolicy{ + // Type: to.Ptr(armcontainerregistry.TrustPolicyTypeNotary), + // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), + // }, + // RetentionPolicy: &armcontainerregistry.RetentionPolicy{ + // Days: to.Ptr[int32](7), + // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:40:12.8506835+00:00"); return t}()), + // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), + // }, + // ExportPolicy: &armcontainerregistry.ExportPolicy{ + // Status: to.Ptr(armcontainerregistry.ExportPolicyStatusEnabled), + // }, + // AzureADAuthenticationAsArmPolicy: &armcontainerregistry.AzureADAuthenticationAsArmPolicy{ + // Status: to.Ptr(armcontainerregistry.AzureADAuthenticationAsArmPolicyStatusEnabled), + // }, // }, - // }}, - // } + // Encryption: &armcontainerregistry.EncryptionProperty{ + // Status: to.Ptr(armcontainerregistry.EncryptionStatusDisabled), + // }, + // DataEndpointEnabled: to.Ptr(false), + // DataEndpointHostNames: []*string{ + // }, + // PrivateEndpointConnections: []*armcontainerregistry.PrivateEndpointConnection{ + // }, + // PublicNetworkAccess: to.Ptr(armcontainerregistry.PublicNetworkAccessEnabled), + // NetworkRuleBypassOptions: to.Ptr(armcontainerregistry.NetworkRuleBypassOptionsAzureServices), + // NetworkRuleBypassAllowedForTasks: to.Ptr(false), + // ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyDisabled), + // AnonymousPullEnabled: to.Ptr(false), + // RoleAssignmentMode: to.Ptr(armcontainerregistry.RoleAssignmentModeLegacyRegistryPermissions), + // }, + // }, + // }, + // }, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/RegistryGetPrivateLinkResource.json -func ExampleRegistriesClient_GetPrivateLinkResource() { +// Generated from example definition: 2025-11-01/RegistryListCredentials.json +func ExampleRegistriesClient_ListCredentials() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewRegistriesClient().GetPrivateLinkResource(ctx, "myResourceGroup", "myRegistry", "registry", nil) + res, err := clientFactory.NewRegistriesClient().ListCredentials(ctx, "myResourceGroup", "myRegistry", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateLinkResource = armcontainerregistry.PrivateLinkResource{ - // Name: to.Ptr("registry"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/privateLinkResources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/privateLinkResources/registry"), - // Properties: &armcontainerregistry.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("registry"), - // RequiredMembers: []*string{ - // to.Ptr("registry"), - // to.Ptr("registry_data_myregion")}, - // RequiredZoneNames: []*string{ - // to.Ptr("privatelink.azurecr.io")}, + // res = armcontainerregistry.RegistriesClientListCredentialsResponse{ + // RegistryListCredentialsResult: &armcontainerregistry.RegistryListCredentialsResult{ + // Username: to.Ptr("myRegistry"), + // Passwords: []*armcontainerregistry.RegistryPassword{ + // { + // Name: to.Ptr(armcontainerregistry.PasswordNamePassword), + // Value: to.Ptr("00000000000000000000000000000000"), + // }, + // { + // Name: to.Ptr(armcontainerregistry.PasswordNamePassword2), + // Value: to.Ptr("00000000000000000000000000000000"), // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/RegistryRegenerateCredential.json -func ExampleRegistriesClient_RegenerateCredential() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRegistriesClient().RegenerateCredential(ctx, "myResourceGroup", "myRegistry", armcontainerregistry.RegenerateCredentialParameters{ - Name: to.Ptr(armcontainerregistry.PasswordNamePassword), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RegistryListCredentialsResult = armcontainerregistry.RegistryListCredentialsResult{ - // Passwords: []*armcontainerregistry.RegistryPassword{ - // { - // Name: to.Ptr(armcontainerregistry.PasswordNamePassword), - // Value: to.Ptr("00000000000000000000000000000000"), // }, - // { - // Name: to.Ptr(armcontainerregistry.PasswordNamePassword2), - // Value: to.Ptr("00000000000000000000000000000000"), - // }}, - // Username: to.Ptr("myRegistry"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/preview/2025-03-01-preview/examples/RegistriesGetBuildSourceUploadUrl.json -func ExampleRegistriesClient_GetBuildSourceUploadURL() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRegistriesClient().GetBuildSourceUploadURL(ctx, "myResourceGroup", "myRegistry", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SourceUploadDefinition = armcontainerregistry.SourceUploadDefinition{ - // RelativePath: to.Ptr("source/201802130000/b52f12d8-c3d6-4d75-9107-220f0bfc681d.tar.gz"), - // UploadURL: to.Ptr("https://registrystorageaccount.blob.core.windows.net/registrycontainer/source/201802130000/b52f12d8-c3d6-4d75-9107-220f0bfc681d.tar.gz?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/preview/2025-03-01-preview/examples/RegistriesScheduleRun.json -func ExampleRegistriesClient_ScheduleRun_registriesScheduleRun() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRegistriesClient().ScheduleRun(ctx, "myResourceGroup", "myRegistry", &armcontainerregistry.DockerBuildRequest{ - Type: to.Ptr("DockerBuildRequest"), - IsArchiveEnabled: to.Ptr(true), - AgentConfiguration: &armcontainerregistry.AgentProperties{ - CPU: to.Ptr[int32](2), - }, - Arguments: []*armcontainerregistry.Argument{ - { - Name: to.Ptr("mytestargument"), - IsSecret: to.Ptr(false), - Value: to.Ptr("mytestvalue"), - }, - { - Name: to.Ptr("mysecrettestargument"), - IsSecret: to.Ptr(true), - Value: to.Ptr("mysecrettestvalue"), - }}, - DockerFilePath: to.Ptr("DockerFile"), - ImageNames: []*string{ - to.Ptr("azurerest:testtag")}, - IsPushEnabled: to.Ptr(true), - NoCache: to.Ptr(true), - Platform: &armcontainerregistry.PlatformProperties{ - Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64), - OS: to.Ptr(armcontainerregistry.OSLinux), - }, - SourceLocation: to.Ptr("https://myaccount.blob.core.windows.net/sascontainer/source.zip?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Run = armcontainerregistry.Run{ - // Name: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/run"), - // ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/runs/0accec26-d6de-4757-8e74-d080f38eaaab"), - // Properties: &armcontainerregistry.RunProperties{ - // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T05:13:51.617Z"); return t}()), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // RunID: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"), - // Status: to.Ptr(armcontainerregistry.RunStatusSucceeded), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/preview/2025-03-01-preview/examples/RegistriesScheduleRun_EncodedTaskRun.json -func ExampleRegistriesClient_ScheduleRun_registriesScheduleRunEncodedTaskRun() { +// Generated from example definition: 2025-11-01/RegistryListPrivateLinkResources.json +func ExampleRegistriesClient_NewListPrivateLinkResourcesPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewRegistriesClient().ScheduleRun(ctx, "myResourceGroup", "myRegistry", &armcontainerregistry.EncodedTaskRunRequest{ - Type: to.Ptr("EncodedTaskRunRequest"), - AgentConfiguration: &armcontainerregistry.AgentProperties{ - CPU: to.Ptr[int32](2), - }, - EncodedTaskContent: to.Ptr("c3RlcHM6Cnt7IGlmIFZhbHVlcy5lbnZpcm9ubWVudCA9PSAncHJvZCcgfX0KICAtIHJ1bjogcHJvZCBzZXR1cAp7eyBlbHNlIGlmIFZhbHVlcy5lbnZpcm9ubWVudCA9PSAnc3RhZ2luZycgfX0KICAtIHJ1bjogc3RhZ2luZyBzZXR1cAp7eyBlbHNlIH19CiAgLSBydW46IGRlZmF1bHQgc2V0dXAKe3sgZW5kIH19CgogIC0gcnVuOiBidWlsZCAtdCBGYW5jeVRoaW5nOnt7LlZhbHVlcy5lbnZpcm9ubWVudH19LXt7LlZhbHVlcy52ZXJzaW9ufX0gLgoKcHVzaDogWydGYW5jeVRoaW5nOnt7LlZhbHVlcy5lbnZpcm9ubWVudH19LXt7LlZhbHVlcy52ZXJzaW9ufX0nXQ=="), - EncodedValuesContent: to.Ptr("ZW52aXJvbm1lbnQ6IHByb2QKdmVyc2lvbjogMQ=="), - Platform: &armcontainerregistry.PlatformProperties{ - OS: to.Ptr(armcontainerregistry.OSLinux), - }, - Values: []*armcontainerregistry.SetValue{ - { - Name: to.Ptr("mytestargument"), - IsSecret: to.Ptr(false), - Value: to.Ptr("mytestvalue"), - }, - { - Name: to.Ptr("mysecrettestargument"), - IsSecret: to.Ptr(true), - Value: to.Ptr("mysecrettestvalue"), - }}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) + pager := clientFactory.NewRegistriesClient().NewListPrivateLinkResourcesPager("myResourceGroup", "myRegistry", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page = armcontainerregistry.RegistriesClientListPrivateLinkResourcesResponse{ + // PrivateLinkResourceListResult: armcontainerregistry.PrivateLinkResourceListResult{ + // Value: []*armcontainerregistry.PrivateLinkResource{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/privateLinkResources/registry"), + // Name: to.Ptr("registry"), + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/privateLinkResources"), + // Properties: &armcontainerregistry.PrivateLinkResourceProperties{ + // GroupID: to.Ptr("registry"), + // RequiredMembers: []*string{ + // to.Ptr("registry"), + // to.Ptr("registry_data_myregion"), + // }, + // RequiredZoneNames: []*string{ + // to.Ptr("privatelink.azurecr.io"), + // }, + // }, + // }, + // }, + // }, + // } } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Run = armcontainerregistry.Run{ - // Name: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/run"), - // ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/runs/0accec26-d6de-4757-8e74-d080f38eaaab"), - // Properties: &armcontainerregistry.RunProperties{ - // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T05:13:51.617Z"); return t}()), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // RunID: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"), - // Status: to.Ptr(armcontainerregistry.RunStatusSucceeded), - // }, - // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/preview/2025-03-01-preview/examples/RegistriesScheduleRun_FileTaskRun.json -func ExampleRegistriesClient_ScheduleRun_registriesScheduleRunFileTaskRun() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRegistriesClient().ScheduleRun(ctx, "myResourceGroup", "myRegistry", &armcontainerregistry.FileTaskRunRequest{ - Type: to.Ptr("FileTaskRunRequest"), - AgentConfiguration: &armcontainerregistry.AgentProperties{ - CPU: to.Ptr[int32](2), - }, - Platform: &armcontainerregistry.PlatformProperties{ - OS: to.Ptr(armcontainerregistry.OSLinux), - }, - SourceLocation: to.Ptr("https://myaccount.blob.core.windows.net/sascontainer/source.zip?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D"), - TaskFilePath: to.Ptr("acb.yaml"), - Values: []*armcontainerregistry.SetValue{ - { - Name: to.Ptr("mytestargument"), - IsSecret: to.Ptr(false), - Value: to.Ptr("mytestvalue"), - }, - { - Name: to.Ptr("mysecrettestargument"), - IsSecret: to.Ptr(true), - Value: to.Ptr("mysecrettestvalue"), - }}, - ValuesFilePath: to.Ptr("prod-values.yaml"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Run = armcontainerregistry.Run{ - // Name: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/run"), - // ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/runs/0accec26-d6de-4757-8e74-d080f38eaaab"), - // Properties: &armcontainerregistry.RunProperties{ - // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T05:13:51.617Z"); return t}()), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // RunID: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"), - // Status: to.Ptr(armcontainerregistry.RunStatusSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/preview/2025-03-01-preview/examples/RegistriesScheduleRun_Task.json -func ExampleRegistriesClient_ScheduleRun_registriesScheduleRunTask() { +// Generated from example definition: 2025-11-01/RegistryListUsages.json +func ExampleRegistriesClient_ListUsages() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewRegistriesClient().ScheduleRun(ctx, "myResourceGroup", "myRegistry", &armcontainerregistry.TaskRunRequest{ - Type: to.Ptr("TaskRunRequest"), - OverrideTaskStepProperties: &armcontainerregistry.OverrideTaskStepProperties{ - Arguments: []*armcontainerregistry.Argument{ - { - Name: to.Ptr("mytestargument"), - IsSecret: to.Ptr(false), - Value: to.Ptr("mytestvalue"), - }, - { - Name: to.Ptr("mysecrettestargument"), - IsSecret: to.Ptr(true), - Value: to.Ptr("mysecrettestvalue"), - }}, - File: to.Ptr("overriddenDockerfile"), - Target: to.Ptr("build"), - UpdateTriggerToken: to.Ptr("aGVsbG8gd29ybGQ="), - Values: []*armcontainerregistry.SetValue{ - { - Name: to.Ptr("mytestname"), - IsSecret: to.Ptr(false), - Value: to.Ptr("mytestvalue"), - }, - { - Name: to.Ptr("mysecrettestname"), - IsSecret: to.Ptr(true), - Value: to.Ptr("mysecrettestvalue"), - }}, - }, - TaskID: to.Ptr("myTask"), - }, nil) + res, err := clientFactory.NewRegistriesClient().ListUsages(ctx, "myResourceGroup", "myRegistry", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Run = armcontainerregistry.Run{ - // Name: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/run"), - // ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/runs/0accec26-d6de-4757-8e74-d080f38eaaab"), - // Properties: &armcontainerregistry.RunProperties{ - // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T05:13:51.617Z"); return t}()), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // RunID: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"), - // Status: to.Ptr(armcontainerregistry.RunStatusSucceeded), + // res = armcontainerregistry.RegistriesClientListUsagesResponse{ + // RegistryUsageListResult: &armcontainerregistry.RegistryUsageListResult{ + // Value: []*armcontainerregistry.RegistryUsage{ + // { + // Name: to.Ptr("Size"), + // Limit: to.Ptr[int64](107374182400), + // CurrentValue: to.Ptr[int64](12345678), + // Unit: to.Ptr(armcontainerregistry.RegistryUsageUnitBytes), + // }, + // { + // Name: to.Ptr("Webhooks"), + // Limit: to.Ptr[int64](10), + // CurrentValue: to.Ptr[int64](2), + // Unit: to.Ptr(armcontainerregistry.RegistryUsageUnitCount), + // }, + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/preview/2025-03-01-preview/examples/RegistriesScheduleRun_FileTask_WithCustomCredentials.json -func ExampleRegistriesClient_ScheduleRun_registriesScheduleRunTaskWithCustomCredentials() { +// Generated from example definition: 2025-11-01/RegistryRegenerateCredential.json +func ExampleRegistriesClient_RegenerateCredential() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewRegistriesClient().ScheduleRun(ctx, "myResourceGroup", "myRegistry", &armcontainerregistry.FileTaskRunRequest{ - Type: to.Ptr("FileTaskRunRequest"), - Credentials: &armcontainerregistry.Credentials{ - CustomRegistries: map[string]*armcontainerregistry.CustomRegistryCredentials{ - "myregistry.azurecr.io": { - Password: &armcontainerregistry.SecretObject{ - Type: to.Ptr(armcontainerregistry.SecretObjectTypeOpaque), - Value: to.Ptr("***"), - }, - UserName: &armcontainerregistry.SecretObject{ - Type: to.Ptr(armcontainerregistry.SecretObjectTypeOpaque), - Value: to.Ptr("reg1"), - }, - }, - }, - SourceRegistry: &armcontainerregistry.SourceRegistryCredentials{ - LoginMode: to.Ptr(armcontainerregistry.SourceRegistryLoginModeDefault), - }, - }, - Platform: &armcontainerregistry.PlatformProperties{ - OS: to.Ptr(armcontainerregistry.OSLinux), - }, - TaskFilePath: to.Ptr("acb.yaml"), - Values: []*armcontainerregistry.SetValue{ - { - Name: to.Ptr("mytestargument"), - IsSecret: to.Ptr(false), - Value: to.Ptr("mytestvalue"), - }, - { - Name: to.Ptr("mysecrettestargument"), - IsSecret: to.Ptr(true), - Value: to.Ptr("mysecrettestvalue"), - }}, + res, err := clientFactory.NewRegistriesClient().RegenerateCredential(ctx, "myResourceGroup", "myRegistry", armcontainerregistry.RegenerateCredentialParameters{ + Name: to.Ptr(armcontainerregistry.PasswordNamePassword), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -1320,160 +971,114 @@ func ExampleRegistriesClient_ScheduleRun_registriesScheduleRunTaskWithCustomCred // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Run = armcontainerregistry.Run{ - // Name: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/run"), - // ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/runs/0accec26-d6de-4757-8e74-d080f38eaaab"), - // Properties: &armcontainerregistry.RunProperties{ - // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T05:13:51.617Z"); return t}()), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // RunID: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"), - // Status: to.Ptr(armcontainerregistry.RunStatusSucceeded), + // res = armcontainerregistry.RegistriesClientRegenerateCredentialResponse{ + // RegistryListCredentialsResult: &armcontainerregistry.RegistryListCredentialsResult{ + // Username: to.Ptr("myRegistry"), + // Passwords: []*armcontainerregistry.RegistryPassword{ + // { + // Name: to.Ptr(armcontainerregistry.PasswordNamePassword), + // Value: to.Ptr("00000000000000000000000000000000"), + // }, + // { + // Name: to.Ptr(armcontainerregistry.PasswordNamePassword2), + // Value: to.Ptr("00000000000000000000000000000000"), + // }, + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/preview/2025-03-01-preview/examples/RegistriesScheduleRun_WithCustomCredentials.json -func ExampleRegistriesClient_ScheduleRun_registriesScheduleRunWithCustomCredentials() { +// Generated from example definition: 2025-11-01/RegistryUpdate.json +func ExampleRegistriesClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewRegistriesClient().ScheduleRun(ctx, "myResourceGroup", "myRegistry", &armcontainerregistry.DockerBuildRequest{ - Type: to.Ptr("DockerBuildRequest"), - IsArchiveEnabled: to.Ptr(true), - AgentConfiguration: &armcontainerregistry.AgentProperties{ - CPU: to.Ptr[int32](2), + poller, err := clientFactory.NewRegistriesClient().BeginUpdate(ctx, "myResourceGroup", "myRegistry", armcontainerregistry.RegistryUpdateParameters{ + Tags: map[string]*string{ + "key": to.Ptr("value"), }, - Arguments: []*armcontainerregistry.Argument{ - { - Name: to.Ptr("mytestargument"), - IsSecret: to.Ptr(false), - Value: to.Ptr("mytestvalue"), - }, - { - Name: to.Ptr("mysecrettestargument"), - IsSecret: to.Ptr(true), - Value: to.Ptr("mysecrettestvalue"), - }}, - Credentials: &armcontainerregistry.Credentials{ - CustomRegistries: map[string]*armcontainerregistry.CustomRegistryCredentials{ - "myregistry.azurecr.io": { - Password: &armcontainerregistry.SecretObject{ - Type: to.Ptr(armcontainerregistry.SecretObjectTypeOpaque), - Value: to.Ptr("***"), - }, - UserName: &armcontainerregistry.SecretObject{ - Type: to.Ptr(armcontainerregistry.SecretObjectTypeOpaque), - Value: to.Ptr("reg1"), - }, - }, - "myregistry2.azurecr.io": { - Password: &armcontainerregistry.SecretObject{ - Type: to.Ptr(armcontainerregistry.SecretObjectTypeOpaque), - Value: to.Ptr("***"), - }, - UserName: &armcontainerregistry.SecretObject{ - Type: to.Ptr(armcontainerregistry.SecretObjectTypeOpaque), - Value: to.Ptr("reg2"), - }, - }, - }, - SourceRegistry: &armcontainerregistry.SourceRegistryCredentials{ - LoginMode: to.Ptr(armcontainerregistry.SourceRegistryLoginModeDefault), - }, + SKU: &armcontainerregistry.SKU{ + Name: to.Ptr(armcontainerregistry.SKUNameStandard), }, - DockerFilePath: to.Ptr("DockerFile"), - ImageNames: []*string{ - to.Ptr("azurerest:testtag")}, - IsPushEnabled: to.Ptr(true), - NoCache: to.Ptr(true), - Platform: &armcontainerregistry.PlatformProperties{ - Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64), - OS: to.Ptr(armcontainerregistry.OSLinux), + Properties: &armcontainerregistry.RegistryPropertiesUpdateParameters{ + AdminUserEnabled: to.Ptr(true), + RoleAssignmentMode: to.Ptr(armcontainerregistry.RoleAssignmentModeAbacRepositoryPermissions), }, - SourceLocation: to.Ptr("https://myaccount.blob.core.windows.net/sascontainer/source.zip?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D"), - Target: to.Ptr("stage1"), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Run = armcontainerregistry.Run{ - // Name: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/run"), - // ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/runs/0accec26-d6de-4757-8e74-d080f38eaaab"), - // Properties: &armcontainerregistry.RunProperties{ - // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T05:13:51.617Z"); return t}()), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // RunID: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"), - // Status: to.Ptr(armcontainerregistry.RunStatusSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/preview/2025-03-01-preview/examples/RegistriesScheduleRun_WithLogTemplate.json -func ExampleRegistriesClient_ScheduleRun_registriesScheduleRunWithLogTemplate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRegistriesClient().ScheduleRun(ctx, "myResourceGroup", "myRegistry", &armcontainerregistry.DockerBuildRequest{ - Type: to.Ptr("DockerBuildRequest"), - IsArchiveEnabled: to.Ptr(true), - LogTemplate: to.Ptr("acr/tasks:{{.Run.OS}}"), - AgentConfiguration: &armcontainerregistry.AgentProperties{ - CPU: to.Ptr[int32](2), - }, - Arguments: []*armcontainerregistry.Argument{ - { - Name: to.Ptr("mytestargument"), - IsSecret: to.Ptr(false), - Value: to.Ptr("mytestvalue"), - }, - { - Name: to.Ptr("mysecrettestargument"), - IsSecret: to.Ptr(true), - Value: to.Ptr("mysecrettestvalue"), - }}, - DockerFilePath: to.Ptr("DockerFile"), - ImageNames: []*string{ - to.Ptr("azurerest:testtag")}, - IsPushEnabled: to.Ptr(true), - NoCache: to.Ptr(true), - Platform: &armcontainerregistry.PlatformProperties{ - Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64), - OS: to.Ptr(armcontainerregistry.OSLinux), - }, - SourceLocation: to.Ptr("https://myaccount.blob.core.windows.net/sascontainer/source.zip?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D"), - }, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to finish the request: %v", err) + log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Run = armcontainerregistry.Run{ - // Name: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/run"), - // ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/runs/0accec26-d6de-4757-8e74-d080f38eaaab"), - // Properties: &armcontainerregistry.RunProperties{ - // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T05:13:51.617Z"); return t}()), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // RunID: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"), - // Status: to.Ptr(armcontainerregistry.RunStatusSucceeded), + // res = armcontainerregistry.RegistriesClientUpdateResponse{ + // Registry: &armcontainerregistry.Registry{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry"), + // Name: to.Ptr("myRegistry"), + // Type: to.Ptr("Microsoft.ContainerRegistry/registries"), + // Location: to.Ptr("westus"), + // Tags: map[string]*string{ + // "key": to.Ptr("value"), + // }, + // SKU: &armcontainerregistry.SKU{ + // Name: to.Ptr(armcontainerregistry.SKUNameStandard), + // Tier: to.Ptr(armcontainerregistry.SKUTierStandard), + // }, + // Properties: &armcontainerregistry.RegistryProperties{ + // LoginServer: to.Ptr("myRegistry.azurecr.io"), + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:38:26.1537861Z"); return t}()), + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // AdminUserEnabled: to.Ptr(true), + // NetworkRuleSet: &armcontainerregistry.NetworkRuleSet{ + // DefaultAction: to.Ptr(armcontainerregistry.DefaultActionAllow), + // IPRules: []*armcontainerregistry.IPRule{ + // }, + // }, + // Policies: &armcontainerregistry.Policies{ + // QuarantinePolicy: &armcontainerregistry.QuarantinePolicy{ + // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), + // }, + // TrustPolicy: &armcontainerregistry.TrustPolicy{ + // Type: to.Ptr(armcontainerregistry.TrustPolicyTypeNotary), + // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), + // }, + // RetentionPolicy: &armcontainerregistry.RetentionPolicy{ + // Days: to.Ptr[int32](7), + // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:40:12.8506835+00:00"); return t}()), + // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), + // }, + // ExportPolicy: &armcontainerregistry.ExportPolicy{ + // Status: to.Ptr(armcontainerregistry.ExportPolicyStatusEnabled), + // }, + // AzureADAuthenticationAsArmPolicy: &armcontainerregistry.AzureADAuthenticationAsArmPolicy{ + // Status: to.Ptr(armcontainerregistry.AzureADAuthenticationAsArmPolicyStatusEnabled), + // }, + // }, + // Encryption: &armcontainerregistry.EncryptionProperty{ + // Status: to.Ptr(armcontainerregistry.EncryptionStatusDisabled), + // }, + // DataEndpointEnabled: to.Ptr(false), + // DataEndpointHostNames: []*string{ + // }, + // PrivateEndpointConnections: []*armcontainerregistry.PrivateEndpointConnection{ + // }, + // PublicNetworkAccess: to.Ptr(armcontainerregistry.PublicNetworkAccessEnabled), + // NetworkRuleBypassOptions: to.Ptr(armcontainerregistry.NetworkRuleBypassOptionsAzureServices), + // NetworkRuleBypassAllowedForTasks: to.Ptr(false), + // ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyDisabled), + // AnonymousPullEnabled: to.Ptr(false), + // RoleAssignmentMode: to.Ptr(armcontainerregistry.RoleAssignmentModeAbacRepositoryPermissions), + // }, // }, // } } diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/replications_client.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/replications_client.go index 24f5888bfd0a..597f332bbcef 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/replications_client.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/replications_client.go @@ -1,7 +1,6 @@ // 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armcontainerregistry @@ -57,8 +56,7 @@ func (client *ReplicationsClient) BeginCreate(ctx context.Context, resourceGroup return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ReplicationsClientCreateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -120,6 +118,7 @@ func (client *ReplicationsClient) createCreateRequest(ctx context.Context, resou reqQP.Set("api-version", "2025-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, replication); err != nil { return nil, err } @@ -142,8 +141,7 @@ func (client *ReplicationsClient) BeginDelete(ctx context.Context, resourceGroup return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ReplicationsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -204,7 +202,6 @@ func (client *ReplicationsClient) deleteCreateRequest(ctx context.Context, resou reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2025-11-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -358,8 +355,7 @@ func (client *ReplicationsClient) BeginUpdate(ctx context.Context, resourceGroup return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ReplicationsClientUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -421,6 +417,7 @@ func (client *ReplicationsClient) updateCreateRequest(ctx context.Context, resou reqQP.Set("api-version", "2025-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, replicationUpdateParameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/replications_client_example_test.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/replications_client_example_test.go index 2c5e820fe459..b131db2f51a9 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/replications_client_example_test.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/replications_client_example_test.go @@ -1,114 +1,75 @@ // 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. -// DO NOT EDIT. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armcontainerregistry_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/containerregistry/armcontainerregistry/v3" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/ReplicationList.json -func ExampleReplicationsClient_NewListPager() { +// Generated from example definition: 2025-11-01/ReplicationCreate.json +func ExampleReplicationsClient_BeginCreate_replicationCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewReplicationsClient().NewListPager("myResourceGroup", "myRegistry", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ReplicationListResult = armcontainerregistry.ReplicationListResult{ - // Value: []*armcontainerregistry.Replication{ - // { - // Name: to.Ptr("myReplication"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/replications"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/replications/myReplication"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Properties: &armcontainerregistry.ReplicationProperties{ - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // RegionEndpointEnabled: to.Ptr(true), - // Status: &armcontainerregistry.Status{ - // DisplayStatus: to.Ptr("Ready"), - // Message: to.Ptr("The replication is ready."), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:15:37.070Z"); return t}()), - // }, - // ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyDisabled), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/ReplicationGet.json -func ExampleReplicationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + poller, err := clientFactory.NewReplicationsClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", "myReplication", armcontainerregistry.Replication{ + Location: to.Ptr("eastus"), + Tags: map[string]*string{ + "key": to.Ptr("value"), + }, + }, nil) if err != nil { - log.Fatalf("failed to create client: %v", err) + log.Fatalf("failed to finish the request: %v", err) } - res, err := clientFactory.NewReplicationsClient().Get(ctx, "myResourceGroup", "myRegistry", "myReplication", nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to finish the request: %v", err) + log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Replication = armcontainerregistry.Replication{ - // Name: to.Ptr("myReplication"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/replications"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/replications/myReplication"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Properties: &armcontainerregistry.ReplicationProperties{ - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // RegionEndpointEnabled: to.Ptr(true), - // Status: &armcontainerregistry.Status{ - // DisplayStatus: to.Ptr("Ready"), - // Message: to.Ptr("The replication is ready."), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:15:37.070Z"); return t}()), + // res = armcontainerregistry.ReplicationsClientCreateResponse{ + // Replication: &armcontainerregistry.Replication{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/replications/myReplication"), + // Name: to.Ptr("myReplication"), + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/replications"), + // Location: to.Ptr("eastus"), + // Tags: map[string]*string{ + // "key": to.Ptr("value"), + // }, + // Properties: &armcontainerregistry.ReplicationProperties{ + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // Status: &armcontainerregistry.Status{ + // DisplayStatus: to.Ptr("Ready"), + // Message: to.Ptr("The replication is ready."), + // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:15:37.0707808Z"); return t}()), + // }, + // RegionEndpointEnabled: to.Ptr(true), + // ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyDisabled), // }, - // ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyDisabled), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/ReplicationCreate.json -func ExampleReplicationsClient_BeginCreate_replicationCreate() { +// Generated from example definition: 2025-11-01/ReplicationCreateZoneRedundant.json +func ExampleReplicationsClient_BeginCreate_replicationCreateZoneRedundant() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -117,6 +78,10 @@ func ExampleReplicationsClient_BeginCreate_replicationCreate() { Tags: map[string]*string{ "key": to.Ptr("value"), }, + Properties: &armcontainerregistry.ReplicationProperties{ + RegionEndpointEnabled: to.Ptr(true), + ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyEnabled), + }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -128,48 +93,41 @@ func ExampleReplicationsClient_BeginCreate_replicationCreate() { // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Replication = armcontainerregistry.Replication{ - // Name: to.Ptr("myReplication"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/replications"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/replications/myReplication"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Properties: &armcontainerregistry.ReplicationProperties{ - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // RegionEndpointEnabled: to.Ptr(true), - // Status: &armcontainerregistry.Status{ - // DisplayStatus: to.Ptr("Ready"), - // Message: to.Ptr("The replication is ready."), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:15:37.070Z"); return t}()), + // res = armcontainerregistry.ReplicationsClientCreateResponse{ + // Replication: &armcontainerregistry.Replication{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/replications/myReplication"), + // Name: to.Ptr("myReplication"), + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/replications"), + // Location: to.Ptr("eastus"), + // Tags: map[string]*string{ + // "key": to.Ptr("value"), + // }, + // Properties: &armcontainerregistry.ReplicationProperties{ + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // Status: &armcontainerregistry.Status{ + // DisplayStatus: to.Ptr("Ready"), + // Message: to.Ptr("The replication is ready."), + // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:15:37.0707808Z"); return t}()), + // }, + // RegionEndpointEnabled: to.Ptr(true), + // ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyEnabled), // }, - // ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyDisabled), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/ReplicationCreateZoneRedundant.json -func ExampleReplicationsClient_BeginCreate_replicationCreateZoneRedundant() { +// Generated from example definition: 2025-11-01/ReplicationDelete.json +func ExampleReplicationsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewReplicationsClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", "myReplication", armcontainerregistry.Replication{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "key": to.Ptr("value"), - }, - Properties: &armcontainerregistry.ReplicationProperties{ - RegionEndpointEnabled: to.Ptr(true), - ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyEnabled), - }, - }, nil) + poller, err := clientFactory.NewReplicationsClient().BeginDelete(ctx, "myResourceGroup", "myRegistry", "myReplication", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -180,91 +138,146 @@ func ExampleReplicationsClient_BeginCreate_replicationCreateZoneRedundant() { // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Replication = armcontainerregistry.Replication{ - // Name: to.Ptr("myReplication"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/replications"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/replications/myReplication"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Properties: &armcontainerregistry.ReplicationProperties{ - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // RegionEndpointEnabled: to.Ptr(true), - // Status: &armcontainerregistry.Status{ - // DisplayStatus: to.Ptr("Ready"), - // Message: to.Ptr("The replication is ready."), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:15:37.070Z"); return t}()), - // }, - // ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyEnabled), - // }, + // res = armcontainerregistry.ReplicationsClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/ReplicationUpdate.json -func ExampleReplicationsClient_BeginUpdate() { +// Generated from example definition: 2025-11-01/ReplicationGet.json +func ExampleReplicationsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewReplicationsClient().BeginUpdate(ctx, "myResourceGroup", "myRegistry", "myReplication", armcontainerregistry.ReplicationUpdateParameters{ - Tags: map[string]*string{ - "key": to.Ptr("value"), - }, - }, nil) + res, err := clientFactory.NewReplicationsClient().Get(ctx, "myResourceGroup", "myRegistry", "myReplication", 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) - } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Replication = armcontainerregistry.Replication{ - // Name: to.Ptr("myReplication"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/replications"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/replications/myReplication"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Properties: &armcontainerregistry.ReplicationProperties{ - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // RegionEndpointEnabled: to.Ptr(true), - // Status: &armcontainerregistry.Status{ - // DisplayStatus: to.Ptr("Ready"), - // Message: to.Ptr("The replication is ready."), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:15:37.070Z"); return t}()), + // res = armcontainerregistry.ReplicationsClientGetResponse{ + // Replication: &armcontainerregistry.Replication{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/replications/myReplication"), + // Name: to.Ptr("myReplication"), + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/replications"), + // Location: to.Ptr("eastus"), + // Tags: map[string]*string{ + // "key": to.Ptr("value"), + // }, + // Properties: &armcontainerregistry.ReplicationProperties{ + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // Status: &armcontainerregistry.Status{ + // DisplayStatus: to.Ptr("Ready"), + // Message: to.Ptr("The replication is ready."), + // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:15:37.0707808Z"); return t}()), + // }, + // RegionEndpointEnabled: to.Ptr(true), + // ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyDisabled), // }, - // ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyDisabled), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/ReplicationDelete.json -func ExampleReplicationsClient_BeginDelete() { +// Generated from example definition: 2025-11-01/ReplicationList.json +func ExampleReplicationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewReplicationsClient().BeginDelete(ctx, "myResourceGroup", "myRegistry", "myReplication", nil) + pager := clientFactory.NewReplicationsClient().NewListPager("myResourceGroup", "myRegistry", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page = armcontainerregistry.ReplicationsClientListResponse{ + // ReplicationListResult: armcontainerregistry.ReplicationListResult{ + // Value: []*armcontainerregistry.Replication{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/replications/myReplication"), + // Name: to.Ptr("myReplication"), + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/replications"), + // Location: to.Ptr("eastus"), + // Tags: map[string]*string{ + // "key": to.Ptr("value"), + // }, + // Properties: &armcontainerregistry.ReplicationProperties{ + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // Status: &armcontainerregistry.Status{ + // DisplayStatus: to.Ptr("Ready"), + // Message: to.Ptr("The replication is ready."), + // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:15:37.0707808Z"); return t}()), + // }, + // RegionEndpointEnabled: to.Ptr(true), + // ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyDisabled), + // }, + // }, + // }, + // }, + // } + } +} + +// Generated from example definition: 2025-11-01/ReplicationUpdate.json +func ExampleReplicationsClient_BeginUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewReplicationsClient().BeginUpdate(ctx, "myResourceGroup", "myRegistry", "myReplication", armcontainerregistry.ReplicationUpdateParameters{ + Tags: map[string]*string{ + "key": to.Ptr("value"), + }, + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armcontainerregistry.ReplicationsClientUpdateResponse{ + // Replication: &armcontainerregistry.Replication{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/replications/myReplication"), + // Name: to.Ptr("myReplication"), + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/replications"), + // Location: to.Ptr("eastus"), + // Tags: map[string]*string{ + // "key": to.Ptr("value"), + // }, + // Properties: &armcontainerregistry.ReplicationProperties{ + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // Status: &armcontainerregistry.Status{ + // DisplayStatus: to.Ptr("Ready"), + // Message: to.Ptr("The replication is ready."), + // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:15:37.0707808Z"); return t}()), + // }, + // RegionEndpointEnabled: to.Ptr(true), + // ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyDisabled), + // }, + // }, + // } } diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/responses.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/responses.go index aeef187ea962..18d90156f001 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/responses.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/responses.go @@ -1,48 +1,9 @@ // 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armcontainerregistry -// AgentPoolsClientCreateResponse contains the response from method AgentPoolsClient.BeginCreate. -type AgentPoolsClientCreateResponse struct { - // The agentpool that has the ARM resource and properties. - // The agentpool will have all information to create an agent pool. - AgentPool -} - -// AgentPoolsClientDeleteResponse contains the response from method AgentPoolsClient.BeginDelete. -type AgentPoolsClientDeleteResponse struct { - // placeholder for future response values -} - -// AgentPoolsClientGetQueueStatusResponse contains the response from method AgentPoolsClient.GetQueueStatus. -type AgentPoolsClientGetQueueStatusResponse struct { - // The QueueStatus of Agent Pool - AgentPoolQueueStatus -} - -// AgentPoolsClientGetResponse contains the response from method AgentPoolsClient.Get. -type AgentPoolsClientGetResponse struct { - // The agentpool that has the ARM resource and properties. - // The agentpool will have all information to create an agent pool. - AgentPool -} - -// AgentPoolsClientListResponse contains the response from method AgentPoolsClient.NewListPager. -type AgentPoolsClientListResponse struct { - // The collection of agent pools. - AgentPoolListResult -} - -// AgentPoolsClientUpdateResponse contains the response from method AgentPoolsClient.BeginUpdate. -type AgentPoolsClientUpdateResponse struct { - // The agentpool that has the ARM resource and properties. - // The agentpool will have all information to create an agent pool. - AgentPool -} - // CacheRulesClientCreateResponse contains the response from method CacheRulesClient.BeginCreate. type CacheRulesClientCreateResponse struct { // An object that represents a cache rule for a container registry. @@ -187,12 +148,6 @@ type RegistriesClientGenerateCredentialsResponse struct { GenerateCredentialsResult } -// RegistriesClientGetBuildSourceUploadURLResponse contains the response from method RegistriesClient.GetBuildSourceUploadURL. -type RegistriesClientGetBuildSourceUploadURLResponse struct { - // The properties of a response to source upload request. - SourceUploadDefinition -} - // RegistriesClientGetPrivateLinkResourceResponse contains the response from method RegistriesClient.GetPrivateLinkResource. type RegistriesClientGetPrivateLinkResourceResponse struct { // A private link resource. @@ -246,12 +201,6 @@ type RegistriesClientRegenerateCredentialResponse struct { RegistryListCredentialsResult } -// RegistriesClientScheduleRunResponse contains the response from method RegistriesClient.ScheduleRun. -type RegistriesClientScheduleRunResponse struct { - // Run resource properties - Run -} - // RegistriesClientUpdateResponse contains the response from method RegistriesClient.BeginUpdate. type RegistriesClientUpdateResponse struct { // An object that represents a container registry. @@ -287,35 +236,6 @@ type ReplicationsClientUpdateResponse struct { Replication } -// RunsClientCancelResponse contains the response from method RunsClient.Cancel. -type RunsClientCancelResponse struct { - // placeholder for future response values -} - -// RunsClientGetLogSasURLResponse contains the response from method RunsClient.GetLogSasURL. -type RunsClientGetLogSasURLResponse struct { - // The result of get log link operation. - RunGetLogResult -} - -// RunsClientGetResponse contains the response from method RunsClient.Get. -type RunsClientGetResponse struct { - // Run resource properties - Run -} - -// RunsClientListResponse contains the response from method RunsClient.NewListPager. -type RunsClientListResponse struct { - // The collection of runs. - RunListResult -} - -// RunsClientUpdateResponse contains the response from method RunsClient.Update. -type RunsClientUpdateResponse struct { - // Run resource properties - Run -} - // ScopeMapsClientCreateResponse contains the response from method ScopeMapsClient.BeginCreate. type ScopeMapsClientCreateResponse struct { // An object that represents a scope map for a container registry. @@ -345,84 +265,6 @@ type ScopeMapsClientUpdateResponse struct { ScopeMap } -// TaskRunsClientCreateResponse contains the response from method TaskRunsClient.BeginCreate. -type TaskRunsClientCreateResponse struct { - // The task run that has the ARM resource and properties. - // The task run will have the information of request and result of a run. - TaskRun -} - -// TaskRunsClientDeleteResponse contains the response from method TaskRunsClient.Delete. -type TaskRunsClientDeleteResponse struct { - // placeholder for future response values -} - -// TaskRunsClientGetDetailsResponse contains the response from method TaskRunsClient.GetDetails. -type TaskRunsClientGetDetailsResponse struct { - // The task run that has the ARM resource and properties. - // The task run will have the information of request and result of a run. - TaskRun -} - -// TaskRunsClientGetResponse contains the response from method TaskRunsClient.Get. -type TaskRunsClientGetResponse struct { - // The task run that has the ARM resource and properties. - // The task run will have the information of request and result of a run. - TaskRun -} - -// TaskRunsClientListResponse contains the response from method TaskRunsClient.NewListPager. -type TaskRunsClientListResponse struct { - // The collection of task runs. - TaskRunListResult -} - -// TaskRunsClientUpdateResponse contains the response from method TaskRunsClient.BeginUpdate. -type TaskRunsClientUpdateResponse struct { - // The task run that has the ARM resource and properties. - // The task run will have the information of request and result of a run. - TaskRun -} - -// TasksClientCreateResponse contains the response from method TasksClient.Create. -type TasksClientCreateResponse struct { - // The task that has the ARM resource and task properties. - // The task will have all information to schedule a run against it. - Task -} - -// TasksClientDeleteResponse contains the response from method TasksClient.Delete. -type TasksClientDeleteResponse struct { - // placeholder for future response values -} - -// TasksClientGetDetailsResponse contains the response from method TasksClient.GetDetails. -type TasksClientGetDetailsResponse struct { - // The task that has the ARM resource and task properties. - // The task will have all information to schedule a run against it. - Task -} - -// TasksClientGetResponse contains the response from method TasksClient.Get. -type TasksClientGetResponse struct { - // The task that has the ARM resource and task properties. - // The task will have all information to schedule a run against it. - Task -} - -// TasksClientListResponse contains the response from method TasksClient.NewListPager. -type TasksClientListResponse struct { - // The collection of tasks. - TaskListResult -} - -// TasksClientUpdateResponse contains the response from method TasksClient.Update. -type TasksClientUpdateResponse struct { - // The task that has the ARM resource and task properties. - // The task will have all information to schedule a run against it. - Task -} - // TokensClientCreateResponse contains the response from method TokensClient.BeginCreate. type TokensClientCreateResponse struct { // An object that represents a token for a container registry. diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/runs_client.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/runs_client.go deleted file mode 100644 index 5bce9e7d9322..000000000000 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/runs_client.go +++ /dev/null @@ -1,382 +0,0 @@ -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcontainerregistry - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strconv" - "strings" -) - -// RunsClient contains the methods for the Runs group. -// Don't use this type directly, use NewRunsClient() instead. -type RunsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewRunsClient creates a new instance of RunsClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - Contains optional client configuration. Pass nil to accept the default values. -func NewRunsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RunsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &RunsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// Cancel - Cancel an existing run. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-03-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - registryName - The name of the Registry -// - runID - The run ID. -// - options - RunsClientCancelOptions contains the optional parameters for the RunsClient.Cancel method. -func (client *RunsClient) Cancel(ctx context.Context, resourceGroupName string, registryName string, runID string, options *RunsClientCancelOptions) (RunsClientCancelResponse, error) { - var err error - const operationName = "RunsClient.Cancel" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.cancelCreateRequest(ctx, resourceGroupName, registryName, runID, options) - if err != nil { - return RunsClientCancelResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return RunsClientCancelResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return RunsClientCancelResponse{}, err - } - return RunsClientCancelResponse{}, nil -} - -// cancelCreateRequest creates the Cancel request. -func (client *RunsClient) cancelCreateRequest(ctx context.Context, resourceGroupName string, registryName string, runID string, _ *RunsClientCancelOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs/{runId}/cancel" - 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 registryName == "" { - return nil, errors.New("parameter registryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) - if runID == "" { - return nil, errors.New("parameter runID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{runId}", url.PathEscape(runID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the detailed information for a given run. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-03-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - registryName - The name of the Registry -// - runID - The run ID. -// - options - RunsClientGetOptions contains the optional parameters for the RunsClient.Get method. -func (client *RunsClient) Get(ctx context.Context, resourceGroupName string, registryName string, runID string, options *RunsClientGetOptions) (RunsClientGetResponse, error) { - var err error - const operationName = "RunsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, registryName, runID, options) - if err != nil { - return RunsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return RunsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return RunsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *RunsClient) getCreateRequest(ctx context.Context, resourceGroupName string, registryName string, runID string, _ *RunsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs/{runId}" - 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 registryName == "" { - return nil, errors.New("parameter registryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) - if runID == "" { - return nil, errors.New("parameter runID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{runId}", url.PathEscape(runID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *RunsClient) getHandleResponse(resp *http.Response) (RunsClientGetResponse, error) { - result := RunsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Run); err != nil { - return RunsClientGetResponse{}, err - } - return result, nil -} - -// GetLogSasURL - Gets a link to download the run logs. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-03-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - registryName - The name of the Registry -// - runID - The run ID. -// - options - RunsClientGetLogSasURLOptions contains the optional parameters for the RunsClient.GetLogSasURL method. -func (client *RunsClient) GetLogSasURL(ctx context.Context, resourceGroupName string, registryName string, runID string, options *RunsClientGetLogSasURLOptions) (RunsClientGetLogSasURLResponse, error) { - var err error - const operationName = "RunsClient.GetLogSasURL" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getLogSasURLCreateRequest(ctx, resourceGroupName, registryName, runID, options) - if err != nil { - return RunsClientGetLogSasURLResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return RunsClientGetLogSasURLResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return RunsClientGetLogSasURLResponse{}, err - } - resp, err := client.getLogSasURLHandleResponse(httpResp) - return resp, err -} - -// getLogSasURLCreateRequest creates the GetLogSasURL request. -func (client *RunsClient) getLogSasURLCreateRequest(ctx context.Context, resourceGroupName string, registryName string, runID string, _ *RunsClientGetLogSasURLOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs/{runId}/listLogSasUrl" - 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 registryName == "" { - return nil, errors.New("parameter registryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) - if runID == "" { - return nil, errors.New("parameter runID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{runId}", url.PathEscape(runID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getLogSasURLHandleResponse handles the GetLogSasURL response. -func (client *RunsClient) getLogSasURLHandleResponse(resp *http.Response) (RunsClientGetLogSasURLResponse, error) { - result := RunsClientGetLogSasURLResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RunGetLogResult); err != nil { - return RunsClientGetLogSasURLResponse{}, err - } - return result, nil -} - -// NewListPager - Gets all the runs for a registry. -// -// Generated from API version 2025-03-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - registryName - The name of the Registry -// - options - RunsClientListOptions contains the optional parameters for the RunsClient.NewListPager method. -func (client *RunsClient) NewListPager(resourceGroupName string, registryName string, options *RunsClientListOptions) *runtime.Pager[RunsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[RunsClientListResponse]{ - More: func(page RunsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *RunsClientListResponse) (RunsClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "RunsClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, registryName, options) - }, nil) - if err != nil { - return RunsClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *RunsClient) listCreateRequest(ctx context.Context, resourceGroupName string, registryName string, options *RunsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs" - 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 registryName == "" { - return nil, errors.New("parameter registryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Filter != nil { - reqQP.Set("$filter", *options.Filter) - } - if options != nil && options.Top != nil { - reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) - } - reqQP.Set("api-version", "2025-03-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *RunsClient) listHandleResponse(resp *http.Response) (RunsClientListResponse, error) { - result := RunsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RunListResult); err != nil { - return RunsClientListResponse{}, err - } - return result, nil -} - -// Update - Patch the run properties. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-03-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - registryName - The name of the Registry -// - runID - The run ID. -// - runUpdateParameters - The run update properties. -// - options - RunsClientUpdateOptions contains the optional parameters for the RunsClient.Update method. -func (client *RunsClient) Update(ctx context.Context, resourceGroupName string, registryName string, runID string, runUpdateParameters RunUpdateParameters, options *RunsClientUpdateOptions) (RunsClientUpdateResponse, error) { - var err error - const operationName = "RunsClient.Update" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, registryName, runID, runUpdateParameters, options) - if err != nil { - return RunsClientUpdateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return RunsClientUpdateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return RunsClientUpdateResponse{}, err - } - resp, err := client.updateHandleResponse(httpResp) - return resp, err -} - -// updateCreateRequest creates the Update request. -func (client *RunsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, registryName string, runID string, runUpdateParameters RunUpdateParameters, _ *RunsClientUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs/{runId}" - 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 registryName == "" { - return nil, errors.New("parameter registryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) - if runID == "" { - return nil, errors.New("parameter runID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{runId}", url.PathEscape(runID)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, runUpdateParameters); err != nil { - return nil, err - } - return req, nil -} - -// updateHandleResponse handles the Update response. -func (client *RunsClient) updateHandleResponse(resp *http.Response) (RunsClientUpdateResponse, error) { - result := RunsClientUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Run); err != nil { - return RunsClientUpdateResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/scopemaps_client.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/scopemaps_client.go index 5e430ddac968..25ae9b1cad45 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/scopemaps_client.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/scopemaps_client.go @@ -1,7 +1,6 @@ // 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armcontainerregistry @@ -56,8 +55,7 @@ func (client *ScopeMapsClient) BeginCreate(ctx context.Context, resourceGroupNam return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ScopeMapsClientCreateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -119,6 +117,7 @@ func (client *ScopeMapsClient) createCreateRequest(ctx context.Context, resource reqQP.Set("api-version", "2025-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, scopeMapCreateParameters); err != nil { return nil, err } @@ -140,8 +139,7 @@ func (client *ScopeMapsClient) BeginDelete(ctx context.Context, resourceGroupNam return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ScopeMapsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -202,7 +200,6 @@ func (client *ScopeMapsClient) deleteCreateRequest(ctx context.Context, resource reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2025-11-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -355,8 +352,7 @@ func (client *ScopeMapsClient) BeginUpdate(ctx context.Context, resourceGroupNam return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ScopeMapsClientUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -418,6 +414,7 @@ func (client *ScopeMapsClient) updateCreateRequest(ctx context.Context, resource reqQP.Set("api-version", "2025-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, scopeMapUpdateParameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/scopemaps_client_example_test.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/scopemaps_client_example_test.go index a1f5a182b020..9f6bcee8c695 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/scopemaps_client_example_test.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/scopemaps_client_example_test.go @@ -1,146 +1,180 @@ // 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. -// DO NOT EDIT. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armcontainerregistry_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/containerregistry/armcontainerregistry/v3" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/ScopeMapList.json -func ExampleScopeMapsClient_NewListPager() { +// Generated from example definition: 2025-11-01/ScopeMapCreate.json +func ExampleScopeMapsClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewScopeMapsClient().NewListPager("myResourceGroup", "myRegistry", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ScopeMapListResult = armcontainerregistry.ScopeMapListResult{ - // Value: []*armcontainerregistry.ScopeMap{ - // { - // Name: to.Ptr("myScopeMap"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/scopeMaps"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myScopeMap"), - // Properties: &armcontainerregistry.ScopeMapProperties{ - // Type: to.Ptr("IsUserDefined"), - // Actions: []*string{ - // to.Ptr("repositories/myrepository/contentWrite"), - // to.Ptr("repositories/myrepository/delete")}, - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:14:37.070Z"); return t}()), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // }, - // }}, - // } + poller, err := clientFactory.NewScopeMapsClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", "myScopeMap", armcontainerregistry.ScopeMap{ + Properties: &armcontainerregistry.ScopeMapProperties{ + Description: to.Ptr("Developer Scopes"), + Actions: []*string{ + to.Ptr("repositories/myrepository/contentWrite"), + to.Ptr("repositories/myrepository/delete"), + }, + }, + }, 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) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armcontainerregistry.ScopeMapsClientCreateResponse{ + // ScopeMap: &armcontainerregistry.ScopeMap{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myScopeMap"), + // Name: to.Ptr("myScopeMap"), + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/scopeMaps"), + // Properties: &armcontainerregistry.ScopeMapProperties{ + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:14:37.0707808Z"); return t}()), + // Type: to.Ptr("IsUserDefined"), + // Actions: []*string{ + // to.Ptr("repositories/myrepository/contentWrite"), + // to.Ptr("repositories/myrepository/delete"), + // }, + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/ScopeMapGet.json -func ExampleScopeMapsClient_Get() { +// Generated from example definition: 2025-11-01/ScopeMapDelete.json +func ExampleScopeMapsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewScopeMapsClient().Get(ctx, "myResourceGroup", "myRegistry", "myScopeMap", nil) + poller, err := clientFactory.NewScopeMapsClient().BeginDelete(ctx, "myResourceGroup", "myRegistry", "myScopeMap", 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) + } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ScopeMap = armcontainerregistry.ScopeMap{ - // Name: to.Ptr("myScopeMap"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/scopeMaps"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myScopeMap"), - // Properties: &armcontainerregistry.ScopeMapProperties{ - // Type: to.Ptr("IsUserDefined"), - // Actions: []*string{ - // to.Ptr("repositories/myrepository/contentWrite"), - // to.Ptr("repositories/myrepository/delete")}, - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:14:37.070Z"); return t}()), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // }, - // } + // res = armcontainerregistry.ScopeMapsClientDeleteResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/ScopeMapCreate.json -func ExampleScopeMapsClient_BeginCreate() { +// Generated from example definition: 2025-11-01/ScopeMapGet.json +func ExampleScopeMapsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewScopeMapsClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", "myScopeMap", armcontainerregistry.ScopeMap{ - Properties: &armcontainerregistry.ScopeMapProperties{ - Description: to.Ptr("Developer Scopes"), - Actions: []*string{ - to.Ptr("repositories/myrepository/contentWrite"), - to.Ptr("repositories/myrepository/delete")}, - }, - }, nil) + res, err := clientFactory.NewScopeMapsClient().Get(ctx, "myResourceGroup", "myRegistry", "myScopeMap", 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) - } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ScopeMap = armcontainerregistry.ScopeMap{ - // Name: to.Ptr("myScopeMap"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/scopeMaps"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myScopeMap"), - // Properties: &armcontainerregistry.ScopeMapProperties{ - // Type: to.Ptr("IsUserDefined"), - // Actions: []*string{ - // to.Ptr("repositories/myrepository/contentWrite"), - // to.Ptr("repositories/myrepository/delete")}, - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:14:37.070Z"); return t}()), + // res = armcontainerregistry.ScopeMapsClientGetResponse{ + // ScopeMap: &armcontainerregistry.ScopeMap{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myScopeMap"), + // Name: to.Ptr("myScopeMap"), + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/scopeMaps"), + // Properties: &armcontainerregistry.ScopeMapProperties{ + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:14:37.0707808Z"); return t}()), + // Type: to.Ptr("IsUserDefined"), + // Actions: []*string{ + // to.Ptr("repositories/myrepository/contentWrite"), + // to.Ptr("repositories/myrepository/delete"), + // }, // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), // }, - // } + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/ScopeMapUpdate.json +// Generated from example definition: 2025-11-01/ScopeMapList.json +func ExampleScopeMapsClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewScopeMapsClient().NewListPager("myResourceGroup", "myRegistry", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page = armcontainerregistry.ScopeMapsClientListResponse{ + // ScopeMapListResult: armcontainerregistry.ScopeMapListResult{ + // Value: []*armcontainerregistry.ScopeMap{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myScopeMap"), + // Name: to.Ptr("myScopeMap"), + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/scopeMaps"), + // Properties: &armcontainerregistry.ScopeMapProperties{ + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:14:37.0707808Z"); return t}()), + // Type: to.Ptr("IsUserDefined"), + // Actions: []*string{ + // to.Ptr("repositories/myrepository/contentWrite"), + // to.Ptr("repositories/myrepository/delete"), + // }, + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // }, + // }, + // }, + // }, + // } + } +} + +// Generated from example definition: 2025-11-01/ScopeMapUpdate.json func ExampleScopeMapsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -149,7 +183,8 @@ func ExampleScopeMapsClient_BeginUpdate() { Description: to.Ptr("Developer Scopes"), Actions: []*string{ to.Ptr("repositories/myrepository/contentWrite"), - to.Ptr("repositories/myrepository/contentRead")}, + to.Ptr("repositories/myrepository/contentRead"), + }, }, }, nil) if err != nil { @@ -162,38 +197,20 @@ func ExampleScopeMapsClient_BeginUpdate() { // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ScopeMap = armcontainerregistry.ScopeMap{ - // Name: to.Ptr("myScopeMap"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/scopeMaps"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myScopeMap"), - // Properties: &armcontainerregistry.ScopeMapProperties{ - // Type: to.Ptr("IsUserDefined"), - // Actions: []*string{ - // to.Ptr("repositories/myrepository/contentWrite"), - // to.Ptr("repositories/myrepository/contentRead")}, - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:14:37.070Z"); return t}()), + // res = armcontainerregistry.ScopeMapsClientUpdateResponse{ + // ScopeMap: &armcontainerregistry.ScopeMap{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myScopeMap"), + // Name: to.Ptr("myScopeMap"), + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/scopeMaps"), + // Properties: &armcontainerregistry.ScopeMapProperties{ + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:14:37.0707808Z"); return t}()), + // Type: to.Ptr("IsUserDefined"), + // Actions: []*string{ + // to.Ptr("repositories/myrepository/contentWrite"), + // to.Ptr("repositories/myrepository/contentRead"), + // }, // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/ScopeMapDelete.json -func ExampleScopeMapsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewScopeMapsClient().BeginDelete(ctx, "myResourceGroup", "myRegistry", "myScopeMap", 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/containerregistry/armcontainerregistry/taskruns_client.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/taskruns_client.go deleted file mode 100644 index abc48a2da827..000000000000 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/taskruns_client.go +++ /dev/null @@ -1,472 +0,0 @@ -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcontainerregistry - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// TaskRunsClient contains the methods for the TaskRuns group. -// Don't use this type directly, use NewTaskRunsClient() instead. -type TaskRunsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewTaskRunsClient creates a new instance of TaskRunsClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - Contains optional client configuration. Pass nil to accept the default values. -func NewTaskRunsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TaskRunsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &TaskRunsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreate - Creates a task run for a container registry with the specified parameters. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-03-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - registryName - The name of the Registry -// - taskRunName - The name of the task run. -// - taskRun - The parameters of a run that needs to scheduled. -// - options - TaskRunsClientBeginCreateOptions contains the optional parameters for the TaskRunsClient.BeginCreate method. -func (client *TaskRunsClient) BeginCreate(ctx context.Context, resourceGroupName string, registryName string, taskRunName string, taskRun TaskRun, options *TaskRunsClientBeginCreateOptions) (*runtime.Poller[TaskRunsClientCreateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.create(ctx, resourceGroupName, registryName, taskRunName, taskRun, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[TaskRunsClientCreateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[TaskRunsClientCreateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Create - Creates a task run for a container registry with the specified parameters. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-03-01-preview -func (client *TaskRunsClient) create(ctx context.Context, resourceGroupName string, registryName string, taskRunName string, taskRun TaskRun, options *TaskRunsClientBeginCreateOptions) (*http.Response, error) { - var err error - const operationName = "TaskRunsClient.BeginCreate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createCreateRequest(ctx, resourceGroupName, registryName, taskRunName, taskRun, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createCreateRequest creates the Create request. -func (client *TaskRunsClient) createCreateRequest(ctx context.Context, resourceGroupName string, registryName string, taskRunName string, taskRun TaskRun, _ *TaskRunsClientBeginCreateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns/{taskRunName}" - 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 registryName == "" { - return nil, errors.New("parameter registryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) - if taskRunName == "" { - return nil, errors.New("parameter taskRunName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{taskRunName}", url.PathEscape(taskRunName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, taskRun); err != nil { - return nil, err - } - return req, nil -} - -// Delete - Deletes a specified task run resource. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-03-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - registryName - The name of the Registry -// - taskRunName - The name of the task run. -// - options - TaskRunsClientDeleteOptions contains the optional parameters for the TaskRunsClient.Delete method. -func (client *TaskRunsClient) Delete(ctx context.Context, resourceGroupName string, registryName string, taskRunName string, options *TaskRunsClientDeleteOptions) (TaskRunsClientDeleteResponse, error) { - var err error - const operationName = "TaskRunsClient.Delete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, registryName, taskRunName, options) - if err != nil { - return TaskRunsClientDeleteResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return TaskRunsClientDeleteResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return TaskRunsClientDeleteResponse{}, err - } - return TaskRunsClientDeleteResponse{}, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *TaskRunsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, registryName string, taskRunName string, _ *TaskRunsClientDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns/{taskRunName}" - 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 registryName == "" { - return nil, errors.New("parameter registryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) - if taskRunName == "" { - return nil, errors.New("parameter taskRunName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{taskRunName}", url.PathEscape(taskRunName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets the detailed information for a given task run. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-03-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - registryName - The name of the Registry -// - taskRunName - The name of the task run. -// - options - TaskRunsClientGetOptions contains the optional parameters for the TaskRunsClient.Get method. -func (client *TaskRunsClient) Get(ctx context.Context, resourceGroupName string, registryName string, taskRunName string, options *TaskRunsClientGetOptions) (TaskRunsClientGetResponse, error) { - var err error - const operationName = "TaskRunsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, registryName, taskRunName, options) - if err != nil { - return TaskRunsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return TaskRunsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return TaskRunsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *TaskRunsClient) getCreateRequest(ctx context.Context, resourceGroupName string, registryName string, taskRunName string, _ *TaskRunsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns/{taskRunName}" - 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 registryName == "" { - return nil, errors.New("parameter registryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) - if taskRunName == "" { - return nil, errors.New("parameter taskRunName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{taskRunName}", url.PathEscape(taskRunName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *TaskRunsClient) getHandleResponse(resp *http.Response) (TaskRunsClientGetResponse, error) { - result := TaskRunsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.TaskRun); err != nil { - return TaskRunsClientGetResponse{}, err - } - return result, nil -} - -// GetDetails - Gets the detailed information for a given task run that includes all secrets. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-03-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - registryName - The name of the Registry -// - taskRunName - The name of the task run. -// - options - TaskRunsClientGetDetailsOptions contains the optional parameters for the TaskRunsClient.GetDetails method. -func (client *TaskRunsClient) GetDetails(ctx context.Context, resourceGroupName string, registryName string, taskRunName string, options *TaskRunsClientGetDetailsOptions) (TaskRunsClientGetDetailsResponse, error) { - var err error - const operationName = "TaskRunsClient.GetDetails" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getDetailsCreateRequest(ctx, resourceGroupName, registryName, taskRunName, options) - if err != nil { - return TaskRunsClientGetDetailsResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return TaskRunsClientGetDetailsResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return TaskRunsClientGetDetailsResponse{}, err - } - resp, err := client.getDetailsHandleResponse(httpResp) - return resp, err -} - -// getDetailsCreateRequest creates the GetDetails request. -func (client *TaskRunsClient) getDetailsCreateRequest(ctx context.Context, resourceGroupName string, registryName string, taskRunName string, _ *TaskRunsClientGetDetailsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns/{taskRunName}/listDetails" - 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 registryName == "" { - return nil, errors.New("parameter registryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) - if taskRunName == "" { - return nil, errors.New("parameter taskRunName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{taskRunName}", url.PathEscape(taskRunName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getDetailsHandleResponse handles the GetDetails response. -func (client *TaskRunsClient) getDetailsHandleResponse(resp *http.Response) (TaskRunsClientGetDetailsResponse, error) { - result := TaskRunsClientGetDetailsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.TaskRun); err != nil { - return TaskRunsClientGetDetailsResponse{}, err - } - return result, nil -} - -// NewListPager - Lists all the task runs for a specified container registry. -// -// Generated from API version 2025-03-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - registryName - The name of the Registry -// - options - TaskRunsClientListOptions contains the optional parameters for the TaskRunsClient.NewListPager method. -func (client *TaskRunsClient) NewListPager(resourceGroupName string, registryName string, options *TaskRunsClientListOptions) *runtime.Pager[TaskRunsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[TaskRunsClientListResponse]{ - More: func(page TaskRunsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *TaskRunsClientListResponse) (TaskRunsClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "TaskRunsClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, registryName, options) - }, nil) - if err != nil { - return TaskRunsClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *TaskRunsClient) listCreateRequest(ctx context.Context, resourceGroupName string, registryName string, _ *TaskRunsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns" - 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 registryName == "" { - return nil, errors.New("parameter registryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *TaskRunsClient) listHandleResponse(resp *http.Response) (TaskRunsClientListResponse, error) { - result := TaskRunsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.TaskRunListResult); err != nil { - return TaskRunsClientListResponse{}, err - } - return result, nil -} - -// BeginUpdate - Updates a task run with the specified parameters. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-03-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - registryName - The name of the Registry -// - taskRunName - The name of the task run. -// - updateParameters - The parameters for updating a task run. -// - options - TaskRunsClientBeginUpdateOptions contains the optional parameters for the TaskRunsClient.BeginUpdate method. -func (client *TaskRunsClient) BeginUpdate(ctx context.Context, resourceGroupName string, registryName string, taskRunName string, updateParameters TaskRunUpdateParameters, options *TaskRunsClientBeginUpdateOptions) (*runtime.Poller[TaskRunsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, registryName, taskRunName, updateParameters, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[TaskRunsClientUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[TaskRunsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - Updates a task run with the specified parameters. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-03-01-preview -func (client *TaskRunsClient) update(ctx context.Context, resourceGroupName string, registryName string, taskRunName string, updateParameters TaskRunUpdateParameters, options *TaskRunsClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "TaskRunsClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, registryName, taskRunName, updateParameters, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *TaskRunsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, registryName string, taskRunName string, updateParameters TaskRunUpdateParameters, _ *TaskRunsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns/{taskRunName}" - 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 registryName == "" { - return nil, errors.New("parameter registryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) - if taskRunName == "" { - return nil, errors.New("parameter taskRunName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{taskRunName}", url.PathEscape(taskRunName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, updateParameters); err != nil { - return nil, err - } - return req, nil -} diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/tasks_client.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/tasks_client.go deleted file mode 100644 index a91118304af0..000000000000 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/tasks_client.go +++ /dev/null @@ -1,448 +0,0 @@ -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcontainerregistry - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// TasksClient contains the methods for the Tasks group. -// Don't use this type directly, use NewTasksClient() instead. -type TasksClient struct { - internal *arm.Client - subscriptionID string -} - -// NewTasksClient creates a new instance of TasksClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - Contains optional client configuration. Pass nil to accept the default values. -func NewTasksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TasksClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &TasksClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// Create - Creates a task for a container registry with the specified parameters. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-03-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - registryName - The name of the Registry -// - taskName - The name of the container registry task. -// - taskCreateParameters - The parameters for creating a task. -// - options - TasksClientCreateOptions contains the optional parameters for the TasksClient.Create method. -func (client *TasksClient) Create(ctx context.Context, resourceGroupName string, registryName string, taskName string, taskCreateParameters Task, options *TasksClientCreateOptions) (TasksClientCreateResponse, error) { - var err error - const operationName = "TasksClient.Create" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createCreateRequest(ctx, resourceGroupName, registryName, taskName, taskCreateParameters, options) - if err != nil { - return TasksClientCreateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return TasksClientCreateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return TasksClientCreateResponse{}, err - } - resp, err := client.createHandleResponse(httpResp) - return resp, err -} - -// createCreateRequest creates the Create request. -func (client *TasksClient) createCreateRequest(ctx context.Context, resourceGroupName string, registryName string, taskName string, taskCreateParameters Task, _ *TasksClientCreateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}" - 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 registryName == "" { - return nil, errors.New("parameter registryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) - if taskName == "" { - return nil, errors.New("parameter taskName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{taskName}", url.PathEscape(taskName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, taskCreateParameters); err != nil { - return nil, err - } - return req, nil -} - -// createHandleResponse handles the Create response. -func (client *TasksClient) createHandleResponse(resp *http.Response) (TasksClientCreateResponse, error) { - result := TasksClientCreateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Task); err != nil { - return TasksClientCreateResponse{}, err - } - return result, nil -} - -// Delete - Deletes a specified task. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-03-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - registryName - The name of the Registry -// - taskName - The name of the container registry task. -// - options - TasksClientDeleteOptions contains the optional parameters for the TasksClient.Delete method. -func (client *TasksClient) Delete(ctx context.Context, resourceGroupName string, registryName string, taskName string, options *TasksClientDeleteOptions) (TasksClientDeleteResponse, error) { - var err error - const operationName = "TasksClient.Delete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, registryName, taskName, options) - if err != nil { - return TasksClientDeleteResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return TasksClientDeleteResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return TasksClientDeleteResponse{}, err - } - return TasksClientDeleteResponse{}, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *TasksClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, registryName string, taskName string, _ *TasksClientDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}" - 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 registryName == "" { - return nil, errors.New("parameter registryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) - if taskName == "" { - return nil, errors.New("parameter taskName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{taskName}", url.PathEscape(taskName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Get the properties of a specified task. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-03-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - registryName - The name of the Registry -// - taskName - The name of the container registry task. -// - options - TasksClientGetOptions contains the optional parameters for the TasksClient.Get method. -func (client *TasksClient) Get(ctx context.Context, resourceGroupName string, registryName string, taskName string, options *TasksClientGetOptions) (TasksClientGetResponse, error) { - var err error - const operationName = "TasksClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, registryName, taskName, options) - if err != nil { - return TasksClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return TasksClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return TasksClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *TasksClient) getCreateRequest(ctx context.Context, resourceGroupName string, registryName string, taskName string, _ *TasksClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}" - 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 registryName == "" { - return nil, errors.New("parameter registryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) - if taskName == "" { - return nil, errors.New("parameter taskName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{taskName}", url.PathEscape(taskName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *TasksClient) getHandleResponse(resp *http.Response) (TasksClientGetResponse, error) { - result := TasksClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Task); err != nil { - return TasksClientGetResponse{}, err - } - return result, nil -} - -// GetDetails - Returns a task with extended information that includes all secrets. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-03-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - registryName - The name of the Registry -// - taskName - The name of the container registry task. -// - options - TasksClientGetDetailsOptions contains the optional parameters for the TasksClient.GetDetails method. -func (client *TasksClient) GetDetails(ctx context.Context, resourceGroupName string, registryName string, taskName string, options *TasksClientGetDetailsOptions) (TasksClientGetDetailsResponse, error) { - var err error - const operationName = "TasksClient.GetDetails" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getDetailsCreateRequest(ctx, resourceGroupName, registryName, taskName, options) - if err != nil { - return TasksClientGetDetailsResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return TasksClientGetDetailsResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return TasksClientGetDetailsResponse{}, err - } - resp, err := client.getDetailsHandleResponse(httpResp) - return resp, err -} - -// getDetailsCreateRequest creates the GetDetails request. -func (client *TasksClient) getDetailsCreateRequest(ctx context.Context, resourceGroupName string, registryName string, taskName string, _ *TasksClientGetDetailsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}/listDetails" - 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 registryName == "" { - return nil, errors.New("parameter registryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) - if taskName == "" { - return nil, errors.New("parameter taskName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{taskName}", url.PathEscape(taskName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getDetailsHandleResponse handles the GetDetails response. -func (client *TasksClient) getDetailsHandleResponse(resp *http.Response) (TasksClientGetDetailsResponse, error) { - result := TasksClientGetDetailsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Task); err != nil { - return TasksClientGetDetailsResponse{}, err - } - return result, nil -} - -// NewListPager - Lists all the tasks for a specified container registry. -// -// Generated from API version 2025-03-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - registryName - The name of the Registry -// - options - TasksClientListOptions contains the optional parameters for the TasksClient.NewListPager method. -func (client *TasksClient) NewListPager(resourceGroupName string, registryName string, options *TasksClientListOptions) *runtime.Pager[TasksClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[TasksClientListResponse]{ - More: func(page TasksClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *TasksClientListResponse) (TasksClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "TasksClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, registryName, options) - }, nil) - if err != nil { - return TasksClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *TasksClient) listCreateRequest(ctx context.Context, resourceGroupName string, registryName string, _ *TasksClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks" - 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 registryName == "" { - return nil, errors.New("parameter registryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *TasksClient) listHandleResponse(resp *http.Response) (TasksClientListResponse, error) { - result := TasksClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.TaskListResult); err != nil { - return TasksClientListResponse{}, err - } - return result, nil -} - -// Update - Updates a task with the specified parameters. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2025-03-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - registryName - The name of the Registry -// - taskName - The name of the container registry task. -// - taskUpdateParameters - The parameters for updating a task. -// - options - TasksClientUpdateOptions contains the optional parameters for the TasksClient.Update method. -func (client *TasksClient) Update(ctx context.Context, resourceGroupName string, registryName string, taskName string, taskUpdateParameters TaskUpdateParameters, options *TasksClientUpdateOptions) (TasksClientUpdateResponse, error) { - var err error - const operationName = "TasksClient.Update" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, registryName, taskName, taskUpdateParameters, options) - if err != nil { - return TasksClientUpdateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return TasksClientUpdateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return TasksClientUpdateResponse{}, err - } - resp, err := client.updateHandleResponse(httpResp) - return resp, err -} - -// updateCreateRequest creates the Update request. -func (client *TasksClient) updateCreateRequest(ctx context.Context, resourceGroupName string, registryName string, taskName string, taskUpdateParameters TaskUpdateParameters, _ *TasksClientUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}" - 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 registryName == "" { - return nil, errors.New("parameter registryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{registryName}", url.PathEscape(registryName)) - if taskName == "" { - return nil, errors.New("parameter taskName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{taskName}", url.PathEscape(taskName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, taskUpdateParameters); err != nil { - return nil, err - } - return req, nil -} - -// updateHandleResponse handles the Update response. -func (client *TasksClient) updateHandleResponse(resp *http.Response) (TasksClientUpdateResponse, error) { - result := TasksClientUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Task); err != nil { - return TasksClientUpdateResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/testdata/_metadata.json b/sdk/resourcemanager/containerregistry/armcontainerregistry/testdata/_metadata.json new file mode 100644 index 000000000000..608c410f3911 --- /dev/null +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/testdata/_metadata.json @@ -0,0 +1,4 @@ +{ + "apiVersion": "2025-11-01", + "emitterVersion": "0.9.1" +} diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/time_rfc3339.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/time_rfc3339.go deleted file mode 100644 index fb67f4c421c1..000000000000 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/time_rfc3339.go +++ /dev/null @@ -1,110 +0,0 @@ -// 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcontainerregistry - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" - "regexp" - "strings" - "time" -) - -// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) - -const ( - utcDateTime = "2006-01-02T15:04:05.999999999" - utcDateTimeJSON = `"` + utcDateTime + `"` - utcDateTimeNoT = "2006-01-02 15:04:05.999999999" - utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` - dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` - dateTimeJSON = `"` + time.RFC3339Nano + `"` - dateTimeJSONNoT = `"` + dateTimeNoT + `"` -) - -type dateTimeRFC3339 time.Time - -func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalJSON() -} - -func (t dateTimeRFC3339) MarshalText() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalText() -} - -func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - tzOffset := tzOffsetRegex.Match(data) - hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") - var layout string - if tzOffset && hasT { - layout = dateTimeJSON - } else if tzOffset { - layout = dateTimeJSONNoT - } else if hasT { - layout = utcDateTimeJSON - } else { - layout = utcDateTimeJSONNoT - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - if len(data) == 0 { - return nil - } - tzOffset := tzOffsetRegex.Match(data) - hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") - var layout string - if tzOffset && hasT { - layout = time.RFC3339Nano - } else if tzOffset { - layout = dateTimeNoT - } else if hasT { - layout = utcDateTime - } else { - layout = utcDateTimeNoT - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) Parse(layout, value string) error { - p, err := time.Parse(layout, strings.ToUpper(value)) - *t = dateTimeRFC3339(p) - return err -} - -func (t dateTimeRFC3339) String() string { - return time.Time(t).Format(time.RFC3339Nano) -} - -func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { - if t == nil { - return - } else if azcore.IsNullValue(t) { - m[k] = nil - return - } else if reflect.ValueOf(t).IsNil() { - return - } - m[k] = (*dateTimeRFC3339)(t) -} - -func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || string(data) == "null" { - return nil - } - var aux dateTimeRFC3339 - if err := json.Unmarshal(data, &aux); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - *t = (*time.Time)(&aux) - return nil -} diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/tokens_client.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/tokens_client.go index 79e4c76199b0..c63ddc71a95a 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/tokens_client.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/tokens_client.go @@ -1,7 +1,6 @@ // 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armcontainerregistry @@ -56,8 +55,7 @@ func (client *TokensClient) BeginCreate(ctx context.Context, resourceGroupName s return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[TokensClientCreateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -119,6 +117,7 @@ func (client *TokensClient) createCreateRequest(ctx context.Context, resourceGro reqQP.Set("api-version", "2025-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, tokenCreateParameters); err != nil { return nil, err } @@ -140,8 +139,7 @@ func (client *TokensClient) BeginDelete(ctx context.Context, resourceGroupName s return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[TokensClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -202,7 +200,6 @@ func (client *TokensClient) deleteCreateRequest(ctx context.Context, resourceGro reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2025-11-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -355,8 +352,7 @@ func (client *TokensClient) BeginUpdate(ctx context.Context, resourceGroupName s return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[TokensClientUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -418,6 +414,7 @@ func (client *TokensClient) updateCreateRequest(ctx context.Context, resourceGro reqQP.Set("api-version", "2025-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, tokenUpdateParameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/tokens_client_example_test.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/tokens_client_example_test.go index f560400cc924..f80eaf131069 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/tokens_client_example_test.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/tokens_client_example_test.go @@ -1,166 +1,199 @@ // 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. -// DO NOT EDIT. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armcontainerregistry_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/containerregistry/armcontainerregistry/v3" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/TokenList.json -func ExampleTokensClient_NewListPager() { +// Generated from example definition: 2025-11-01/TokenCreate.json +func ExampleTokensClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewTokensClient().NewListPager("myResourceGroup", "myRegistry", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.TokenListResult = armcontainerregistry.TokenListResult{ - // Value: []*armcontainerregistry.Token{ - // { - // Name: to.Ptr("myToken"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/tokens"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/myToken"), - // Properties: &armcontainerregistry.TokenProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:14:37.070Z"); return t}()), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // ScopeMapID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myScopeMap"), - // Status: to.Ptr(armcontainerregistry.TokenStatusEnabled), - // }, - // }}, - // } + poller, err := clientFactory.NewTokensClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", "myToken", armcontainerregistry.Token{ + Properties: &armcontainerregistry.TokenProperties{ + ScopeMapID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myScopeMap"), + Status: to.Ptr(armcontainerregistry.TokenStatusDisabled), + Credentials: &armcontainerregistry.TokenCredentialsProperties{ + Certificates: []*armcontainerregistry.TokenCertificate{ + { + Name: to.Ptr(armcontainerregistry.TokenCertificateNameCertificate1), + EncodedPemCertificate: to.Ptr("LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUc3akNDQk5hZ0F3SUJBZ0lURmdBQlR3UVpyZGdmdmhxdzBnQUFBQUZQQkRBTkJna3Foa2lHOXcwQkFRc0YKQURDQml6RUxNQWtHQTFVRUJoTUNWVk14RXpBUkJnTlZCQWdUQ2xkaGMyaHBibWQwYjI0eEVEQU9CZ05WQkFjVApCMUpsWkcxdmJtUXhIakFjQmdOVkJBb1RGVTFwWTNKdmMyOW1kQ0JEYjNKd2IzSmhkR2x2YmpFVk1CTUdBMVVFCkN4TU1UV2xqY205emIyWjBJRWxVTVI0d0hBWURWUVFERXhWTmFXTnliM052Wm5RZ1NWUWdWRXhUSUVOQklEUXcKSGhjTk1UZ3dOREV5TWpJek1qUTRXaGNOTWpBd05ERXlNakl6TWpRNFdqQTVNVGN3TlFZRFZRUURFeTV6WlhKMgphV05sWTJ4cFpXNTBZMlZ5ZEMxd1lYSjBibVZ5TG0xaGJtRm5aVzFsYm5RdVlYcDFjbVV1WTI5dE1JSUJJakFOCkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQTBSYjdJcHpxMmR4emhhbVpyS1ZDakMzeTQyYlYKUnNIY2pCUTFuSDBHZ1puUDhXeDZDSE1mWThybkVJQzRLeVRRYkJXVzhnNXlmc3NSQ0ZXbFpxYjR6SkRXS0pmTgpGSmNMUm9LNnhwTktZYVZVTkVlT25IdUxHYTM0ZlA0VjBFRjZybzdvbkRLME5zanhjY1dZVzRNVXVzc0xrQS94CkUrM2RwU1REdk1KcjJoWUpsVnFDcVR6blQvbmZaVUZzQUVEQnp5MUpOOHZiZDlIR2czc2Myd0x4dk95cFJOc0gKT1V3V2pmN2xzWWZleEVlcWkzY29EeHc2alpLVWEyVkdsUnBpTkowMjhBQitYSi9TU1FVNVBsd0JBbU9TT3ovRApGY0NKdGpPZlBqU1NKckFIQVV3SHU3RzlSV05JTFBwYU9zQ1J5eitETE5zNGpvNlEvUUg4d1lManJRSURBUUFCCm80SUNtakNDQXBZd0N3WURWUjBQQkFRREFnU3dNQjBHQTFVZEpRUVdNQlFHQ0NzR0FRVUZCd01DQmdnckJnRUYKQlFjREFUQWRCZ05WSFE0RUZnUVVlbEdkVVJrZzJoSFFOWEQ4WUc4L3drdjJVT0F3SHdZRFZSMGpCQmd3Rm9BVQplbnVNd2Mvbm9Nb2MxR3Y2KytFend3OGFvcDB3Z2F3R0ExVWRId1NCcERDQm9UQ0JucUNCbTZDQm1JWkxhSFIwCmNEb3ZMMjF6WTNKc0xtMXBZM0p2YzI5bWRDNWpiMjB2Y0d0cEwyMXpZMjl5Y0M5amNtd3ZUV2xqY205emIyWjAKSlRJd1NWUWxNakJVVEZNbE1qQkRRU1V5TURRdVkzSnNoa2xvZEhSd09pOHZZM0pzTG0xcFkzSnZjMjltZEM1agpiMjB2Y0d0cEwyMXpZMjl5Y0M5amNtd3ZUV2xqY205emIyWjBKVEl3U1ZRbE1qQlVURk1sTWpCRFFTVXlNRFF1ClkzSnNNSUdGQmdnckJnRUZCUWNCQVFSNU1IY3dVUVlJS3dZQkJRVUhNQUtHUldoMGRIQTZMeTkzZDNjdWJXbGoKY205emIyWjBMbU52YlM5d2Eya3ZiWE5qYjNKd0wwMXBZM0p2YzI5bWRDVXlNRWxVSlRJd1ZFeFRKVEl3UTBFbApNakEwTG1OeWREQWlCZ2dyQmdFRkJRY3dBWVlXYUhSMGNEb3ZMMjlqYzNBdWJYTnZZM053TG1OdmJUQStCZ2tyCkJnRUVBWUkzRlFjRU1UQXZCaWNyQmdFRUFZSTNGUWlIMm9aMWcrN1pBWUxKaFJ1QnRaNWhoZlRyWUlGZGhOTGYKUW9Mbmszb0NBV1FDQVIwd1RRWURWUjBnQkVZd1JEQkNCZ2tyQmdFRUFZSTNLZ0V3TlRBekJnZ3JCZ0VGQlFjQwpBUlluYUhSMGNEb3ZMM2QzZHk1dGFXTnliM052Wm5RdVkyOXRMM0JyYVM5dGMyTnZjbkF2WTNCek1DY0dDU3NHCkFRUUJnamNWQ2dRYU1CZ3dDZ1lJS3dZQkJRVUhBd0l3Q2dZSUt3WUJCUVVIQXdFd09RWURWUjBSQkRJd01JSXUKYzJWeWRtbGpaV05zYVdWdWRHTmxjblF0Y0dGeWRHNWxjaTV0WVc1aFoyVnRaVzUwTG1GNmRYSmxMbU52YlRBTgpCZ2txaGtpRzl3MEJBUXNGQUFPQ0FnRUFIVXIzbk1vdUI5WWdDUlRWYndUTllIS2RkWGJkSW1GUXNDYys4T1g1CjE5c0N6dFFSR05iSXEwVW1Ba01MbFVvWTIxckh4ZXdxU2hWczFhL2RwaFh5Tk1pcUdaU2QzU1BtYzZscitqUFQKNXVEREs0MUlWeXN0K2VUNlpyazFvcCtMVmdkeS9EU2lyNzVqcWZFY016bS82bU8rNnFNeWRLTWtVYmM5K3JHVwphUkpUcjRWUUdIRmEwNEIwZVZpNUd4MG9pL2RpZDNSaXg2aXJMMjFJSGEwYjN6c1hzZHpHU0R2K3hqL2Q2S0l4Ckdrd2FhYmZvU1NoQnFqaFNlQ0VyZXFlb1RpYjljdGw0MGRVdUp3THl4bjhHS2N6K3AvMEJUOEIxU3lYK01OQ2wKY0pkMjVtMjhLajY2TGUxOEVyeFlJYXZJVGVGa3Y2eGZjdkEvcHladDdPaU41QTlGQk1IUmpQK1kyZ2tvdjMrcQpISFRUZG4xNnlRajduNit3YlFHNGVleXc0YisyQkRLcUxNVFU2ZmlSQ3ZPM2FPZVBLSFVNN3R4b1FidWl6Z3NzCkNiMzl3QnJOTEZsMkJLQ1RkSCtkSU9oZVJiSkZvbmlwOGRPOUVFZWdSSG9lQW54ZUlYTFBrdXMzTzEvZjRhNkIKWHQ3RG5BUm8xSzJmeEp3VXRaU2MvR3dFSjU5NzlnRXlEa3pDZEVsLzdpWE9QZXVjTXhlM2xVM2pweUtsNERUaApjSkJqQytqNGpLWTFrK1U4b040aGdqYnJISUx6Vnd2eU15OU5KS290U3BMSjQxeHdPOHlGangxalFTT3Bxc0N1ClFhUFUvTjhSZ0hxWjBGTkFzS3dNUmZ6WmdXanRCNzRzYUVEdk5jVmNuNFhCQnFNSG0ydHo2Uzk3d3kxZGt0cTgKSE5BPQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg=="), + }, + }, + }, + }, + }, 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) } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armcontainerregistry.TokensClientCreateResponse{ + // Token: &armcontainerregistry.Token{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/myToken"), + // Name: to.Ptr("myToken"), + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/tokens"), + // Properties: &armcontainerregistry.TokenProperties{ + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:14:37.0707808Z"); return t}()), + // ScopeMapID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myScopeMap"), + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // Status: to.Ptr(armcontainerregistry.TokenStatusDisabled), + // Credentials: &armcontainerregistry.TokenCredentialsProperties{ + // Certificates: []*armcontainerregistry.TokenCertificate{ + // { + // Name: to.Ptr(armcontainerregistry.TokenCertificateNameCertificate1), + // Thumbprint: to.Ptr("feeb79a888bf1415f8e17c4965a2a5bb5c8a2ff7"), + // Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-04T15:32:48.0707808Z"); return t}()), + // }, + // }, + // }, + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/TokenGet.json -func ExampleTokensClient_Get() { +// Generated from example definition: 2025-11-01/TokenDelete.json +func ExampleTokensClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewTokensClient().Get(ctx, "myResourceGroup", "myRegistry", "myToken", nil) + poller, err := clientFactory.NewTokensClient().BeginDelete(ctx, "myResourceGroup", "myRegistry", "myToken", 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) + } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Token = armcontainerregistry.Token{ - // Name: to.Ptr("myToken"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/tokens"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/myToken"), - // Properties: &armcontainerregistry.TokenProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:14:37.070Z"); return t}()), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // ScopeMapID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myScopeMap"), - // Status: to.Ptr(armcontainerregistry.TokenStatusEnabled), - // }, + // res = armcontainerregistry.TokensClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/TokenCreate.json -func ExampleTokensClient_BeginCreate() { +// Generated from example definition: 2025-11-01/TokenGet.json +func ExampleTokensClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewTokensClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", "myToken", armcontainerregistry.Token{ - Properties: &armcontainerregistry.TokenProperties{ - Credentials: &armcontainerregistry.TokenCredentialsProperties{ - Certificates: []*armcontainerregistry.TokenCertificate{ - { - Name: to.Ptr(armcontainerregistry.TokenCertificateNameCertificate1), - EncodedPemCertificate: to.Ptr("LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUc3akNDQk5hZ0F3SUJBZ0lURmdBQlR3UVpyZGdmdmhxdzBnQUFBQUZQQkRBTkJna3Foa2lHOXcwQkFRc0YKQURDQml6RUxNQWtHQTFVRUJoTUNWVk14RXpBUkJnTlZCQWdUQ2xkaGMyaHBibWQwYjI0eEVEQU9CZ05WQkFjVApCMUpsWkcxdmJtUXhIakFjQmdOVkJBb1RGVTFwWTNKdmMyOW1kQ0JEYjNKd2IzSmhkR2x2YmpFVk1CTUdBMVVFCkN4TU1UV2xqY205emIyWjBJRWxVTVI0d0hBWURWUVFERXhWTmFXTnliM052Wm5RZ1NWUWdWRXhUSUVOQklEUXcKSGhjTk1UZ3dOREV5TWpJek1qUTRXaGNOTWpBd05ERXlNakl6TWpRNFdqQTVNVGN3TlFZRFZRUURFeTV6WlhKMgphV05sWTJ4cFpXNTBZMlZ5ZEMxd1lYSjBibVZ5TG0xaGJtRm5aVzFsYm5RdVlYcDFjbVV1WTI5dE1JSUJJakFOCkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQTBSYjdJcHpxMmR4emhhbVpyS1ZDakMzeTQyYlYKUnNIY2pCUTFuSDBHZ1puUDhXeDZDSE1mWThybkVJQzRLeVRRYkJXVzhnNXlmc3NSQ0ZXbFpxYjR6SkRXS0pmTgpGSmNMUm9LNnhwTktZYVZVTkVlT25IdUxHYTM0ZlA0VjBFRjZybzdvbkRLME5zanhjY1dZVzRNVXVzc0xrQS94CkUrM2RwU1REdk1KcjJoWUpsVnFDcVR6blQvbmZaVUZzQUVEQnp5MUpOOHZiZDlIR2czc2Myd0x4dk95cFJOc0gKT1V3V2pmN2xzWWZleEVlcWkzY29EeHc2alpLVWEyVkdsUnBpTkowMjhBQitYSi9TU1FVNVBsd0JBbU9TT3ovRApGY0NKdGpPZlBqU1NKckFIQVV3SHU3RzlSV05JTFBwYU9zQ1J5eitETE5zNGpvNlEvUUg4d1lManJRSURBUUFCCm80SUNtakNDQXBZd0N3WURWUjBQQkFRREFnU3dNQjBHQTFVZEpRUVdNQlFHQ0NzR0FRVUZCd01DQmdnckJnRUYKQlFjREFUQWRCZ05WSFE0RUZnUVVlbEdkVVJrZzJoSFFOWEQ4WUc4L3drdjJVT0F3SHdZRFZSMGpCQmd3Rm9BVQplbnVNd2Mvbm9Nb2MxR3Y2KytFend3OGFvcDB3Z2F3R0ExVWRId1NCcERDQm9UQ0JucUNCbTZDQm1JWkxhSFIwCmNEb3ZMMjF6WTNKc0xtMXBZM0p2YzI5bWRDNWpiMjB2Y0d0cEwyMXpZMjl5Y0M5amNtd3ZUV2xqY205emIyWjAKSlRJd1NWUWxNakJVVEZNbE1qQkRRU1V5TURRdVkzSnNoa2xvZEhSd09pOHZZM0pzTG0xcFkzSnZjMjltZEM1agpiMjB2Y0d0cEwyMXpZMjl5Y0M5amNtd3ZUV2xqY205emIyWjBKVEl3U1ZRbE1qQlVURk1sTWpCRFFTVXlNRFF1ClkzSnNNSUdGQmdnckJnRUZCUWNCQVFSNU1IY3dVUVlJS3dZQkJRVUhNQUtHUldoMGRIQTZMeTkzZDNjdWJXbGoKY205emIyWjBMbU52YlM5d2Eya3ZiWE5qYjNKd0wwMXBZM0p2YzI5bWRDVXlNRWxVSlRJd1ZFeFRKVEl3UTBFbApNakEwTG1OeWREQWlCZ2dyQmdFRkJRY3dBWVlXYUhSMGNEb3ZMMjlqYzNBdWJYTnZZM053TG1OdmJUQStCZ2tyCkJnRUVBWUkzRlFjRU1UQXZCaWNyQmdFRUFZSTNGUWlIMm9aMWcrN1pBWUxKaFJ1QnRaNWhoZlRyWUlGZGhOTGYKUW9Mbmszb0NBV1FDQVIwd1RRWURWUjBnQkVZd1JEQkNCZ2tyQmdFRUFZSTNLZ0V3TlRBekJnZ3JCZ0VGQlFjQwpBUlluYUhSMGNEb3ZMM2QzZHk1dGFXTnliM052Wm5RdVkyOXRMM0JyYVM5dGMyTnZjbkF2WTNCek1DY0dDU3NHCkFRUUJnamNWQ2dRYU1CZ3dDZ1lJS3dZQkJRVUhBd0l3Q2dZSUt3WUJCUVVIQXdFd09RWURWUjBSQkRJd01JSXUKYzJWeWRtbGpaV05zYVdWdWRHTmxjblF0Y0dGeWRHNWxjaTV0WVc1aFoyVnRaVzUwTG1GNmRYSmxMbU52YlRBTgpCZ2txaGtpRzl3MEJBUXNGQUFPQ0FnRUFIVXIzbk1vdUI5WWdDUlRWYndUTllIS2RkWGJkSW1GUXNDYys4T1g1CjE5c0N6dFFSR05iSXEwVW1Ba01MbFVvWTIxckh4ZXdxU2hWczFhL2RwaFh5Tk1pcUdaU2QzU1BtYzZscitqUFQKNXVEREs0MUlWeXN0K2VUNlpyazFvcCtMVmdkeS9EU2lyNzVqcWZFY016bS82bU8rNnFNeWRLTWtVYmM5K3JHVwphUkpUcjRWUUdIRmEwNEIwZVZpNUd4MG9pL2RpZDNSaXg2aXJMMjFJSGEwYjN6c1hzZHpHU0R2K3hqL2Q2S0l4Ckdrd2FhYmZvU1NoQnFqaFNlQ0VyZXFlb1RpYjljdGw0MGRVdUp3THl4bjhHS2N6K3AvMEJUOEIxU3lYK01OQ2wKY0pkMjVtMjhLajY2TGUxOEVyeFlJYXZJVGVGa3Y2eGZjdkEvcHladDdPaU41QTlGQk1IUmpQK1kyZ2tvdjMrcQpISFRUZG4xNnlRajduNit3YlFHNGVleXc0YisyQkRLcUxNVFU2ZmlSQ3ZPM2FPZVBLSFVNN3R4b1FidWl6Z3NzCkNiMzl3QnJOTEZsMkJLQ1RkSCtkSU9oZVJiSkZvbmlwOGRPOUVFZWdSSG9lQW54ZUlYTFBrdXMzTzEvZjRhNkIKWHQ3RG5BUm8xSzJmeEp3VXRaU2MvR3dFSjU5NzlnRXlEa3pDZEVsLzdpWE9QZXVjTXhlM2xVM2pweUtsNERUaApjSkJqQytqNGpLWTFrK1U4b040aGdqYnJISUx6Vnd2eU15OU5KS290U3BMSjQxeHdPOHlGangxalFTT3Bxc0N1ClFhUFUvTjhSZ0hxWjBGTkFzS3dNUmZ6WmdXanRCNzRzYUVEdk5jVmNuNFhCQnFNSG0ydHo2Uzk3d3kxZGt0cTgKSE5BPQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg=="), - }}, - }, - ScopeMapID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myScopeMap"), - Status: to.Ptr(armcontainerregistry.TokenStatusDisabled), - }, - }, nil) + res, err := clientFactory.NewTokensClient().Get(ctx, "myResourceGroup", "myRegistry", "myToken", 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) - } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Token = armcontainerregistry.Token{ - // Name: to.Ptr("myToken"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/tokens"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/myToken"), - // Properties: &armcontainerregistry.TokenProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:14:37.070Z"); return t}()), - // Credentials: &armcontainerregistry.TokenCredentialsProperties{ - // Certificates: []*armcontainerregistry.TokenCertificate{ - // { - // Name: to.Ptr(armcontainerregistry.TokenCertificateNameCertificate1), - // Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-04T15:32:48.070Z"); return t}()), - // Thumbprint: to.Ptr("feeb79a888bf1415f8e17c4965a2a5bb5c8a2ff7"), - // }}, + // res = armcontainerregistry.TokensClientGetResponse{ + // Token: &armcontainerregistry.Token{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/myToken"), + // Name: to.Ptr("myToken"), + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/tokens"), + // Properties: &armcontainerregistry.TokenProperties{ + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:14:37.0707808Z"); return t}()), + // ScopeMapID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myScopeMap"), + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // Status: to.Ptr(armcontainerregistry.TokenStatusEnabled), // }, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // ScopeMapID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myScopeMap"), - // Status: to.Ptr(armcontainerregistry.TokenStatusDisabled), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/TokenUpdate.json +// Generated from example definition: 2025-11-01/TokenList.json +func ExampleTokensClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewTokensClient().NewListPager("myResourceGroup", "myRegistry", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page = armcontainerregistry.TokensClientListResponse{ + // TokenListResult: armcontainerregistry.TokenListResult{ + // Value: []*armcontainerregistry.Token{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/myToken"), + // Name: to.Ptr("myToken"), + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/tokens"), + // Properties: &armcontainerregistry.TokenProperties{ + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:14:37.0707808Z"); return t}()), + // ScopeMapID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myScopeMap"), + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // Status: to.Ptr(armcontainerregistry.TokenStatusEnabled), + // }, + // }, + // }, + // }, + // } + } +} + +// Generated from example definition: 2025-11-01/TokenUpdate.json func ExampleTokensClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewTokensClient().BeginUpdate(ctx, "myResourceGroup", "myRegistry", "myToken", armcontainerregistry.TokenUpdateParameters{ Properties: &armcontainerregistry.TokenUpdateProperties{ + ScopeMapID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myNewScopeMap"), Credentials: &armcontainerregistry.TokenCredentialsProperties{ Certificates: []*armcontainerregistry.TokenCertificate{ { Name: to.Ptr(armcontainerregistry.TokenCertificateNameCertificate1), EncodedPemCertificate: to.Ptr("LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUc3akNDQk5hZ0F3SUJBZ0lURmdBQlR3UVpyZGdmdmhxdzBnQUFBQUZQQkRBTkJna3Foa2lHOXcwQkFRc0YKQURDQml6RUxNQWtHQTFVRUJoTUNWVk14RXpBUkJnTlZCQWdUQ2xkaGMyaHBibWQwYjI0eEVEQU9CZ05WQkFjVApCMUpsWkcxdmJtUXhIakFjQmdOVkJBb1RGVTFwWTNKdmMyOW1kQ0JEYjNKd2IzSmhkR2x2YmpFVk1CTUdBMVVFCkN4TU1UV2xqY205emIyWjBJRWxVTVI0d0hBWURWUVFERXhWTmFXTnliM052Wm5RZ1NWUWdWRXhUSUVOQklEUXcKSGhjTk1UZ3dOREV5TWpJek1qUTRXaGNOTWpBd05ERXlNakl6TWpRNFdqQTVNVGN3TlFZRFZRUURFeTV6WlhKMgphV05sWTJ4cFpXNTBZMlZ5ZEMxd1lYSjBibVZ5TG0xaGJtRm5aVzFsYm5RdVlYcDFjbVV1WTI5dE1JSUJJakFOCkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQTBSYjdJcHpxMmR4emhhbVpyS1ZDakMzeTQyYlYKUnNIY2pCUTFuSDBHZ1puUDhXeDZDSE1mWThybkVJQzRLeVRRYkJXVzhnNXlmc3NSQ0ZXbFpxYjR6SkRXS0pmTgpGSmNMUm9LNnhwTktZYVZVTkVlT25IdUxHYTM0ZlA0VjBFRjZybzdvbkRLME5zanhjY1dZVzRNVXVzc0xrQS94CkUrM2RwU1REdk1KcjJoWUpsVnFDcVR6blQvbmZaVUZzQUVEQnp5MUpOOHZiZDlIR2czc2Myd0x4dk95cFJOc0gKT1V3V2pmN2xzWWZleEVlcWkzY29EeHc2alpLVWEyVkdsUnBpTkowMjhBQitYSi9TU1FVNVBsd0JBbU9TT3ovRApGY0NKdGpPZlBqU1NKckFIQVV3SHU3RzlSV05JTFBwYU9zQ1J5eitETE5zNGpvNlEvUUg4d1lManJRSURBUUFCCm80SUNtakNDQXBZd0N3WURWUjBQQkFRREFnU3dNQjBHQTFVZEpRUVdNQlFHQ0NzR0FRVUZCd01DQmdnckJnRUYKQlFjREFUQWRCZ05WSFE0RUZnUVVlbEdkVVJrZzJoSFFOWEQ4WUc4L3drdjJVT0F3SHdZRFZSMGpCQmd3Rm9BVQplbnVNd2Mvbm9Nb2MxR3Y2KytFend3OGFvcDB3Z2F3R0ExVWRId1NCcERDQm9UQ0JucUNCbTZDQm1JWkxhSFIwCmNEb3ZMMjF6WTNKc0xtMXBZM0p2YzI5bWRDNWpiMjB2Y0d0cEwyMXpZMjl5Y0M5amNtd3ZUV2xqY205emIyWjAKSlRJd1NWUWxNakJVVEZNbE1qQkRRU1V5TURRdVkzSnNoa2xvZEhSd09pOHZZM0pzTG0xcFkzSnZjMjltZEM1agpiMjB2Y0d0cEwyMXpZMjl5Y0M5amNtd3ZUV2xqY205emIyWjBKVEl3U1ZRbE1qQlVURk1sTWpCRFFTVXlNRFF1ClkzSnNNSUdGQmdnckJnRUZCUWNCQVFSNU1IY3dVUVlJS3dZQkJRVUhNQUtHUldoMGRIQTZMeTkzZDNjdWJXbGoKY205emIyWjBMbU52YlM5d2Eya3ZiWE5qYjNKd0wwMXBZM0p2YzI5bWRDVXlNRWxVSlRJd1ZFeFRKVEl3UTBFbApNakEwTG1OeWREQWlCZ2dyQmdFRkJRY3dBWVlXYUhSMGNEb3ZMMjlqYzNBdWJYTnZZM053TG1OdmJUQStCZ2tyCkJnRUVBWUkzRlFjRU1UQXZCaWNyQmdFRUFZSTNGUWlIMm9aMWcrN1pBWUxKaFJ1QnRaNWhoZlRyWUlGZGhOTGYKUW9Mbmszb0NBV1FDQVIwd1RRWURWUjBnQkVZd1JEQkNCZ2tyQmdFRUFZSTNLZ0V3TlRBekJnZ3JCZ0VGQlFjQwpBUlluYUhSMGNEb3ZMM2QzZHk1dGFXTnliM052Wm5RdVkyOXRMM0JyYVM5dGMyTnZjbkF2WTNCek1DY0dDU3NHCkFRUUJnamNWQ2dRYU1CZ3dDZ1lJS3dZQkJRVUhBd0l3Q2dZSUt3WUJCUVVIQXdFd09RWURWUjBSQkRJd01JSXUKYzJWeWRtbGpaV05zYVdWdWRHTmxjblF0Y0dGeWRHNWxjaTV0WVc1aFoyVnRaVzUwTG1GNmRYSmxMbU52YlRBTgpCZ2txaGtpRzl3MEJBUXNGQUFPQ0FnRUFIVXIzbk1vdUI5WWdDUlRWYndUTllIS2RkWGJkSW1GUXNDYys4T1g1CjE5c0N6dFFSR05iSXEwVW1Ba01MbFVvWTIxckh4ZXdxU2hWczFhL2RwaFh5Tk1pcUdaU2QzU1BtYzZscitqUFQKNXVEREs0MUlWeXN0K2VUNlpyazFvcCtMVmdkeS9EU2lyNzVqcWZFY016bS82bU8rNnFNeWRLTWtVYmM5K3JHVwphUkpUcjRWUUdIRmEwNEIwZVZpNUd4MG9pL2RpZDNSaXg2aXJMMjFJSGEwYjN6c1hzZHpHU0R2K3hqL2Q2S0l4Ckdrd2FhYmZvU1NoQnFqaFNlQ0VyZXFlb1RpYjljdGw0MGRVdUp3THl4bjhHS2N6K3AvMEJUOEIxU3lYK01OQ2wKY0pkMjVtMjhLajY2TGUxOEVyeFlJYXZJVGVGa3Y2eGZjdkEvcHladDdPaU41QTlGQk1IUmpQK1kyZ2tvdjMrcQpISFRUZG4xNnlRajduNit3YlFHNGVleXc0YisyQkRLcUxNVFU2ZmlSQ3ZPM2FPZVBLSFVNN3R4b1FidWl6Z3NzCkNiMzl3QnJOTEZsMkJLQ1RkSCtkSU9oZVJiSkZvbmlwOGRPOUVFZWdSSG9lQW54ZUlYTFBrdXMzTzEvZjRhNkIKWHQ3RG5BUm8xSzJmeEp3VXRaU2MvR3dFSjU5NzlnRXlEa3pDZEVsLzdpWE9QZXVjTXhlM2xVM2pweUtsNERUaApjSkJqQytqNGpLWTFrK1U4b040aGdqYnJISUx6Vnd2eU15OU5KS290U3BMSjQxeHdPOHlGangxalFTT3Bxc0N1ClFhUFUvTjhSZ0hxWjBGTkFzS3dNUmZ6WmdXanRCNzRzYUVEdk5jVmNuNFhCQnFNSG0ydHo2Uzk3d3kxZGt0cTgKSE5BPQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg=="), - }}, + }, + }, }, - ScopeMapID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myNewScopeMap"), }, }, nil) if err != nil { @@ -173,43 +206,25 @@ func ExampleTokensClient_BeginUpdate() { // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Token = armcontainerregistry.Token{ - // Name: to.Ptr("myToken"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/tokens"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/myToken"), - // Properties: &armcontainerregistry.TokenProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:14:37.070Z"); return t}()), - // Credentials: &armcontainerregistry.TokenCredentialsProperties{ - // Certificates: []*armcontainerregistry.TokenCertificate{ - // { - // Name: to.Ptr(armcontainerregistry.TokenCertificateNameCertificate1), - // EncodedPemCertificate: to.Ptr("LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUc3akNDQk5hZ0F3SUJBZ0lURmdBQlR3UVpyZGdmdmhxdzBnQUFBQUZQQkRBTkJna3Foa2lHOXcwQkFRc0YKQURDQml6RUxNQWtHQTFVRUJoTUNWVk14RXpBUkJnTlZCQWdUQ2xkaGMyaHBibWQwYjI0eEVEQU9CZ05WQkFjVApCMUpsWkcxdmJtUXhIakFjQmdOVkJBb1RGVTFwWTNKdmMyOW1kQ0JEYjNKd2IzSmhkR2x2YmpFVk1CTUdBMVVFCkN4TU1UV2xqY205emIyWjBJRWxVTVI0d0hBWURWUVFERXhWTmFXTnliM052Wm5RZ1NWUWdWRXhUSUVOQklEUXcKSGhjTk1UZ3dOREV5TWpJek1qUTRXaGNOTWpBd05ERXlNakl6TWpRNFdqQTVNVGN3TlFZRFZRUURFeTV6WlhKMgphV05sWTJ4cFpXNTBZMlZ5ZEMxd1lYSjBibVZ5TG0xaGJtRm5aVzFsYm5RdVlYcDFjbVV1WTI5dE1JSUJJakFOCkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQTBSYjdJcHpxMmR4emhhbVpyS1ZDakMzeTQyYlYKUnNIY2pCUTFuSDBHZ1puUDhXeDZDSE1mWThybkVJQzRLeVRRYkJXVzhnNXlmc3NSQ0ZXbFpxYjR6SkRXS0pmTgpGSmNMUm9LNnhwTktZYVZVTkVlT25IdUxHYTM0ZlA0VjBFRjZybzdvbkRLME5zanhjY1dZVzRNVXVzc0xrQS94CkUrM2RwU1REdk1KcjJoWUpsVnFDcVR6blQvbmZaVUZzQUVEQnp5MUpOOHZiZDlIR2czc2Myd0x4dk95cFJOc0gKT1V3V2pmN2xzWWZleEVlcWkzY29EeHc2alpLVWEyVkdsUnBpTkowMjhBQitYSi9TU1FVNVBsd0JBbU9TT3ovRApGY0NKdGpPZlBqU1NKckFIQVV3SHU3RzlSV05JTFBwYU9zQ1J5eitETE5zNGpvNlEvUUg4d1lManJRSURBUUFCCm80SUNtakNDQXBZd0N3WURWUjBQQkFRREFnU3dNQjBHQTFVZEpRUVdNQlFHQ0NzR0FRVUZCd01DQmdnckJnRUYKQlFjREFUQWRCZ05WSFE0RUZnUVVlbEdkVVJrZzJoSFFOWEQ4WUc4L3drdjJVT0F3SHdZRFZSMGpCQmd3Rm9BVQplbnVNd2Mvbm9Nb2MxR3Y2KytFend3OGFvcDB3Z2F3R0ExVWRId1NCcERDQm9UQ0JucUNCbTZDQm1JWkxhSFIwCmNEb3ZMMjF6WTNKc0xtMXBZM0p2YzI5bWRDNWpiMjB2Y0d0cEwyMXpZMjl5Y0M5amNtd3ZUV2xqY205emIyWjAKSlRJd1NWUWxNakJVVEZNbE1qQkRRU1V5TURRdVkzSnNoa2xvZEhSd09pOHZZM0pzTG0xcFkzSnZjMjltZEM1agpiMjB2Y0d0cEwyMXpZMjl5Y0M5amNtd3ZUV2xqY205emIyWjBKVEl3U1ZRbE1qQlVURk1sTWpCRFFTVXlNRFF1ClkzSnNNSUdGQmdnckJnRUZCUWNCQVFSNU1IY3dVUVlJS3dZQkJRVUhNQUtHUldoMGRIQTZMeTkzZDNjdWJXbGoKY205emIyWjBMbU52YlM5d2Eya3ZiWE5qYjNKd0wwMXBZM0p2YzI5bWRDVXlNRWxVSlRJd1ZFeFRKVEl3UTBFbApNakEwTG1OeWREQWlCZ2dyQmdFRkJRY3dBWVlXYUhSMGNEb3ZMMjlqYzNBdWJYTnZZM053TG1OdmJUQStCZ2tyCkJnRUVBWUkzRlFjRU1UQXZCaWNyQmdFRUFZSTNGUWlIMm9aMWcrN1pBWUxKaFJ1QnRaNWhoZlRyWUlGZGhOTGYKUW9Mbmszb0NBV1FDQVIwd1RRWURWUjBnQkVZd1JEQkNCZ2tyQmdFRUFZSTNLZ0V3TlRBekJnZ3JCZ0VGQlFjQwpBUlluYUhSMGNEb3ZMM2QzZHk1dGFXTnliM052Wm5RdVkyOXRMM0JyYVM5dGMyTnZjbkF2WTNCek1DY0dDU3NHCkFRUUJnamNWQ2dRYU1CZ3dDZ1lJS3dZQkJRVUhBd0l3Q2dZSUt3WUJCUVVIQXdFd09RWURWUjBSQkRJd01JSXUKYzJWeWRtbGpaV05zYVdWdWRHTmxjblF0Y0dGeWRHNWxjaTV0WVc1aFoyVnRaVzUwTG1GNmRYSmxMbU52YlRBTgpCZ2txaGtpRzl3MEJBUXNGQUFPQ0FnRUFIVXIzbk1vdUI5WWdDUlRWYndUTllIS2RkWGJkSW1GUXNDYys4T1g1CjE5c0N6dFFSR05iSXEwVW1Ba01MbFVvWTIxckh4ZXdxU2hWczFhL2RwaFh5Tk1pcUdaU2QzU1BtYzZscitqUFQKNXVEREs0MUlWeXN0K2VUNlpyazFvcCtMVmdkeS9EU2lyNzVqcWZFY016bS82bU8rNnFNeWRLTWtVYmM5K3JHVwphUkpUcjRWUUdIRmEwNEIwZVZpNUd4MG9pL2RpZDNSaXg2aXJMMjFJSGEwYjN6c1hzZHpHU0R2K3hqL2Q2S0l4Ckdrd2FhYmZvU1NoQnFqaFNlQ0VyZXFlb1RpYjljdGw0MGRVdUp3THl4bjhHS2N6K3AvMEJUOEIxU3lYK01OQ2wKY0pkMjVtMjhLajY2TGUxOEVyeFlJYXZJVGVGa3Y2eGZjdkEvcHladDdPaU41QTlGQk1IUmpQK1kyZ2tvdjMrcQpISFRUZG4xNnlRajduNit3YlFHNGVleXc0YisyQkRLcUxNVFU2ZmlSQ3ZPM2FPZVBLSFVNN3R4b1FidWl6Z3NzCkNiMzl3QnJOTEZsMkJLQ1RkSCtkSU9oZVJiSkZvbmlwOGRPOUVFZWdSSG9lQW54ZUlYTFBrdXMzTzEvZjRhNkIKWHQ3RG5BUm8xSzJmeEp3VXRaU2MvR3dFSjU5NzlnRXlEa3pDZEVsLzdpWE9QZXVjTXhlM2xVM2pweUtsNERUaApjSkJqQytqNGpLWTFrK1U4b040aGdqYnJISUx6Vnd2eU15OU5KS290U3BMSjQxeHdPOHlGangxalFTT3Bxc0N1ClFhUFUvTjhSZ0hxWjBGTkFzS3dNUmZ6WmdXanRCNzRzYUVEdk5jVmNuNFhCQnFNSG0ydHo2Uzk3d3kxZGt0cTgKSE5BPQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg=="), - // }}, + // res = armcontainerregistry.TokensClientUpdateResponse{ + // Token: &armcontainerregistry.Token{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/myToken"), + // Name: to.Ptr("myToken"), + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/tokens"), + // Properties: &armcontainerregistry.TokenProperties{ + // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:14:37.0707808Z"); return t}()), + // ScopeMapID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myNewScopeMap"), + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // Status: to.Ptr(armcontainerregistry.TokenStatusEnabled), + // Credentials: &armcontainerregistry.TokenCredentialsProperties{ + // Certificates: []*armcontainerregistry.TokenCertificate{ + // { + // Name: to.Ptr(armcontainerregistry.TokenCertificateNameCertificate1), + // EncodedPemCertificate: to.Ptr("LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUc3akNDQk5hZ0F3SUJBZ0lURmdBQlR3UVpyZGdmdmhxdzBnQUFBQUZQQkRBTkJna3Foa2lHOXcwQkFRc0YKQURDQml6RUxNQWtHQTFVRUJoTUNWVk14RXpBUkJnTlZCQWdUQ2xkaGMyaHBibWQwYjI0eEVEQU9CZ05WQkFjVApCMUpsWkcxdmJtUXhIakFjQmdOVkJBb1RGVTFwWTNKdmMyOW1kQ0JEYjNKd2IzSmhkR2x2YmpFVk1CTUdBMVVFCkN4TU1UV2xqY205emIyWjBJRWxVTVI0d0hBWURWUVFERXhWTmFXTnliM052Wm5RZ1NWUWdWRXhUSUVOQklEUXcKSGhjTk1UZ3dOREV5TWpJek1qUTRXaGNOTWpBd05ERXlNakl6TWpRNFdqQTVNVGN3TlFZRFZRUURFeTV6WlhKMgphV05sWTJ4cFpXNTBZMlZ5ZEMxd1lYSjBibVZ5TG0xaGJtRm5aVzFsYm5RdVlYcDFjbVV1WTI5dE1JSUJJakFOCkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQTBSYjdJcHpxMmR4emhhbVpyS1ZDakMzeTQyYlYKUnNIY2pCUTFuSDBHZ1puUDhXeDZDSE1mWThybkVJQzRLeVRRYkJXVzhnNXlmc3NSQ0ZXbFpxYjR6SkRXS0pmTgpGSmNMUm9LNnhwTktZYVZVTkVlT25IdUxHYTM0ZlA0VjBFRjZybzdvbkRLME5zanhjY1dZVzRNVXVzc0xrQS94CkUrM2RwU1REdk1KcjJoWUpsVnFDcVR6blQvbmZaVUZzQUVEQnp5MUpOOHZiZDlIR2czc2Myd0x4dk95cFJOc0gKT1V3V2pmN2xzWWZleEVlcWkzY29EeHc2alpLVWEyVkdsUnBpTkowMjhBQitYSi9TU1FVNVBsd0JBbU9TT3ovRApGY0NKdGpPZlBqU1NKckFIQVV3SHU3RzlSV05JTFBwYU9zQ1J5eitETE5zNGpvNlEvUUg4d1lManJRSURBUUFCCm80SUNtakNDQXBZd0N3WURWUjBQQkFRREFnU3dNQjBHQTFVZEpRUVdNQlFHQ0NzR0FRVUZCd01DQmdnckJnRUYKQlFjREFUQWRCZ05WSFE0RUZnUVVlbEdkVVJrZzJoSFFOWEQ4WUc4L3drdjJVT0F3SHdZRFZSMGpCQmd3Rm9BVQplbnVNd2Mvbm9Nb2MxR3Y2KytFend3OGFvcDB3Z2F3R0ExVWRId1NCcERDQm9UQ0JucUNCbTZDQm1JWkxhSFIwCmNEb3ZMMjF6WTNKc0xtMXBZM0p2YzI5bWRDNWpiMjB2Y0d0cEwyMXpZMjl5Y0M5amNtd3ZUV2xqY205emIyWjAKSlRJd1NWUWxNakJVVEZNbE1qQkRRU1V5TURRdVkzSnNoa2xvZEhSd09pOHZZM0pzTG0xcFkzSnZjMjltZEM1agpiMjB2Y0d0cEwyMXpZMjl5Y0M5amNtd3ZUV2xqY205emIyWjBKVEl3U1ZRbE1qQlVURk1sTWpCRFFTVXlNRFF1ClkzSnNNSUdGQmdnckJnRUZCUWNCQVFSNU1IY3dVUVlJS3dZQkJRVUhNQUtHUldoMGRIQTZMeTkzZDNjdWJXbGoKY205emIyWjBMbU52YlM5d2Eya3ZiWE5qYjNKd0wwMXBZM0p2YzI5bWRDVXlNRWxVSlRJd1ZFeFRKVEl3UTBFbApNakEwTG1OeWREQWlCZ2dyQmdFRkJRY3dBWVlXYUhSMGNEb3ZMMjlqYzNBdWJYTnZZM053TG1OdmJUQStCZ2tyCkJnRUVBWUkzRlFjRU1UQXZCaWNyQmdFRUFZSTNGUWlIMm9aMWcrN1pBWUxKaFJ1QnRaNWhoZlRyWUlGZGhOTGYKUW9Mbmszb0NBV1FDQVIwd1RRWURWUjBnQkVZd1JEQkNCZ2tyQmdFRUFZSTNLZ0V3TlRBekJnZ3JCZ0VGQlFjQwpBUlluYUhSMGNEb3ZMM2QzZHk1dGFXTnliM052Wm5RdVkyOXRMM0JyYVM5dGMyTnZjbkF2WTNCek1DY0dDU3NHCkFRUUJnamNWQ2dRYU1CZ3dDZ1lJS3dZQkJRVUhBd0l3Q2dZSUt3WUJCUVVIQXdFd09RWURWUjBSQkRJd01JSXUKYzJWeWRtbGpaV05zYVdWdWRHTmxjblF0Y0dGeWRHNWxjaTV0WVc1aFoyVnRaVzUwTG1GNmRYSmxMbU52YlRBTgpCZ2txaGtpRzl3MEJBUXNGQUFPQ0FnRUFIVXIzbk1vdUI5WWdDUlRWYndUTllIS2RkWGJkSW1GUXNDYys4T1g1CjE5c0N6dFFSR05iSXEwVW1Ba01MbFVvWTIxckh4ZXdxU2hWczFhL2RwaFh5Tk1pcUdaU2QzU1BtYzZscitqUFQKNXVEREs0MUlWeXN0K2VUNlpyazFvcCtMVmdkeS9EU2lyNzVqcWZFY016bS82bU8rNnFNeWRLTWtVYmM5K3JHVwphUkpUcjRWUUdIRmEwNEIwZVZpNUd4MG9pL2RpZDNSaXg2aXJMMjFJSGEwYjN6c1hzZHpHU0R2K3hqL2Q2S0l4Ckdrd2FhYmZvU1NoQnFqaFNlQ0VyZXFlb1RpYjljdGw0MGRVdUp3THl4bjhHS2N6K3AvMEJUOEIxU3lYK01OQ2wKY0pkMjVtMjhLajY2TGUxOEVyeFlJYXZJVGVGa3Y2eGZjdkEvcHladDdPaU41QTlGQk1IUmpQK1kyZ2tvdjMrcQpISFRUZG4xNnlRajduNit3YlFHNGVleXc0YisyQkRLcUxNVFU2ZmlSQ3ZPM2FPZVBLSFVNN3R4b1FidWl6Z3NzCkNiMzl3QnJOTEZsMkJLQ1RkSCtkSU9oZVJiSkZvbmlwOGRPOUVFZWdSSG9lQW54ZUlYTFBrdXMzTzEvZjRhNkIKWHQ3RG5BUm8xSzJmeEp3VXRaU2MvR3dFSjU5NzlnRXlEa3pDZEVsLzdpWE9QZXVjTXhlM2xVM2pweUtsNERUaApjSkJqQytqNGpLWTFrK1U4b040aGdqYnJISUx6Vnd2eU15OU5KS290U3BMSjQxeHdPOHlGangxalFTT3Bxc0N1ClFhUFUvTjhSZ0hxWjBGTkFzS3dNUmZ6WmdXanRCNzRzYUVEdk5jVmNuNFhCQnFNSG0ydHo2Uzk3d3kxZGt0cTgKSE5BPQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg=="), + // }, + // }, + // }, // }, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // ScopeMapID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myNewScopeMap"), - // Status: to.Ptr(armcontainerregistry.TokenStatusEnabled), // }, // } } - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/TokenDelete.json -func ExampleTokensClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTokensClient().BeginDelete(ctx, "myResourceGroup", "myRegistry", "myToken", 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/containerregistry/armcontainerregistry/tsp-location.yaml b/sdk/resourcemanager/containerregistry/armcontainerregistry/tsp-location.yaml new file mode 100644 index 000000000000..34607e6c56ad --- /dev/null +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry +commit: 1dd1a8384a33b85d72d0ec2087d71f1b500e18e2 +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/version.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/version.go index 3bb596ab1fc6..9c063d9ecdce 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/version.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/version.go @@ -6,5 +6,5 @@ package armcontainerregistry const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry" - moduleVersion = "v3.0.0-beta.1" + moduleVersion = "v3.0.0" ) diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/webhooks_client.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/webhooks_client.go index e4b586ffbc73..12e60b475f45 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/webhooks_client.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/webhooks_client.go @@ -1,7 +1,6 @@ // 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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armcontainerregistry @@ -56,8 +55,7 @@ func (client *WebhooksClient) BeginCreate(ctx context.Context, resourceGroupName return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WebhooksClientCreateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -119,6 +117,7 @@ func (client *WebhooksClient) createCreateRequest(ctx context.Context, resourceG reqQP.Set("api-version", "2025-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, webhookCreateParameters); err != nil { return nil, err } @@ -140,8 +139,7 @@ func (client *WebhooksClient) BeginDelete(ctx context.Context, resourceGroupName return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WebhooksClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -202,7 +200,6 @@ func (client *WebhooksClient) deleteCreateRequest(ctx context.Context, resourceG reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2025-11-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -563,8 +560,7 @@ func (client *WebhooksClient) BeginUpdate(ctx context.Context, resourceGroupName return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WebhooksClientUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -626,6 +622,7 @@ func (client *WebhooksClient) updateCreateRequest(ctx context.Context, resourceG reqQP.Set("api-version", "2025-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, webhookUpdateParameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/webhooks_client_example_test.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/webhooks_client_example_test.go index 4fe77760a9bf..ad5411e9e6d7 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/webhooks_client_example_test.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/webhooks_client_example_test.go @@ -1,125 +1,43 @@ // 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. -// DO NOT EDIT. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armcontainerregistry_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/containerregistry/armcontainerregistry/v3" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/WebhookList.json -func ExampleWebhooksClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewWebhooksClient().NewListPager("myResourceGroup", "myRegistry", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.WebhookListResult = armcontainerregistry.WebhookListResult{ - // Value: []*armcontainerregistry.Webhook{ - // { - // Name: to.Ptr("myWebhook"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/webhooks"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/webhooks/myWebhook"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Properties: &armcontainerregistry.WebhookProperties{ - // Actions: []*armcontainerregistry.WebhookAction{ - // to.Ptr(armcontainerregistry.WebhookActionPush)}, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // Scope: to.Ptr("myRepository"), - // Status: to.Ptr(armcontainerregistry.WebhookStatusEnabled), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/WebhookGet.json -func ExampleWebhooksClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWebhooksClient().Get(ctx, "myResourceGroup", "myRegistry", "myWebhook", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Webhook = armcontainerregistry.Webhook{ - // Name: to.Ptr("myWebhook"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/webhooks"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/webhooks/myWebhook"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Properties: &armcontainerregistry.WebhookProperties{ - // Actions: []*armcontainerregistry.WebhookAction{ - // to.Ptr(armcontainerregistry.WebhookActionPush)}, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // Scope: to.Ptr("myRepository"), - // Status: to.Ptr(armcontainerregistry.WebhookStatusEnabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/WebhookCreate.json +// Generated from example definition: 2025-11-01/WebhookCreate.json func ExampleWebhooksClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewWebhooksClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", "myWebhook", armcontainerregistry.WebhookCreateParameters{ Location: to.Ptr("westus"), + Tags: map[string]*string{ + "key": to.Ptr("value"), + }, Properties: &armcontainerregistry.WebhookPropertiesCreateParameters{ - Actions: []*armcontainerregistry.WebhookAction{ - to.Ptr(armcontainerregistry.WebhookActionPush)}, + ServiceURI: to.Ptr("http://myservice.com"), CustomHeaders: map[string]*string{ "Authorization": to.Ptr("******"), }, - Scope: to.Ptr("myRepository"), - ServiceURI: to.Ptr("http://myservice.com"), - Status: to.Ptr(armcontainerregistry.WebhookStatusEnabled), - }, - Tags: map[string]*string{ - "key": to.Ptr("value"), + Status: to.Ptr(armcontainerregistry.WebhookStatusEnabled), + Scope: to.Ptr("myRepository"), + Actions: []*armcontainerregistry.WebhookAction{ + to.Ptr(armcontainerregistry.WebhookActionPush), + }, }, }, nil) if err != nil { @@ -132,50 +50,39 @@ func ExampleWebhooksClient_BeginCreate() { // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Webhook = armcontainerregistry.Webhook{ - // Name: to.Ptr("myWebhook"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/webhooks"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/webhooks/myWebhook"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Properties: &armcontainerregistry.WebhookProperties{ - // Actions: []*armcontainerregistry.WebhookAction{ - // to.Ptr(armcontainerregistry.WebhookActionPush)}, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // Scope: to.Ptr("myRepository"), + // res = armcontainerregistry.WebhooksClientCreateResponse{ + // Webhook: &armcontainerregistry.Webhook{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/webhooks/myWebhook"), + // Name: to.Ptr("myWebhook"), + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/webhooks"), + // Location: to.Ptr("westus"), + // Tags: map[string]*string{ + // "key": to.Ptr("value"), + // }, + // Properties: &armcontainerregistry.WebhookProperties{ // Status: to.Ptr(armcontainerregistry.WebhookStatusEnabled), + // Scope: to.Ptr("myRepository"), + // Actions: []*armcontainerregistry.WebhookAction{ + // to.Ptr(armcontainerregistry.WebhookActionPush), + // }, + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), // }, - // } + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/WebhookUpdate.json -func ExampleWebhooksClient_BeginUpdate() { +// Generated from example definition: 2025-11-01/WebhookDelete.json +func ExampleWebhooksClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewWebhooksClient().BeginUpdate(ctx, "myResourceGroup", "myRegistry", "myWebhook", armcontainerregistry.WebhookUpdateParameters{ - Properties: &armcontainerregistry.WebhookPropertiesUpdateParameters{ - Actions: []*armcontainerregistry.WebhookAction{ - to.Ptr(armcontainerregistry.WebhookActionPush)}, - CustomHeaders: map[string]*string{ - "Authorization": to.Ptr("******"), - }, - Scope: to.Ptr("myRepository"), - ServiceURI: to.Ptr("http://myservice.com"), - Status: to.Ptr(armcontainerregistry.WebhookStatusEnabled), - }, - Tags: map[string]*string{ - "key": to.Ptr("value"), - }, - }, nil) + poller, err := clientFactory.NewWebhooksClient().BeginDelete(ctx, "myResourceGroup", "myRegistry", "myWebhook", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -186,53 +93,57 @@ func ExampleWebhooksClient_BeginUpdate() { // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Webhook = armcontainerregistry.Webhook{ - // Name: to.Ptr("myWebhook"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/webhooks"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/webhooks/myWebhook"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Properties: &armcontainerregistry.WebhookProperties{ - // Actions: []*armcontainerregistry.WebhookAction{ - // to.Ptr(armcontainerregistry.WebhookActionPush)}, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // Scope: to.Ptr("myRepository"), - // Status: to.Ptr(armcontainerregistry.WebhookStatusEnabled), - // }, - // } + // res = armcontainerregistry.WebhooksClientDeleteResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/WebhookDelete.json -func ExampleWebhooksClient_BeginDelete() { +// Generated from example definition: 2025-11-01/WebhookGet.json +func ExampleWebhooksClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewWebhooksClient().BeginDelete(ctx, "myResourceGroup", "myRegistry", "myWebhook", nil) + res, err := clientFactory.NewWebhooksClient().Get(ctx, "myResourceGroup", "myRegistry", "myWebhook", 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) - } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armcontainerregistry.WebhooksClientGetResponse{ + // Webhook: &armcontainerregistry.Webhook{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/webhooks/myWebhook"), + // Name: to.Ptr("myWebhook"), + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/webhooks"), + // Location: to.Ptr("westus"), + // Tags: map[string]*string{ + // "key": to.Ptr("value"), + // }, + // Properties: &armcontainerregistry.WebhookProperties{ + // Status: to.Ptr(armcontainerregistry.WebhookStatusEnabled), + // Scope: to.Ptr("myRepository"), + // Actions: []*armcontainerregistry.WebhookAction{ + // to.Ptr(armcontainerregistry.WebhookActionPush), + // }, + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/WebhookGetCallbackConfig.json +// Generated from example definition: 2025-11-01/WebhookGetCallbackConfig.json func ExampleWebhooksClient_GetCallbackConfig() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -243,22 +154,72 @@ func ExampleWebhooksClient_GetCallbackConfig() { // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CallbackConfig = armcontainerregistry.CallbackConfig{ - // CustomHeaders: map[string]*string{ - // "Authorization": to.Ptr("******"), + // res = armcontainerregistry.WebhooksClientGetCallbackConfigResponse{ + // CallbackConfig: &armcontainerregistry.CallbackConfig{ + // ServiceURI: to.Ptr("http://myservice.com"), + // CustomHeaders: map[string]*string{ + // "Authorization": to.Ptr("******"), + // }, // }, - // ServiceURI: to.Ptr("http://myservice.com"), // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/WebhookListEvents.json +// Generated from example definition: 2025-11-01/WebhookList.json +func ExampleWebhooksClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewWebhooksClient().NewListPager("myResourceGroup", "myRegistry", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page = armcontainerregistry.WebhooksClientListResponse{ + // WebhookListResult: armcontainerregistry.WebhookListResult{ + // Value: []*armcontainerregistry.Webhook{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/webhooks/myWebhook"), + // Name: to.Ptr("myWebhook"), + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/webhooks"), + // Location: to.Ptr("westus"), + // Tags: map[string]*string{ + // "key": to.Ptr("value"), + // }, + // Properties: &armcontainerregistry.WebhookProperties{ + // Status: to.Ptr(armcontainerregistry.WebhookStatusEnabled), + // Scope: to.Ptr("myRepository"), + // Actions: []*armcontainerregistry.WebhookAction{ + // to.Ptr(armcontainerregistry.WebhookActionPush), + // }, + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // }, + // }, + // }, + // }, + // } + } +} + +// Generated from example definition: 2025-11-01/WebhookListEvents.json func ExampleWebhooksClient_NewListEventsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -273,67 +234,70 @@ func ExampleWebhooksClient_NewListEventsPager() { _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.EventListResult = armcontainerregistry.EventListResult{ - // Value: []*armcontainerregistry.Event{ - // { - // ID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // EventRequestMessage: &armcontainerregistry.EventRequestMessage{ - // Method: to.Ptr("POST"), - // Content: &armcontainerregistry.EventContent{ - // Action: to.Ptr("push"), - // Actor: &armcontainerregistry.Actor{ - // }, - // ID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Source: &armcontainerregistry.Source{ - // Addr: to.Ptr("xtal.local:5000"), - // InstanceID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // Target: &armcontainerregistry.Target{ - // Digest: to.Ptr("sha256:fea8895f450959fa676bcc1df0611ea93823a735a01205fd8622846041d0c7cf"), - // Length: to.Ptr[int64](708), - // MediaType: to.Ptr("application/vnd.docker.distribution.manifest.v2+json"), - // Repository: to.Ptr("hello-world"), - // Size: to.Ptr[int64](708), - // Tag: to.Ptr("latest"), - // URL: to.Ptr("http://192.168.100.227:5000/v2/hello-world/manifests/sha256:fea8895f450959fa676bcc1df0611ea93823a735a01205fd8622846041d0c7cf"), - // }, - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:14:37.070Z"); return t}()), - // Request: &armcontainerregistry.Request{ - // Method: to.Ptr("GET"), - // Addr: to.Ptr("192.168.64.11:42961"), - // Host: to.Ptr("192.168.100.227:5000"), + // page = armcontainerregistry.WebhooksClientListEventsResponse{ + // EventListResult: armcontainerregistry.EventListResult{ + // Value: []*armcontainerregistry.Event{ + // { + // ID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // EventRequestMessage: &armcontainerregistry.EventRequestMessage{ + // Content: &armcontainerregistry.EventContent{ // ID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Useragent: to.Ptr("curl/7.38.0"), + // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:14:37.0707808Z"); return t}()), + // Action: to.Ptr("push"), + // Target: &armcontainerregistry.Target{ + // MediaType: to.Ptr("application/vnd.docker.distribution.manifest.v2+json"), + // Size: to.Ptr[int64](708), + // Digest: to.Ptr("sha256:fea8895f450959fa676bcc1df0611ea93823a735a01205fd8622846041d0c7cf"), + // Length: to.Ptr[int64](708), + // Repository: to.Ptr("hello-world"), + // URL: to.Ptr("http://192.168.100.227:5000/v2/hello-world/manifests/sha256:fea8895f450959fa676bcc1df0611ea93823a735a01205fd8622846041d0c7cf"), + // Tag: to.Ptr("latest"), + // }, + // Request: &armcontainerregistry.Request{ + // ID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // Addr: to.Ptr("192.168.64.11:42961"), + // Host: to.Ptr("192.168.100.227:5000"), + // Method: to.Ptr("GET"), + // Useragent: to.Ptr("curl/7.38.0"), + // }, + // Actor: &armcontainerregistry.Actor{ + // }, + // Source: &armcontainerregistry.Source{ + // Addr: to.Ptr("xtal.local:5000"), + // InstanceID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, // }, + // Headers: map[string]*string{ + // "Content-Type": to.Ptr("application/json"), + // "Content-Length": to.Ptr("719"), + // "Authorization": to.Ptr("******"), + // }, + // Method: to.Ptr("POST"), + // RequestURI: to.Ptr("http://myservice.com"), + // Version: to.Ptr("1.1"), // }, - // Headers: map[string]*string{ - // "Authorization": to.Ptr("******"), - // "Content-Length": to.Ptr("719"), - // "Content-Type": to.Ptr("application/json"), - // }, - // RequestURI: to.Ptr("http://myservice.com"), - // Version: to.Ptr("1.1"), - // }, - // EventResponseMessage: &armcontainerregistry.EventResponseMessage{ - // Headers: map[string]*string{ - // "Content-Length": to.Ptr("0"), + // EventResponseMessage: &armcontainerregistry.EventResponseMessage{ + // Headers: map[string]*string{ + // "Content-Length": to.Ptr("0"), + // }, + // StatusCode: to.Ptr("200"), + // Version: to.Ptr("1.1"), // }, - // StatusCode: to.Ptr("200"), - // Version: to.Ptr("1.1"), // }, - // }}, + // }, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/523ccabf440d8cf1c5b0ea18a8ad1ffedf4902ac/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/stable/2025-11-01/examples/WebhookPing.json +// Generated from example definition: 2025-11-01/WebhookPing.json func ExampleWebhooksClient_Ping() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -344,7 +308,67 @@ func ExampleWebhooksClient_Ping() { // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.EventInfo = armcontainerregistry.EventInfo{ - // ID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // res = armcontainerregistry.WebhooksClientPingResponse{ + // EventInfo: &armcontainerregistry.EventInfo{ + // ID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, + // } +} + +// Generated from example definition: 2025-11-01/WebhookUpdate.json +func ExampleWebhooksClient_BeginUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerregistry.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewWebhooksClient().BeginUpdate(ctx, "myResourceGroup", "myRegistry", "myWebhook", armcontainerregistry.WebhookUpdateParameters{ + Tags: map[string]*string{ + "key": to.Ptr("value"), + }, + Properties: &armcontainerregistry.WebhookPropertiesUpdateParameters{ + ServiceURI: to.Ptr("http://myservice.com"), + CustomHeaders: map[string]*string{ + "Authorization": to.Ptr("******"), + }, + Status: to.Ptr(armcontainerregistry.WebhookStatusEnabled), + Scope: to.Ptr("myRepository"), + Actions: []*armcontainerregistry.WebhookAction{ + to.Ptr(armcontainerregistry.WebhookActionPush), + }, + }, + }, 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) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armcontainerregistry.WebhooksClientUpdateResponse{ + // Webhook: &armcontainerregistry.Webhook{ + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/webhooks/myWebhook"), + // Name: to.Ptr("myWebhook"), + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/webhooks"), + // Location: to.Ptr("westus"), + // Tags: map[string]*string{ + // "key": to.Ptr("value"), + // }, + // Properties: &armcontainerregistry.WebhookProperties{ + // Status: to.Ptr(armcontainerregistry.WebhookStatusEnabled), + // Scope: to.Ptr("myRepository"), + // Actions: []*armcontainerregistry.WebhookAction{ + // to.Ptr(armcontainerregistry.WebhookActionPush), + // }, + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // }, + // }, // } }