diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/CHANGELOG.md b/sdk/resourcemanager/containerregistry/armcontainerregistry/CHANGELOG.md index 279da452a3d0..91e64ff2129f 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/CHANGELOG.md +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/CHANGELOG.md @@ -1,5 +1,111 @@ # Release History +## 1.3.0-beta.1 (2023-11-24) +### Features Added + +- New enum type `ActivationStatus` with values `ActivationStatusActive`, `ActivationStatusInactive` +- New enum type `AuditLogStatus` with values `AuditLogStatusDisabled`, `AuditLogStatusEnabled` +- New enum type `AzureADAuthenticationAsArmPolicyStatus` with values `AzureADAuthenticationAsArmPolicyStatusDisabled`, `AzureADAuthenticationAsArmPolicyStatusEnabled` +- New enum type `CertificateType` with values `CertificateTypeLocalDirectory` +- New enum type `ConnectedRegistryMode` with values `ConnectedRegistryModeMirror`, `ConnectedRegistryModeReadOnly`, `ConnectedRegistryModeReadWrite`, `ConnectedRegistryModeRegistry` +- New enum type `ConnectionState` with values `ConnectionStateOffline`, `ConnectionStateOnline`, `ConnectionStateSyncing`, `ConnectionStateUnhealthy` +- New enum type `LogLevel` with values `LogLevelDebug`, `LogLevelError`, `LogLevelInformation`, `LogLevelNone`, `LogLevelWarning` +- New enum type `MetadataSearch` with values `MetadataSearchDisabled`, `MetadataSearchEnabled` +- New enum type `PackageSourceType` with values `PackageSourceTypeRemote` +- New enum type `PipelineOptions` with values `PipelineOptionsContinueOnErrors`, `PipelineOptionsDeleteSourceBlobOnSuccess`, `PipelineOptionsOverwriteBlobs`, `PipelineOptionsOverwriteTags` +- New enum type `PipelineRunSourceType` with values `PipelineRunSourceTypeAzureStorageBlob` +- New enum type `PipelineRunTargetType` with values `PipelineRunTargetTypeAzureStorageBlob` +- New enum type `PipelineSourceType` with values `PipelineSourceTypeAzureStorageBlobContainer` +- New enum type `TLSStatus` with values `TLSStatusDisabled`, `TLSStatusEnabled` +- New function `NewArchiveVersionsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ArchiveVersionsClient, error)` +- New function `*ArchiveVersionsClient.BeginCreate(context.Context, string, string, string, string, string, *ArchiveVersionsClientBeginCreateOptions) (*runtime.Poller[ArchiveVersionsClientCreateResponse], error)` +- New function `*ArchiveVersionsClient.BeginDelete(context.Context, string, string, string, string, string, *ArchiveVersionsClientBeginDeleteOptions) (*runtime.Poller[ArchiveVersionsClientDeleteResponse], error)` +- New function `*ArchiveVersionsClient.Get(context.Context, string, string, string, string, string, *ArchiveVersionsClientGetOptions) (ArchiveVersionsClientGetResponse, error)` +- New function `*ArchiveVersionsClient.NewListPager(string, string, string, string, *ArchiveVersionsClientListOptions) *runtime.Pager[ArchiveVersionsClientListResponse]` +- New function `NewArchivesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ArchivesClient, error)` +- New function `*ArchivesClient.BeginCreate(context.Context, string, string, string, string, Archive, *ArchivesClientBeginCreateOptions) (*runtime.Poller[ArchivesClientCreateResponse], error)` +- New function `*ArchivesClient.BeginDelete(context.Context, string, string, string, string, *ArchivesClientBeginDeleteOptions) (*runtime.Poller[ArchivesClientDeleteResponse], error)` +- New function `*ArchivesClient.Get(context.Context, string, string, string, string, *ArchivesClientGetOptions) (ArchivesClientGetResponse, error)` +- New function `*ArchivesClient.NewListPager(string, string, string, *ArchivesClientListOptions) *runtime.Pager[ArchivesClientListResponse]` +- New function `*ArchivesClient.Update(context.Context, string, string, string, string, ArchiveUpdateParameters, *ArchivesClientUpdateOptions) (ArchivesClientUpdateResponse, error)` +- New function `*ClientFactory.NewArchiveVersionsClient() *ArchiveVersionsClient` +- New function `*ClientFactory.NewArchivesClient() *ArchivesClient` +- New function `*ClientFactory.NewConnectedRegistriesClient() *ConnectedRegistriesClient` +- New function `*ClientFactory.NewExportPipelinesClient() *ExportPipelinesClient` +- New function `*ClientFactory.NewImportPipelinesClient() *ImportPipelinesClient` +- New function `*ClientFactory.NewPipelineRunsClient() *PipelineRunsClient` +- New function `NewConnectedRegistriesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ConnectedRegistriesClient, error)` +- New function `*ConnectedRegistriesClient.BeginCreate(context.Context, string, string, string, ConnectedRegistry, *ConnectedRegistriesClientBeginCreateOptions) (*runtime.Poller[ConnectedRegistriesClientCreateResponse], error)` +- New function `*ConnectedRegistriesClient.BeginDeactivate(context.Context, string, string, string, *ConnectedRegistriesClientBeginDeactivateOptions) (*runtime.Poller[ConnectedRegistriesClientDeactivateResponse], error)` +- New function `*ConnectedRegistriesClient.BeginDelete(context.Context, string, string, string, *ConnectedRegistriesClientBeginDeleteOptions) (*runtime.Poller[ConnectedRegistriesClientDeleteResponse], error)` +- New function `*ConnectedRegistriesClient.Get(context.Context, string, string, string, *ConnectedRegistriesClientGetOptions) (ConnectedRegistriesClientGetResponse, error)` +- New function `*ConnectedRegistriesClient.NewListPager(string, string, *ConnectedRegistriesClientListOptions) *runtime.Pager[ConnectedRegistriesClientListResponse]` +- New function `*ConnectedRegistriesClient.BeginUpdate(context.Context, string, string, string, ConnectedRegistryUpdateParameters, *ConnectedRegistriesClientBeginUpdateOptions) (*runtime.Poller[ConnectedRegistriesClientUpdateResponse], error)` +- New function `NewExportPipelinesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ExportPipelinesClient, error)` +- New function `*ExportPipelinesClient.BeginCreate(context.Context, string, string, string, ExportPipeline, *ExportPipelinesClientBeginCreateOptions) (*runtime.Poller[ExportPipelinesClientCreateResponse], error)` +- New function `*ExportPipelinesClient.BeginDelete(context.Context, string, string, string, *ExportPipelinesClientBeginDeleteOptions) (*runtime.Poller[ExportPipelinesClientDeleteResponse], error)` +- New function `*ExportPipelinesClient.Get(context.Context, string, string, string, *ExportPipelinesClientGetOptions) (ExportPipelinesClientGetResponse, error)` +- New function `*ExportPipelinesClient.NewListPager(string, string, *ExportPipelinesClientListOptions) *runtime.Pager[ExportPipelinesClientListResponse]` +- New function `NewImportPipelinesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ImportPipelinesClient, error)` +- New function `*ImportPipelinesClient.BeginCreate(context.Context, string, string, string, ImportPipeline, *ImportPipelinesClientBeginCreateOptions) (*runtime.Poller[ImportPipelinesClientCreateResponse], error)` +- New function `*ImportPipelinesClient.BeginDelete(context.Context, string, string, string, *ImportPipelinesClientBeginDeleteOptions) (*runtime.Poller[ImportPipelinesClientDeleteResponse], error)` +- New function `*ImportPipelinesClient.Get(context.Context, string, string, string, *ImportPipelinesClientGetOptions) (ImportPipelinesClientGetResponse, error)` +- New function `*ImportPipelinesClient.NewListPager(string, string, *ImportPipelinesClientListOptions) *runtime.Pager[ImportPipelinesClientListResponse]` +- New function `NewPipelineRunsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*PipelineRunsClient, error)` +- New function `*PipelineRunsClient.BeginCreate(context.Context, string, string, string, PipelineRun, *PipelineRunsClientBeginCreateOptions) (*runtime.Poller[PipelineRunsClientCreateResponse], error)` +- New function `*PipelineRunsClient.BeginDelete(context.Context, string, string, string, *PipelineRunsClientBeginDeleteOptions) (*runtime.Poller[PipelineRunsClientDeleteResponse], error)` +- New function `*PipelineRunsClient.Get(context.Context, string, string, string, *PipelineRunsClientGetOptions) (PipelineRunsClientGetResponse, error)` +- New function `*PipelineRunsClient.NewListPager(string, string, *PipelineRunsClientListOptions) *runtime.Pager[PipelineRunsClientListResponse]` +- New struct `ActivationProperties` +- New struct `Archive` +- New struct `ArchiveListResult` +- New struct `ArchivePackageSourceProperties` +- New struct `ArchiveProperties` +- New struct `ArchiveUpdateParameters` +- New struct `ArchiveUpdateProperties` +- New struct `ArchiveVersion` +- New struct `ArchiveVersionListResult` +- New struct `ArchiveVersionProperties` +- New struct `AzureADAuthenticationAsArmPolicy` +- New struct `ConnectedRegistry` +- New struct `ConnectedRegistryListResult` +- New struct `ConnectedRegistryProperties` +- New struct `ConnectedRegistryUpdateParameters` +- New struct `ConnectedRegistryUpdateProperties` +- New struct `ExportPipeline` +- New struct `ExportPipelineListResult` +- New struct `ExportPipelineProperties` +- New struct `ExportPipelineTargetProperties` +- New struct `ImportPipeline` +- New struct `ImportPipelineListResult` +- New struct `ImportPipelineProperties` +- New struct `ImportPipelineSourceProperties` +- New struct `LoggingProperties` +- New struct `LoginServerProperties` +- New struct `ParentProperties` +- New struct `PipelineRun` +- New struct `PipelineRunListResult` +- New struct `PipelineRunProperties` +- New struct `PipelineRunRequest` +- New struct `PipelineRunResponse` +- New struct `PipelineRunSourceProperties` +- New struct `PipelineRunTargetProperties` +- New struct `PipelineSourceTriggerDescriptor` +- New struct `PipelineSourceTriggerProperties` +- New struct `PipelineTriggerDescriptor` +- New struct `PipelineTriggerProperties` +- New struct `ProgressProperties` +- New struct `SoftDeletePolicy` +- New struct `StatusDetailProperties` +- New struct `SyncProperties` +- New struct `SyncUpdateProperties` +- New struct `TLSCertificateProperties` +- New struct `TLSProperties` +- New field `AzureADAuthenticationAsArmPolicy`, `SoftDeletePolicy` in struct `Policies` +- New field `AnonymousPullEnabled`, `MetadataSearch` in struct `RegistryProperties` +- New field `AnonymousPullEnabled`, `MetadataSearch` in struct `RegistryPropertiesUpdateParameters` + + ## 1.2.0 (2023-11-24) ### Features Added diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/agentpools_client_example_test.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/agentpools_client_example_test.go index b17a83e2dc77..901505993ff2 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/agentpools_client_example_test.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/agentpools_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsGet.json func ExampleAgentPoolsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -50,7 +50,7 @@ func ExampleAgentPoolsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsCreate.json func ExampleAgentPoolsClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -96,7 +96,7 @@ func ExampleAgentPoolsClient_BeginCreate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsDelete.json func ExampleAgentPoolsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -117,7 +117,7 @@ func ExampleAgentPoolsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsUpdate.json func ExampleAgentPoolsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -157,7 +157,7 @@ func ExampleAgentPoolsClient_BeginUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsList.json func ExampleAgentPoolsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -197,7 +197,7 @@ func ExampleAgentPoolsClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsGetQueueStatus.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsGetQueueStatus.json func ExampleAgentPoolsClient_GetQueueStatus() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/archives_client.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/archives_client.go new file mode 100644 index 000000000000..40b9f1329ba9 --- /dev/null +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/archives_client.go @@ -0,0 +1,441 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. 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" +) + +// ArchivesClient contains the methods for the Archives group. +// Don't use this type directly, use NewArchivesClient() instead. +type ArchivesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewArchivesClient creates a new instance of ArchivesClient 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 - pass nil to accept the default values. +func NewArchivesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ArchivesClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ArchivesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreate - Creates a archive for a container registry with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - The name of the container registry. +// - packageType - The type of the package resource. +// - archiveName - The name of the archive resource. +// - archiveCreateParameters - The parameters for creating a archive. +// - options - ArchivesClientBeginCreateOptions contains the optional parameters for the ArchivesClient.BeginCreate method. +func (client *ArchivesClient) BeginCreate(ctx context.Context, resourceGroupName string, registryName string, packageType string, archiveName string, archiveCreateParameters Archive, options *ArchivesClientBeginCreateOptions) (*runtime.Poller[ArchivesClientCreateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.create(ctx, resourceGroupName, registryName, packageType, archiveName, archiveCreateParameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ArchivesClientCreateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ArchivesClientCreateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Create - Creates a archive for a container registry with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-11-01-preview +func (client *ArchivesClient) create(ctx context.Context, resourceGroupName string, registryName string, packageType string, archiveName string, archiveCreateParameters Archive, options *ArchivesClientBeginCreateOptions) (*http.Response, error) { + var err error + const operationName = "ArchivesClient.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, packageType, archiveName, archiveCreateParameters, 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 *ArchivesClient) createCreateRequest(ctx context.Context, resourceGroupName string, registryName string, packageType string, archiveName string, archiveCreateParameters Archive, options *ArchivesClientBeginCreateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}" + 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 packageType == "" { + return nil, errors.New("parameter packageType cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{packageType}", url.PathEscape(packageType)) + if archiveName == "" { + return nil, errors.New("parameter archiveName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{archiveName}", url.PathEscape(archiveName)) + 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", "2023-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, archiveCreateParameters); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Deletes a archive from a container registry. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - The name of the container registry. +// - packageType - The type of the package resource. +// - archiveName - The name of the archive resource. +// - options - ArchivesClientBeginDeleteOptions contains the optional parameters for the ArchivesClient.BeginDelete method. +func (client *ArchivesClient) BeginDelete(ctx context.Context, resourceGroupName string, registryName string, packageType string, archiveName string, options *ArchivesClientBeginDeleteOptions) (*runtime.Poller[ArchivesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, registryName, packageType, archiveName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ArchivesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ArchivesClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Deletes a archive from a container registry. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-11-01-preview +func (client *ArchivesClient) deleteOperation(ctx context.Context, resourceGroupName string, registryName string, packageType string, archiveName string, options *ArchivesClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "ArchivesClient.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, packageType, archiveName, 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 *ArchivesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, registryName string, packageType string, archiveName string, options *ArchivesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}" + 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 packageType == "" { + return nil, errors.New("parameter packageType cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{packageType}", url.PathEscape(packageType)) + if archiveName == "" { + return nil, errors.New("parameter archiveName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{archiveName}", url.PathEscape(archiveName)) + 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", "2023-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the properties of the archive. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - The name of the container registry. +// - packageType - The type of the package resource. +// - archiveName - The name of the archive resource. +// - options - ArchivesClientGetOptions contains the optional parameters for the ArchivesClient.Get method. +func (client *ArchivesClient) Get(ctx context.Context, resourceGroupName string, registryName string, packageType string, archiveName string, options *ArchivesClientGetOptions) (ArchivesClientGetResponse, error) { + var err error + const operationName = "ArchivesClient.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, packageType, archiveName, options) + if err != nil { + return ArchivesClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ArchivesClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ArchivesClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *ArchivesClient) getCreateRequest(ctx context.Context, resourceGroupName string, registryName string, packageType string, archiveName string, options *ArchivesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}" + 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 packageType == "" { + return nil, errors.New("parameter packageType cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{packageType}", url.PathEscape(packageType)) + if archiveName == "" { + return nil, errors.New("parameter archiveName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{archiveName}", url.PathEscape(archiveName)) + 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", "2023-11-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 *ArchivesClient) getHandleResponse(resp *http.Response) (ArchivesClientGetResponse, error) { + result := ArchivesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Archive); err != nil { + return ArchivesClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Lists all archives for the specified container registry and package type. +// +// Generated from API version 2023-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - The name of the container registry. +// - packageType - The type of the package resource. +// - options - ArchivesClientListOptions contains the optional parameters for the ArchivesClient.NewListPager method. +func (client *ArchivesClient) NewListPager(resourceGroupName string, registryName string, packageType string, options *ArchivesClientListOptions) *runtime.Pager[ArchivesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ArchivesClientListResponse]{ + More: func(page ArchivesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ArchivesClientListResponse) (ArchivesClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ArchivesClient.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, packageType, options) + }, nil) + if err != nil { + return ArchivesClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *ArchivesClient) listCreateRequest(ctx context.Context, resourceGroupName string, registryName string, packageType string, options *ArchivesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives" + 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 packageType == "" { + return nil, errors.New("parameter packageType cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{packageType}", url.PathEscape(packageType)) + 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", "2023-11-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 *ArchivesClient) listHandleResponse(resp *http.Response) (ArchivesClientListResponse, error) { + result := ArchivesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ArchiveListResult); err != nil { + return ArchivesClientListResponse{}, err + } + return result, nil +} + +// Update - Updates a archive for a container registry with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - The name of the container registry. +// - packageType - The type of the package resource. +// - archiveName - The name of the archive resource. +// - archiveUpdateParameters - The parameters for updating a archive. +// - options - ArchivesClientUpdateOptions contains the optional parameters for the ArchivesClient.Update method. +func (client *ArchivesClient) Update(ctx context.Context, resourceGroupName string, registryName string, packageType string, archiveName string, archiveUpdateParameters ArchiveUpdateParameters, options *ArchivesClientUpdateOptions) (ArchivesClientUpdateResponse, error) { + var err error + const operationName = "ArchivesClient.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, packageType, archiveName, archiveUpdateParameters, options) + if err != nil { + return ArchivesClientUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ArchivesClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ArchivesClientUpdateResponse{}, err + } + resp, err := client.updateHandleResponse(httpResp) + return resp, err +} + +// updateCreateRequest creates the Update request. +func (client *ArchivesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, registryName string, packageType string, archiveName string, archiveUpdateParameters ArchiveUpdateParameters, options *ArchivesClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}" + 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 packageType == "" { + return nil, errors.New("parameter packageType cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{packageType}", url.PathEscape(packageType)) + if archiveName == "" { + return nil, errors.New("parameter archiveName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{archiveName}", url.PathEscape(archiveName)) + 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", "2023-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, archiveUpdateParameters); err != nil { + return nil, err + } + return req, nil +} + +// updateHandleResponse handles the Update response. +func (client *ArchivesClient) updateHandleResponse(resp *http.Response) (ArchivesClientUpdateResponse, error) { + result := ArchivesClientUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Archive); err != nil { + return ArchivesClientUpdateResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/archives_client_example_test.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/archives_client_example_test.go new file mode 100644 index 000000000000..620a1f316061 --- /dev/null +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/archives_client_example_test.go @@ -0,0 +1,225 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// 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" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ArchiveList.json +func ExampleArchivesClient_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.NewArchivesClient().NewListPager("myResourceGroup", "myRegistry", "myPackageType", 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.ArchiveListResult = armcontainerregistry.ArchiveListResult{ + // Value: []*armcontainerregistry.Archive{ + // { + // Name: to.Ptr("string"), + // Type: to.Ptr("string"), + // ID: to.Ptr("string"), + // SystemData: &armcontainerregistry.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-24T00:22:47.311Z"); return t}()), + // CreatedBy: to.Ptr("string"), + // CreatedByType: to.Ptr(armcontainerregistry.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-24T00:22:47.311Z"); return t}()), + // LastModifiedBy: to.Ptr("string"), + // LastModifiedByType: to.Ptr(armcontainerregistry.LastModifiedByTypeUser), + // }, + // Properties: &armcontainerregistry.ArchiveProperties{ + // PackageSource: &armcontainerregistry.ArchivePackageSourceProperties{ + // Type: to.Ptr(armcontainerregistry.PackageSourceType("string")), + // URL: to.Ptr("string"), + // }, + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // PublishedVersion: to.Ptr("string"), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ArchiveGet.json +func ExampleArchivesClient_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.NewArchivesClient().Get(ctx, "myResourceGroup", "myRegistry", "myPackageType", "myArchiveName", 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.Archive = armcontainerregistry.Archive{ + // Name: to.Ptr("myArchiveName"), + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/packages/archives"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/packages/myPackageType/archives/myArchiveName"), + // SystemData: &armcontainerregistry.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-24T00:13:46.836Z"); return t}()), + // CreatedBy: to.Ptr("string"), + // CreatedByType: to.Ptr(armcontainerregistry.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-24T00:13:46.836Z"); return t}()), + // LastModifiedBy: to.Ptr("string"), + // LastModifiedByType: to.Ptr(armcontainerregistry.LastModifiedByTypeUser), + // }, + // Properties: &armcontainerregistry.ArchiveProperties{ + // PackageSource: &armcontainerregistry.ArchivePackageSourceProperties{ + // Type: to.Ptr(armcontainerregistry.PackageSourceType("string")), + // URL: to.Ptr("string"), + // }, + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // PublishedVersion: to.Ptr("string"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ArchiveCreate.json +func ExampleArchivesClient_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) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewArchivesClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", "rpm", "myArchiveName", armcontainerregistry.Archive{ + Properties: &armcontainerregistry.ArchiveProperties{ + PackageSource: &armcontainerregistry.ArchivePackageSourceProperties{ + Type: to.Ptr(armcontainerregistry.PackageSourceTypeRemote), + URL: to.Ptr("string"), + }, + PublishedVersion: to.Ptr("string"), + RepositoryEndpointPrefix: to.Ptr("string"), + }, + }, 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.Archive = armcontainerregistry.Archive{ + // Name: to.Ptr("myArchiveName"), + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/archives"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/packages/rpm/archives/myArchiveName"), + // Properties: &armcontainerregistry.ArchiveProperties{ + // PackageSource: &armcontainerregistry.ArchivePackageSourceProperties{ + // Type: to.Ptr(armcontainerregistry.PackageSourceTypeRemote), + // URL: to.Ptr("string"), + // }, + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // PublishedVersion: to.Ptr("string"), + // RepositoryEndpoint: to.Ptr("string"), + // RepositoryEndpointPrefix: to.Ptr("string"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ArchiveDelete.json +func ExampleArchivesClient_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.NewArchivesClient().BeginDelete(ctx, "myResourceGroup", "myRegistry", "myPackageType", "myArchiveName", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ArchiveUpdate.json +func ExampleArchivesClient_Update() { + 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.NewArchivesClient().Update(ctx, "myResourceGroup", "myRegistry", "myPackageType", "myArchiveName", armcontainerregistry.ArchiveUpdateParameters{ + Properties: &armcontainerregistry.ArchiveUpdateProperties{ + PublishedVersion: to.Ptr("string"), + }, + }, 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.Archive = armcontainerregistry.Archive{ + // Name: to.Ptr("myArchiveName"), + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/packages/archives"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/packages/myPackageType/archives/myArchiveName"), + // SystemData: &armcontainerregistry.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T23:41:38.720Z"); return t}()), + // CreatedBy: to.Ptr("string"), + // CreatedByType: to.Ptr(armcontainerregistry.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T23:41:38.720Z"); return t}()), + // LastModifiedBy: to.Ptr("string"), + // LastModifiedByType: to.Ptr(armcontainerregistry.LastModifiedByTypeUser), + // }, + // Properties: &armcontainerregistry.ArchiveProperties{ + // PackageSource: &armcontainerregistry.ArchivePackageSourceProperties{ + // Type: to.Ptr(armcontainerregistry.PackageSourceTypeRemote), + // URL: to.Ptr("string"), + // }, + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // PublishedVersion: to.Ptr("string"), + // RepositoryEndpoint: to.Ptr("string"), + // RepositoryEndpointPrefix: to.Ptr("string"), + // }, + // } +} diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/archiveversions_client.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/archiveversions_client.go new file mode 100644 index 000000000000..a603035b4de3 --- /dev/null +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/archiveversions_client.go @@ -0,0 +1,382 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. 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" +) + +// ArchiveVersionsClient contains the methods for the ArchiveVersions group. +// Don't use this type directly, use NewArchiveVersionsClient() instead. +type ArchiveVersionsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewArchiveVersionsClient creates a new instance of ArchiveVersionsClient 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 - pass nil to accept the default values. +func NewArchiveVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ArchiveVersionsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ArchiveVersionsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreate - Creates a archive for a container registry with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - The name of the container registry. +// - packageType - The type of the package resource. +// - archiveName - The name of the archive resource. +// - archiveVersionName - The name of the archive version resource. +// - options - ArchiveVersionsClientBeginCreateOptions contains the optional parameters for the ArchiveVersionsClient.BeginCreate +// method. +func (client *ArchiveVersionsClient) BeginCreate(ctx context.Context, resourceGroupName string, registryName string, packageType string, archiveName string, archiveVersionName string, options *ArchiveVersionsClientBeginCreateOptions) (*runtime.Poller[ArchiveVersionsClientCreateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.create(ctx, resourceGroupName, registryName, packageType, archiveName, archiveVersionName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ArchiveVersionsClientCreateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ArchiveVersionsClientCreateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Create - Creates a archive for a container registry with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-11-01-preview +func (client *ArchiveVersionsClient) create(ctx context.Context, resourceGroupName string, registryName string, packageType string, archiveName string, archiveVersionName string, options *ArchiveVersionsClientBeginCreateOptions) (*http.Response, error) { + var err error + const operationName = "ArchiveVersionsClient.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, packageType, archiveName, archiveVersionName, 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 *ArchiveVersionsClient) createCreateRequest(ctx context.Context, resourceGroupName string, registryName string, packageType string, archiveName string, archiveVersionName string, options *ArchiveVersionsClientBeginCreateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions/{archiveVersionName}" + 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 packageType == "" { + return nil, errors.New("parameter packageType cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{packageType}", url.PathEscape(packageType)) + if archiveName == "" { + return nil, errors.New("parameter archiveName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{archiveName}", url.PathEscape(archiveName)) + if archiveVersionName == "" { + return nil, errors.New("parameter archiveVersionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{archiveVersionName}", url.PathEscape(archiveVersionName)) + 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", "2023-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginDelete - Deletes a archive version from a container registry. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - The name of the container registry. +// - packageType - The type of the package resource. +// - archiveName - The name of the archive resource. +// - archiveVersionName - The name of the archive version resource. +// - options - ArchiveVersionsClientBeginDeleteOptions contains the optional parameters for the ArchiveVersionsClient.BeginDelete +// method. +func (client *ArchiveVersionsClient) BeginDelete(ctx context.Context, resourceGroupName string, registryName string, packageType string, archiveName string, archiveVersionName string, options *ArchiveVersionsClientBeginDeleteOptions) (*runtime.Poller[ArchiveVersionsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, registryName, packageType, archiveName, archiveVersionName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ArchiveVersionsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ArchiveVersionsClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Deletes a archive version from a container registry. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-11-01-preview +func (client *ArchiveVersionsClient) deleteOperation(ctx context.Context, resourceGroupName string, registryName string, packageType string, archiveName string, archiveVersionName string, options *ArchiveVersionsClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "ArchiveVersionsClient.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, packageType, archiveName, archiveVersionName, 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 *ArchiveVersionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, registryName string, packageType string, archiveName string, archiveVersionName string, options *ArchiveVersionsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions/{archiveVersionName}" + 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 packageType == "" { + return nil, errors.New("parameter packageType cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{packageType}", url.PathEscape(packageType)) + if archiveName == "" { + return nil, errors.New("parameter archiveName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{archiveName}", url.PathEscape(archiveName)) + if archiveVersionName == "" { + return nil, errors.New("parameter archiveVersionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{archiveVersionName}", url.PathEscape(archiveVersionName)) + 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", "2023-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the properties of the archive version. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - The name of the container registry. +// - packageType - The type of the package resource. +// - archiveName - The name of the archive resource. +// - archiveVersionName - The name of the archive version resource. +// - options - ArchiveVersionsClientGetOptions contains the optional parameters for the ArchiveVersionsClient.Get method. +func (client *ArchiveVersionsClient) Get(ctx context.Context, resourceGroupName string, registryName string, packageType string, archiveName string, archiveVersionName string, options *ArchiveVersionsClientGetOptions) (ArchiveVersionsClientGetResponse, error) { + var err error + const operationName = "ArchiveVersionsClient.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, packageType, archiveName, archiveVersionName, options) + if err != nil { + return ArchiveVersionsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ArchiveVersionsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ArchiveVersionsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *ArchiveVersionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, registryName string, packageType string, archiveName string, archiveVersionName string, options *ArchiveVersionsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions/{archiveVersionName}" + 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 packageType == "" { + return nil, errors.New("parameter packageType cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{packageType}", url.PathEscape(packageType)) + if archiveName == "" { + return nil, errors.New("parameter archiveName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{archiveName}", url.PathEscape(archiveName)) + if archiveVersionName == "" { + return nil, errors.New("parameter archiveVersionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{archiveVersionName}", url.PathEscape(archiveVersionName)) + 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", "2023-11-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 *ArchiveVersionsClient) getHandleResponse(resp *http.Response) (ArchiveVersionsClientGetResponse, error) { + result := ArchiveVersionsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ArchiveVersion); err != nil { + return ArchiveVersionsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Lists all archive versions for the specified container registry, repository type and archive name. +// +// Generated from API version 2023-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - The name of the container registry. +// - packageType - The type of the package resource. +// - archiveName - The name of the archive resource. +// - options - ArchiveVersionsClientListOptions contains the optional parameters for the ArchiveVersionsClient.NewListPager +// method. +func (client *ArchiveVersionsClient) NewListPager(resourceGroupName string, registryName string, packageType string, archiveName string, options *ArchiveVersionsClientListOptions) *runtime.Pager[ArchiveVersionsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ArchiveVersionsClientListResponse]{ + More: func(page ArchiveVersionsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ArchiveVersionsClientListResponse) (ArchiveVersionsClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ArchiveVersionsClient.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, packageType, archiveName, options) + }, nil) + if err != nil { + return ArchiveVersionsClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *ArchiveVersionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, registryName string, packageType string, archiveName string, options *ArchiveVersionsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/packages/{packageType}/archives/{archiveName}/versions" + 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 packageType == "" { + return nil, errors.New("parameter packageType cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{packageType}", url.PathEscape(packageType)) + if archiveName == "" { + return nil, errors.New("parameter archiveName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{archiveName}", url.PathEscape(archiveName)) + 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", "2023-11-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 *ArchiveVersionsClient) listHandleResponse(resp *http.Response) (ArchiveVersionsClientListResponse, error) { + result := ArchiveVersionsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ArchiveVersionListResult); err != nil { + return ArchiveVersionsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/archiveversions_client_example_test.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/archiveversions_client_example_test.go new file mode 100644 index 000000000000..c4310e35a48c --- /dev/null +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/archiveversions_client_example_test.go @@ -0,0 +1,153 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// 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" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ArchiveVersionList.json +func ExampleArchiveVersionsClient_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.NewArchiveVersionsClient().NewListPager("myResourceGroup", "myRegistry", "myPackageType", "myArchiveName", 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.ArchiveVersionListResult = armcontainerregistry.ArchiveVersionListResult{ + // Value: []*armcontainerregistry.ArchiveVersion{ + // { + // Name: to.Ptr("string"), + // Type: to.Ptr("string"), + // ID: to.Ptr("string"), + // SystemData: &armcontainerregistry.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-24T00:22:47.311Z"); return t}()), + // CreatedBy: to.Ptr("string"), + // CreatedByType: to.Ptr(armcontainerregistry.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-24T00:22:47.311Z"); return t}()), + // LastModifiedBy: to.Ptr("string"), + // LastModifiedByType: to.Ptr(armcontainerregistry.LastModifiedByTypeUser), + // }, + // Properties: &armcontainerregistry.ArchiveVersionProperties{ + // ArchiveVersionErrorMessage: to.Ptr("string"), + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ArchiveVersionGet.json +func ExampleArchiveVersionsClient_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.NewArchiveVersionsClient().Get(ctx, "myResourceGroup", "myRegistry", "rpm", "myArchiveName", "myArchiveVersionName", 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.ArchiveVersion = armcontainerregistry.ArchiveVersion{ + // Name: to.Ptr("myArchiveName"), + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/packages/archives"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/packages/rpm/archives/myArchiveName/versions/myArchiveVersionName"), + // SystemData: &armcontainerregistry.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-24T00:13:46.836Z"); return t}()), + // CreatedBy: to.Ptr("string"), + // CreatedByType: to.Ptr(armcontainerregistry.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-24T00:13:46.836Z"); return t}()), + // LastModifiedBy: to.Ptr("string"), + // LastModifiedByType: to.Ptr(armcontainerregistry.LastModifiedByTypeUser), + // }, + // Properties: &armcontainerregistry.ArchiveVersionProperties{ + // ArchiveVersionErrorMessage: to.Ptr("string"), + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ArchiveVersionCreate.json +func ExampleArchiveVersionsClient_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) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewArchiveVersionsClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", "rpm", "myArchiveName", "myArchiveVersionName", 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.ArchiveVersion = armcontainerregistry.ArchiveVersion{ + // Name: to.Ptr("myArchiveVersionName"), + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/packages/archives/versions"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/packages/rpm/archives/myArchiveName/versions/myArchiveVersionName"), + // Properties: &armcontainerregistry.ArchiveVersionProperties{ + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ArchiveVersionDelete.json +func ExampleArchiveVersionsClient_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.NewArchiveVersionsClient().BeginDelete(ctx, "myResourceGroup", "myRegistry", "myPackageType", "myArchiveName", "myArchiveVersionName", 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/assets.json b/sdk/resourcemanager/containerregistry/armcontainerregistry/assets.json index 545db436e6f9..951f2c0bad20 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/assets.json +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "go", "TagPrefix": "go/resourcemanager/containerregistry/armcontainerregistry", - "Tag": "go/resourcemanager/containerregistry/armcontainerregistry_9fcf492e3c" + "Tag": "go/resourcemanager/containerregistry/armcontainerregistry_25cb23de01" } diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/autorest.md b/sdk/resourcemanager/containerregistry/armcontainerregistry/autorest.md index 726e7154a54a..2d363eaf698c 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/autorest.md +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.2.0 -tag: package-2023-07 +module-version: 1.3.0-beta.1 +tag: package-2023-11-preview ``` diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/cacherules_client.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/cacherules_client.go index 21ac29dfd275..0bd22b4600fd 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/cacherules_client.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/cacherules_client.go @@ -46,7 +46,7 @@ func NewCacheRulesClient(subscriptionID string, credential azcore.TokenCredentia // BeginCreate - Creates a cache rule for a container registry with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - registryName - The name of the container registry. // - cacheRuleName - The name of the cache rule. @@ -73,7 +73,7 @@ func (client *CacheRulesClient) BeginCreate(ctx context.Context, resourceGroupNa // Create - Creates a cache rule for a container registry with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview func (client *CacheRulesClient) create(ctx context.Context, resourceGroupName string, registryName string, cacheRuleName string, cacheRuleCreateParameters CacheRule, options *CacheRulesClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "CacheRulesClient.BeginCreate" @@ -119,7 +119,7 @@ func (client *CacheRulesClient) createCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, cacheRuleCreateParameters); err != nil { @@ -131,7 +131,7 @@ func (client *CacheRulesClient) createCreateRequest(ctx context.Context, resourc // BeginDelete - Deletes a cache rule resource from a container registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - registryName - The name of the container registry. // - cacheRuleName - The name of the cache rule. @@ -157,7 +157,7 @@ func (client *CacheRulesClient) BeginDelete(ctx context.Context, resourceGroupNa // Delete - Deletes a cache rule resource from a container registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview func (client *CacheRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, registryName string, cacheRuleName string, options *CacheRulesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "CacheRulesClient.BeginDelete" @@ -203,7 +203,7 @@ func (client *CacheRulesClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -212,7 +212,7 @@ func (client *CacheRulesClient) deleteCreateRequest(ctx context.Context, resourc // Get - Gets the properties of the specified cache rule resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - registryName - The name of the container registry. // - cacheRuleName - The name of the cache rule. @@ -263,7 +263,7 @@ func (client *CacheRulesClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -280,7 +280,7 @@ func (client *CacheRulesClient) getHandleResponse(resp *http.Response) (CacheRul // NewListPager - Lists all cache rule resources for the specified container registry. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - registryName - The name of the container registry. // - options - CacheRulesClientListOptions contains the optional parameters for the CacheRulesClient.NewListPager method. @@ -327,7 +327,7 @@ func (client *CacheRulesClient) listCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -345,7 +345,7 @@ func (client *CacheRulesClient) listHandleResponse(resp *http.Response) (CacheRu // BeginUpdate - Updates a cache rule for a container registry with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - registryName - The name of the container registry. // - cacheRuleName - The name of the cache rule. @@ -372,7 +372,7 @@ func (client *CacheRulesClient) BeginUpdate(ctx context.Context, resourceGroupNa // Update - Updates a cache rule for a container registry with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview func (client *CacheRulesClient) update(ctx context.Context, resourceGroupName string, registryName string, cacheRuleName string, cacheRuleUpdateParameters CacheRuleUpdateParameters, options *CacheRulesClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "CacheRulesClient.BeginUpdate" @@ -418,7 +418,7 @@ func (client *CacheRulesClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, cacheRuleUpdateParameters); err != nil { diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/cacherules_client_example_test.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/cacherules_client_example_test.go index 9140581fa1be..02c26ef8a773 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/cacherules_client_example_test.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/cacherules_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/CacheRuleList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/CacheRuleList.json func ExampleCacheRulesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -58,7 +58,7 @@ func ExampleCacheRulesClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/CacheRuleGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/CacheRuleGet.json func ExampleCacheRulesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -90,7 +90,7 @@ func ExampleCacheRulesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/CacheRuleCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/CacheRuleCreate.json func ExampleCacheRulesClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -132,7 +132,7 @@ func ExampleCacheRulesClient_BeginCreate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/CacheRuleDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/CacheRuleDelete.json func ExampleCacheRulesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -153,7 +153,7 @@ func ExampleCacheRulesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/CacheRuleUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/CacheRuleUpdate.json func ExampleCacheRulesClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/client_factory.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/client_factory.go index 1444ae659cef..d536b4042aa8 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/client_factory.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/client_factory.go @@ -43,24 +43,60 @@ func (c *ClientFactory) NewAgentPoolsClient() *AgentPoolsClient { return subClient } +// NewArchiveVersionsClient creates a new instance of ArchiveVersionsClient. +func (c *ClientFactory) NewArchiveVersionsClient() *ArchiveVersionsClient { + subClient, _ := NewArchiveVersionsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +// NewArchivesClient creates a new instance of ArchivesClient. +func (c *ClientFactory) NewArchivesClient() *ArchivesClient { + subClient, _ := NewArchivesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + // NewCacheRulesClient creates a new instance of CacheRulesClient. func (c *ClientFactory) NewCacheRulesClient() *CacheRulesClient { subClient, _ := NewCacheRulesClient(c.subscriptionID, c.credential, c.options) return subClient } +// NewConnectedRegistriesClient creates a new instance of ConnectedRegistriesClient. +func (c *ClientFactory) NewConnectedRegistriesClient() *ConnectedRegistriesClient { + subClient, _ := NewConnectedRegistriesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + // NewCredentialSetsClient creates a new instance of CredentialSetsClient. func (c *ClientFactory) NewCredentialSetsClient() *CredentialSetsClient { subClient, _ := NewCredentialSetsClient(c.subscriptionID, c.credential, c.options) return subClient } +// NewExportPipelinesClient creates a new instance of ExportPipelinesClient. +func (c *ClientFactory) NewExportPipelinesClient() *ExportPipelinesClient { + subClient, _ := NewExportPipelinesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +// NewImportPipelinesClient creates a new instance of ImportPipelinesClient. +func (c *ClientFactory) NewImportPipelinesClient() *ImportPipelinesClient { + subClient, _ := NewImportPipelinesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + // NewOperationsClient creates a new instance of OperationsClient. func (c *ClientFactory) NewOperationsClient() *OperationsClient { subClient, _ := NewOperationsClient(c.credential, c.options) return subClient } +// NewPipelineRunsClient creates a new instance of PipelineRunsClient. +func (c *ClientFactory) NewPipelineRunsClient() *PipelineRunsClient { + subClient, _ := NewPipelineRunsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + // NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient. func (c *ClientFactory) NewPrivateEndpointConnectionsClient() *PrivateEndpointConnectionsClient { subClient, _ := NewPrivateEndpointConnectionsClient(c.subscriptionID, c.credential, c.options) diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/connectedregistries_client.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/connectedregistries_client.go new file mode 100644 index 000000000000..c419731d29b7 --- /dev/null +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/connectedregistries_client.go @@ -0,0 +1,517 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. 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" +) + +// ConnectedRegistriesClient contains the methods for the ConnectedRegistries group. +// Don't use this type directly, use NewConnectedRegistriesClient() instead. +type ConnectedRegistriesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewConnectedRegistriesClient creates a new instance of ConnectedRegistriesClient 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 - pass nil to accept the default values. +func NewConnectedRegistriesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConnectedRegistriesClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ConnectedRegistriesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreate - Creates a connected registry for a container registry with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - The name of the container registry. +// - connectedRegistryName - The name of the connected registry. +// - connectedRegistryCreateParameters - The parameters for creating a connectedRegistry. +// - options - ConnectedRegistriesClientBeginCreateOptions contains the optional parameters for the ConnectedRegistriesClient.BeginCreate +// method. +func (client *ConnectedRegistriesClient) BeginCreate(ctx context.Context, resourceGroupName string, registryName string, connectedRegistryName string, connectedRegistryCreateParameters ConnectedRegistry, options *ConnectedRegistriesClientBeginCreateOptions) (*runtime.Poller[ConnectedRegistriesClientCreateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.create(ctx, resourceGroupName, registryName, connectedRegistryName, connectedRegistryCreateParameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ConnectedRegistriesClientCreateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ConnectedRegistriesClientCreateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Create - Creates a connected registry for a container registry with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-11-01-preview +func (client *ConnectedRegistriesClient) create(ctx context.Context, resourceGroupName string, registryName string, connectedRegistryName string, connectedRegistryCreateParameters ConnectedRegistry, options *ConnectedRegistriesClientBeginCreateOptions) (*http.Response, error) { + var err error + const operationName = "ConnectedRegistriesClient.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, connectedRegistryName, connectedRegistryCreateParameters, 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 *ConnectedRegistriesClient) createCreateRequest(ctx context.Context, resourceGroupName string, registryName string, connectedRegistryName string, connectedRegistryCreateParameters ConnectedRegistry, options *ConnectedRegistriesClientBeginCreateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName}" + 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 connectedRegistryName == "" { + return nil, errors.New("parameter connectedRegistryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{connectedRegistryName}", url.PathEscape(connectedRegistryName)) + 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", "2023-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, connectedRegistryCreateParameters); err != nil { + return nil, err + } + return req, nil +} + +// BeginDeactivate - Deactivates the connected registry instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - The name of the container registry. +// - connectedRegistryName - The name of the connected registry. +// - options - ConnectedRegistriesClientBeginDeactivateOptions contains the optional parameters for the ConnectedRegistriesClient.BeginDeactivate +// method. +func (client *ConnectedRegistriesClient) BeginDeactivate(ctx context.Context, resourceGroupName string, registryName string, connectedRegistryName string, options *ConnectedRegistriesClientBeginDeactivateOptions) (*runtime.Poller[ConnectedRegistriesClientDeactivateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deactivate(ctx, resourceGroupName, registryName, connectedRegistryName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ConnectedRegistriesClientDeactivateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ConnectedRegistriesClientDeactivateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Deactivate - Deactivates the connected registry instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-11-01-preview +func (client *ConnectedRegistriesClient) deactivate(ctx context.Context, resourceGroupName string, registryName string, connectedRegistryName string, options *ConnectedRegistriesClientBeginDeactivateOptions) (*http.Response, error) { + var err error + const operationName = "ConnectedRegistriesClient.BeginDeactivate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deactivateCreateRequest(ctx, resourceGroupName, registryName, connectedRegistryName, 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.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deactivateCreateRequest creates the Deactivate request. +func (client *ConnectedRegistriesClient) deactivateCreateRequest(ctx context.Context, resourceGroupName string, registryName string, connectedRegistryName string, options *ConnectedRegistriesClientBeginDeactivateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName}/deactivate" + 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 connectedRegistryName == "" { + return nil, errors.New("parameter connectedRegistryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{connectedRegistryName}", url.PathEscape(connectedRegistryName)) + 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", "2023-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginDelete - Deletes a connected registry from a container registry. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - The name of the container registry. +// - connectedRegistryName - The name of the connected registry. +// - options - ConnectedRegistriesClientBeginDeleteOptions contains the optional parameters for the ConnectedRegistriesClient.BeginDelete +// method. +func (client *ConnectedRegistriesClient) BeginDelete(ctx context.Context, resourceGroupName string, registryName string, connectedRegistryName string, options *ConnectedRegistriesClientBeginDeleteOptions) (*runtime.Poller[ConnectedRegistriesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, registryName, connectedRegistryName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ConnectedRegistriesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ConnectedRegistriesClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Deletes a connected registry from a container registry. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-11-01-preview +func (client *ConnectedRegistriesClient) deleteOperation(ctx context.Context, resourceGroupName string, registryName string, connectedRegistryName string, options *ConnectedRegistriesClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "ConnectedRegistriesClient.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, connectedRegistryName, 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.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ConnectedRegistriesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, registryName string, connectedRegistryName string, options *ConnectedRegistriesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName}" + 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 connectedRegistryName == "" { + return nil, errors.New("parameter connectedRegistryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{connectedRegistryName}", url.PathEscape(connectedRegistryName)) + 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", "2023-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the properties of the connected registry. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - The name of the container registry. +// - connectedRegistryName - The name of the connected registry. +// - options - ConnectedRegistriesClientGetOptions contains the optional parameters for the ConnectedRegistriesClient.Get method. +func (client *ConnectedRegistriesClient) Get(ctx context.Context, resourceGroupName string, registryName string, connectedRegistryName string, options *ConnectedRegistriesClientGetOptions) (ConnectedRegistriesClientGetResponse, error) { + var err error + const operationName = "ConnectedRegistriesClient.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, connectedRegistryName, options) + if err != nil { + return ConnectedRegistriesClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ConnectedRegistriesClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ConnectedRegistriesClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *ConnectedRegistriesClient) getCreateRequest(ctx context.Context, resourceGroupName string, registryName string, connectedRegistryName string, options *ConnectedRegistriesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName}" + 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 connectedRegistryName == "" { + return nil, errors.New("parameter connectedRegistryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{connectedRegistryName}", url.PathEscape(connectedRegistryName)) + 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", "2023-11-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 *ConnectedRegistriesClient) getHandleResponse(resp *http.Response) (ConnectedRegistriesClientGetResponse, error) { + result := ConnectedRegistriesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ConnectedRegistry); err != nil { + return ConnectedRegistriesClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Lists all connected registries for the specified container registry. +// +// Generated from API version 2023-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - The name of the container registry. +// - options - ConnectedRegistriesClientListOptions contains the optional parameters for the ConnectedRegistriesClient.NewListPager +// method. +func (client *ConnectedRegistriesClient) NewListPager(resourceGroupName string, registryName string, options *ConnectedRegistriesClientListOptions) *runtime.Pager[ConnectedRegistriesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ConnectedRegistriesClientListResponse]{ + More: func(page ConnectedRegistriesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ConnectedRegistriesClientListResponse) (ConnectedRegistriesClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ConnectedRegistriesClient.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 ConnectedRegistriesClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *ConnectedRegistriesClient) listCreateRequest(ctx context.Context, resourceGroupName string, registryName string, options *ConnectedRegistriesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries" + 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", "2023-11-01-preview") + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ConnectedRegistriesClient) listHandleResponse(resp *http.Response) (ConnectedRegistriesClientListResponse, error) { + result := ConnectedRegistriesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ConnectedRegistryListResult); err != nil { + return ConnectedRegistriesClientListResponse{}, err + } + return result, nil +} + +// BeginUpdate - Updates a connected registry with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - The name of the container registry. +// - connectedRegistryName - The name of the connected registry. +// - connectedRegistryUpdateParameters - The parameters for updating a connectedRegistry. +// - options - ConnectedRegistriesClientBeginUpdateOptions contains the optional parameters for the ConnectedRegistriesClient.BeginUpdate +// method. +func (client *ConnectedRegistriesClient) BeginUpdate(ctx context.Context, resourceGroupName string, registryName string, connectedRegistryName string, connectedRegistryUpdateParameters ConnectedRegistryUpdateParameters, options *ConnectedRegistriesClientBeginUpdateOptions) (*runtime.Poller[ConnectedRegistriesClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, registryName, connectedRegistryName, connectedRegistryUpdateParameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ConnectedRegistriesClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ConnectedRegistriesClientUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Update - Updates a connected registry with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-11-01-preview +func (client *ConnectedRegistriesClient) update(ctx context.Context, resourceGroupName string, registryName string, connectedRegistryName string, connectedRegistryUpdateParameters ConnectedRegistryUpdateParameters, options *ConnectedRegistriesClientBeginUpdateOptions) (*http.Response, error) { + var err error + const operationName = "ConnectedRegistriesClient.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, connectedRegistryName, connectedRegistryUpdateParameters, 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 *ConnectedRegistriesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, registryName string, connectedRegistryName string, connectedRegistryUpdateParameters ConnectedRegistryUpdateParameters, options *ConnectedRegistriesClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName}" + 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 connectedRegistryName == "" { + return nil, errors.New("parameter connectedRegistryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{connectedRegistryName}", url.PathEscape(connectedRegistryName)) + 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", "2023-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, connectedRegistryUpdateParameters); err != nil { + return nil, err + } + return req, nil +} diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/connectedregistries_client_example_test.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/connectedregistries_client_example_test.go new file mode 100644 index 000000000000..b6b98b05948e --- /dev/null +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/connectedregistries_client_example_test.go @@ -0,0 +1,302 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// 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" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/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) + 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")}, + // 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/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/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) + 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.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")}, + // 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/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/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) + 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")}, + 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) + 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.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")}, + // 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/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/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) + 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) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/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) + 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")}, + 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) + 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.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")}, + // Logging: &armcontainerregistry.LoggingProperties{ + // AuditLogStatus: to.Ptr(armcontainerregistry.AuditLogStatusEnabled), + // LogLevel: to.Ptr(armcontainerregistry.LogLevelDebug), + // }, + // 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"), + // }, + // }, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/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) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewConnectedRegistriesClient().BeginDeactivate(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) + } +} diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/constants.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/constants.go index 65bc6456a919..76563139c7af 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/constants.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/constants.go @@ -10,7 +10,7 @@ package armcontainerregistry const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry" - moduleVersion = "v1.2.0" + moduleVersion = "v1.3.0-beta.1" ) // Action - The action of IP ACL rule. @@ -43,6 +43,22 @@ func PossibleActionsRequiredValues() []ActionsRequired { } } +// ActivationStatus - The activation status of the connected registry. +type ActivationStatus string + +const ( + ActivationStatusActive ActivationStatus = "Active" + ActivationStatusInactive ActivationStatus = "Inactive" +) + +// PossibleActivationStatusValues returns the possible values for the ActivationStatus const type. +func PossibleActivationStatusValues() []ActivationStatus { + return []ActivationStatus{ + ActivationStatusActive, + ActivationStatusInactive, + } +} + // Architecture - The OS architecture. type Architecture string @@ -65,6 +81,38 @@ func PossibleArchitectureValues() []Architecture { } } +// AuditLogStatus - Indicates whether audit logs are enabled on the connected registry. +type AuditLogStatus string + +const ( + AuditLogStatusDisabled AuditLogStatus = "Disabled" + AuditLogStatusEnabled AuditLogStatus = "Enabled" +) + +// PossibleAuditLogStatusValues returns the possible values for the AuditLogStatus const type. +func PossibleAuditLogStatusValues() []AuditLogStatus { + return []AuditLogStatus{ + AuditLogStatusDisabled, + AuditLogStatusEnabled, + } +} + +// AzureADAuthenticationAsArmPolicyStatus - The value that indicates whether the policy is enabled or not. +type AzureADAuthenticationAsArmPolicyStatus string + +const ( + AzureADAuthenticationAsArmPolicyStatusDisabled AzureADAuthenticationAsArmPolicyStatus = "disabled" + AzureADAuthenticationAsArmPolicyStatusEnabled AzureADAuthenticationAsArmPolicyStatus = "enabled" +) + +// PossibleAzureADAuthenticationAsArmPolicyStatusValues returns the possible values for the AzureADAuthenticationAsArmPolicyStatus const type. +func PossibleAzureADAuthenticationAsArmPolicyStatusValues() []AzureADAuthenticationAsArmPolicyStatus { + return []AzureADAuthenticationAsArmPolicyStatus{ + AzureADAuthenticationAsArmPolicyStatusDisabled, + AzureADAuthenticationAsArmPolicyStatusEnabled, + } +} + // BaseImageDependencyType - The type of the base image dependency. type BaseImageDependencyType string @@ -97,6 +145,60 @@ func PossibleBaseImageTriggerTypeValues() []BaseImageTriggerType { } } +// CertificateType - The type of certificate location. +type CertificateType string + +const ( + CertificateTypeLocalDirectory CertificateType = "LocalDirectory" +) + +// PossibleCertificateTypeValues returns the possible values for the CertificateType const type. +func PossibleCertificateTypeValues() []CertificateType { + return []CertificateType{ + CertificateTypeLocalDirectory, + } +} + +// ConnectedRegistryMode - The mode of the connected registry resource that indicates the permissions of the registry. +type ConnectedRegistryMode string + +const ( + ConnectedRegistryModeMirror ConnectedRegistryMode = "Mirror" + ConnectedRegistryModeReadOnly ConnectedRegistryMode = "ReadOnly" + ConnectedRegistryModeReadWrite ConnectedRegistryMode = "ReadWrite" + ConnectedRegistryModeRegistry ConnectedRegistryMode = "Registry" +) + +// PossibleConnectedRegistryModeValues returns the possible values for the ConnectedRegistryMode const type. +func PossibleConnectedRegistryModeValues() []ConnectedRegistryMode { + return []ConnectedRegistryMode{ + ConnectedRegistryModeMirror, + ConnectedRegistryModeReadOnly, + ConnectedRegistryModeReadWrite, + ConnectedRegistryModeRegistry, + } +} + +// ConnectionState - The current connection state of the connected registry. +type ConnectionState string + +const ( + ConnectionStateOffline ConnectionState = "Offline" + ConnectionStateOnline ConnectionState = "Online" + ConnectionStateSyncing ConnectionState = "Syncing" + ConnectionStateUnhealthy ConnectionState = "Unhealthy" +) + +// PossibleConnectionStateValues returns the possible values for the ConnectionState const type. +func PossibleConnectionStateValues() []ConnectionState { + return []ConnectionState{ + ConnectionStateOffline, + ConnectionStateOnline, + ConnectionStateSyncing, + ConnectionStateUnhealthy, + } +} + // ConnectionStatus - The private link service connection status. type ConnectionStatus string @@ -252,6 +354,44 @@ func PossibleLastModifiedByTypeValues() []LastModifiedByType { } } +// LogLevel - The verbosity of logs persisted on the connected registry. +type LogLevel string + +const ( + LogLevelDebug LogLevel = "Debug" + LogLevelError LogLevel = "Error" + LogLevelInformation LogLevel = "Information" + LogLevelNone LogLevel = "None" + LogLevelWarning LogLevel = "Warning" +) + +// PossibleLogLevelValues returns the possible values for the LogLevel const type. +func PossibleLogLevelValues() []LogLevel { + return []LogLevel{ + LogLevelDebug, + LogLevelError, + LogLevelInformation, + LogLevelNone, + LogLevelWarning, + } +} + +// MetadataSearch - Determines whether registry artifacts are indexed for metadata search. +type MetadataSearch string + +const ( + MetadataSearchDisabled MetadataSearch = "Disabled" + MetadataSearchEnabled MetadataSearch = "Enabled" +) + +// PossibleMetadataSearchValues returns the possible values for the MetadataSearch const type. +func PossibleMetadataSearchValues() []MetadataSearch { + return []MetadataSearch{ + MetadataSearchDisabled, + MetadataSearchEnabled, + } +} + // NetworkRuleBypassOptions - Whether to allow trusted Azure services to access a network restricted registry. type NetworkRuleBypassOptions string @@ -284,6 +424,20 @@ func PossibleOSValues() []OS { } } +// PackageSourceType - The type of package source for a archive. +type PackageSourceType string + +const ( + PackageSourceTypeRemote PackageSourceType = "remote" +) + +// PossiblePackageSourceTypeValues returns the possible values for the PackageSourceType const type. +func PossiblePackageSourceTypeValues() []PackageSourceType { + return []PackageSourceType{ + PackageSourceTypeRemote, + } +} + // PasswordName - The password name. type PasswordName string @@ -300,6 +454,67 @@ func PossiblePasswordNameValues() []PasswordName { } } +type PipelineOptions string + +const ( + PipelineOptionsContinueOnErrors PipelineOptions = "ContinueOnErrors" + PipelineOptionsDeleteSourceBlobOnSuccess PipelineOptions = "DeleteSourceBlobOnSuccess" + PipelineOptionsOverwriteBlobs PipelineOptions = "OverwriteBlobs" + PipelineOptionsOverwriteTags PipelineOptions = "OverwriteTags" +) + +// PossiblePipelineOptionsValues returns the possible values for the PipelineOptions const type. +func PossiblePipelineOptionsValues() []PipelineOptions { + return []PipelineOptions{ + PipelineOptionsContinueOnErrors, + PipelineOptionsDeleteSourceBlobOnSuccess, + PipelineOptionsOverwriteBlobs, + PipelineOptionsOverwriteTags, + } +} + +// PipelineRunSourceType - The type of the source. +type PipelineRunSourceType string + +const ( + PipelineRunSourceTypeAzureStorageBlob PipelineRunSourceType = "AzureStorageBlob" +) + +// PossiblePipelineRunSourceTypeValues returns the possible values for the PipelineRunSourceType const type. +func PossiblePipelineRunSourceTypeValues() []PipelineRunSourceType { + return []PipelineRunSourceType{ + PipelineRunSourceTypeAzureStorageBlob, + } +} + +// PipelineRunTargetType - The type of the target. +type PipelineRunTargetType string + +const ( + PipelineRunTargetTypeAzureStorageBlob PipelineRunTargetType = "AzureStorageBlob" +) + +// PossiblePipelineRunTargetTypeValues returns the possible values for the PipelineRunTargetType const type. +func PossiblePipelineRunTargetTypeValues() []PipelineRunTargetType { + return []PipelineRunTargetType{ + PipelineRunTargetTypeAzureStorageBlob, + } +} + +// PipelineSourceType - The type of source for the import pipeline. +type PipelineSourceType string + +const ( + PipelineSourceTypeAzureStorageBlobContainer PipelineSourceType = "AzureStorageBlobContainer" +) + +// PossiblePipelineSourceTypeValues returns the possible values for the PipelineSourceType const type. +func PossiblePipelineSourceTypeValues() []PipelineSourceType { + return []PipelineSourceType{ + PipelineSourceTypeAzureStorageBlobContainer, + } +} + // PolicyStatus - The value that indicates whether the policy is enabled or not. type PolicyStatus string @@ -563,6 +778,22 @@ func PossibleStepTypeValues() []StepType { } } +// TLSStatus - Indicates whether HTTPS is enabled for the login server. +type TLSStatus string + +const ( + TLSStatusDisabled TLSStatus = "Disabled" + TLSStatusEnabled TLSStatus = "Enabled" +) + +// PossibleTLSStatusValues returns the possible values for the TLSStatus const type. +func PossibleTLSStatusValues() []TLSStatus { + return []TLSStatus{ + TLSStatusDisabled, + TLSStatusEnabled, + } +} + // TaskStatus - The current status of task. type TaskStatus string diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/credentialsets_client.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/credentialsets_client.go index b900f870d8d5..f4f04bc9a9e3 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/credentialsets_client.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/credentialsets_client.go @@ -46,7 +46,7 @@ func NewCredentialSetsClient(subscriptionID string, credential azcore.TokenCrede // BeginCreate - Creates a credential set for a container registry with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - registryName - The name of the container registry. // - credentialSetName - The name of the credential set. @@ -74,7 +74,7 @@ func (client *CredentialSetsClient) BeginCreate(ctx context.Context, resourceGro // Create - Creates a credential set for a container registry with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview func (client *CredentialSetsClient) create(ctx context.Context, resourceGroupName string, registryName string, credentialSetName string, credentialSetCreateParameters CredentialSet, options *CredentialSetsClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "CredentialSetsClient.BeginCreate" @@ -120,7 +120,7 @@ func (client *CredentialSetsClient) createCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, credentialSetCreateParameters); err != nil { @@ -132,7 +132,7 @@ func (client *CredentialSetsClient) createCreateRequest(ctx context.Context, res // BeginDelete - Deletes a credential set from a container registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - registryName - The name of the container registry. // - credentialSetName - The name of the credential set. @@ -159,7 +159,7 @@ func (client *CredentialSetsClient) BeginDelete(ctx context.Context, resourceGro // Delete - Deletes a credential set from a container registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview func (client *CredentialSetsClient) deleteOperation(ctx context.Context, resourceGroupName string, registryName string, credentialSetName string, options *CredentialSetsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "CredentialSetsClient.BeginDelete" @@ -205,7 +205,7 @@ func (client *CredentialSetsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -214,7 +214,7 @@ func (client *CredentialSetsClient) deleteCreateRequest(ctx context.Context, res // Get - Gets the properties of the specified credential set resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - registryName - The name of the container registry. // - credentialSetName - The name of the credential set. @@ -265,7 +265,7 @@ func (client *CredentialSetsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -282,7 +282,7 @@ func (client *CredentialSetsClient) getHandleResponse(resp *http.Response) (Cred // NewListPager - Lists all credential set resources for the specified container registry. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - registryName - The name of the container registry. // - options - CredentialSetsClientListOptions contains the optional parameters for the CredentialSetsClient.NewListPager method. @@ -329,7 +329,7 @@ func (client *CredentialSetsClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -347,7 +347,7 @@ func (client *CredentialSetsClient) listHandleResponse(resp *http.Response) (Cre // BeginUpdate - Updates a credential set for a container registry with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - registryName - The name of the container registry. // - credentialSetName - The name of the credential set. @@ -375,7 +375,7 @@ func (client *CredentialSetsClient) BeginUpdate(ctx context.Context, resourceGro // Update - Updates a credential set for a container registry with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview func (client *CredentialSetsClient) update(ctx context.Context, resourceGroupName string, registryName string, credentialSetName string, credentialSetUpdateParameters CredentialSetUpdateParameters, options *CredentialSetsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "CredentialSetsClient.BeginUpdate" @@ -421,7 +421,7 @@ func (client *CredentialSetsClient) updateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, credentialSetUpdateParameters); err != nil { diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/credentialsets_client_example_test.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/credentialsets_client_example_test.go index 3eab51950f8b..0b4a26ddb2fe 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/credentialsets_client_example_test.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/credentialsets_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/CredentialSetList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/CredentialSetList.json func ExampleCredentialSetsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -70,7 +70,7 @@ func ExampleCredentialSetsClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/CredentialSetGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/CredentialSetGet.json func ExampleCredentialSetsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -114,7 +114,7 @@ func ExampleCredentialSetsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/CredentialSetCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/CredentialSetCreate.json func ExampleCredentialSetsClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -175,7 +175,7 @@ func ExampleCredentialSetsClient_BeginCreate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/CredentialSetDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/CredentialSetDelete.json func ExampleCredentialSetsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -196,7 +196,7 @@ func ExampleCredentialSetsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/CredentialSetUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/CredentialSetUpdate.json func ExampleCredentialSetsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/exportpipelines_client.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/exportpipelines_client.go new file mode 100644 index 000000000000..970a38187711 --- /dev/null +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/exportpipelines_client.go @@ -0,0 +1,346 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. 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" +) + +// ExportPipelinesClient contains the methods for the ExportPipelines group. +// Don't use this type directly, use NewExportPipelinesClient() instead. +type ExportPipelinesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewExportPipelinesClient creates a new instance of ExportPipelinesClient 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 - pass nil to accept the default values. +func NewExportPipelinesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExportPipelinesClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ExportPipelinesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreate - Creates an export pipeline for a container registry with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - The name of the container registry. +// - exportPipelineName - The name of the export pipeline. +// - exportPipelineCreateParameters - The parameters for creating an export pipeline. +// - options - ExportPipelinesClientBeginCreateOptions contains the optional parameters for the ExportPipelinesClient.BeginCreate +// method. +func (client *ExportPipelinesClient) BeginCreate(ctx context.Context, resourceGroupName string, registryName string, exportPipelineName string, exportPipelineCreateParameters ExportPipeline, options *ExportPipelinesClientBeginCreateOptions) (*runtime.Poller[ExportPipelinesClientCreateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.create(ctx, resourceGroupName, registryName, exportPipelineName, exportPipelineCreateParameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExportPipelinesClientCreateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ExportPipelinesClientCreateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Create - Creates an export pipeline for a container registry with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-11-01-preview +func (client *ExportPipelinesClient) create(ctx context.Context, resourceGroupName string, registryName string, exportPipelineName string, exportPipelineCreateParameters ExportPipeline, options *ExportPipelinesClientBeginCreateOptions) (*http.Response, error) { + var err error + const operationName = "ExportPipelinesClient.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, exportPipelineName, exportPipelineCreateParameters, 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 *ExportPipelinesClient) createCreateRequest(ctx context.Context, resourceGroupName string, registryName string, exportPipelineName string, exportPipelineCreateParameters ExportPipeline, options *ExportPipelinesClientBeginCreateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName}" + 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 exportPipelineName == "" { + return nil, errors.New("parameter exportPipelineName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{exportPipelineName}", url.PathEscape(exportPipelineName)) + 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", "2023-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, exportPipelineCreateParameters); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Deletes an export pipeline from a container registry. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - The name of the container registry. +// - exportPipelineName - The name of the export pipeline. +// - options - ExportPipelinesClientBeginDeleteOptions contains the optional parameters for the ExportPipelinesClient.BeginDelete +// method. +func (client *ExportPipelinesClient) BeginDelete(ctx context.Context, resourceGroupName string, registryName string, exportPipelineName string, options *ExportPipelinesClientBeginDeleteOptions) (*runtime.Poller[ExportPipelinesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, registryName, exportPipelineName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExportPipelinesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ExportPipelinesClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Deletes an export pipeline from a container registry. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-11-01-preview +func (client *ExportPipelinesClient) deleteOperation(ctx context.Context, resourceGroupName string, registryName string, exportPipelineName string, options *ExportPipelinesClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "ExportPipelinesClient.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, exportPipelineName, 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.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ExportPipelinesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, registryName string, exportPipelineName string, options *ExportPipelinesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName}" + 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 exportPipelineName == "" { + return nil, errors.New("parameter exportPipelineName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{exportPipelineName}", url.PathEscape(exportPipelineName)) + 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", "2023-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the properties of the export pipeline. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - The name of the container registry. +// - exportPipelineName - The name of the export pipeline. +// - options - ExportPipelinesClientGetOptions contains the optional parameters for the ExportPipelinesClient.Get method. +func (client *ExportPipelinesClient) Get(ctx context.Context, resourceGroupName string, registryName string, exportPipelineName string, options *ExportPipelinesClientGetOptions) (ExportPipelinesClientGetResponse, error) { + var err error + const operationName = "ExportPipelinesClient.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, exportPipelineName, options) + if err != nil { + return ExportPipelinesClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ExportPipelinesClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ExportPipelinesClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *ExportPipelinesClient) getCreateRequest(ctx context.Context, resourceGroupName string, registryName string, exportPipelineName string, options *ExportPipelinesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName}" + 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 exportPipelineName == "" { + return nil, errors.New("parameter exportPipelineName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{exportPipelineName}", url.PathEscape(exportPipelineName)) + 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", "2023-11-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 *ExportPipelinesClient) getHandleResponse(resp *http.Response) (ExportPipelinesClientGetResponse, error) { + result := ExportPipelinesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExportPipeline); err != nil { + return ExportPipelinesClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Lists all export pipelines for the specified container registry. +// +// Generated from API version 2023-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - The name of the container registry. +// - options - ExportPipelinesClientListOptions contains the optional parameters for the ExportPipelinesClient.NewListPager +// method. +func (client *ExportPipelinesClient) NewListPager(resourceGroupName string, registryName string, options *ExportPipelinesClientListOptions) *runtime.Pager[ExportPipelinesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ExportPipelinesClientListResponse]{ + More: func(page ExportPipelinesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ExportPipelinesClientListResponse) (ExportPipelinesClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ExportPipelinesClient.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 ExportPipelinesClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *ExportPipelinesClient) listCreateRequest(ctx context.Context, resourceGroupName string, registryName string, options *ExportPipelinesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines" + 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", "2023-11-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 *ExportPipelinesClient) listHandleResponse(resp *http.Response) (ExportPipelinesClientListResponse, error) { + result := ExportPipelinesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExportPipelineListResult); err != nil { + return ExportPipelinesClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/exportpipelines_client_example_test.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/exportpipelines_client_example_test.go new file mode 100644 index 000000000000..9f48c04ec02a --- /dev/null +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/exportpipelines_client_example_test.go @@ -0,0 +1,189 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// 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" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ExportPipelineList.json +func ExampleExportPipelinesClient_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.NewExportPipelinesClient().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.ExportPipelineListResult = armcontainerregistry.ExportPipelineListResult{ + // Value: []*armcontainerregistry.ExportPipeline{ + // { + // Name: to.Ptr("myExportPipeline"), + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/exportPipelines"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/exportPipelines/myExportPipeline"), + // Identity: &armcontainerregistry.IdentityProperties{ + // Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssigned), + // PrincipalID: to.Ptr("fa153151-b9fd-46f4-9088-5e6600f2689v"), + // TenantID: to.Ptr("f686d426-8d16-42db-81b7-abu4gm510ccd"), + // }, + // Location: to.Ptr("westus"), + // Properties: &armcontainerregistry.ExportPipelineProperties{ + // Options: []*armcontainerregistry.PipelineOptions{ + // to.Ptr(armcontainerregistry.PipelineOptionsOverwriteBlobs)}, + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // Target: &armcontainerregistry.ExportPipelineTargetProperties{ + // Type: to.Ptr("AzureStorageBlobContainer"), + // KeyVaultURI: to.Ptr("https://myvault.vault.azure.net/secrets/acrexportsas"), + // URI: to.Ptr("https://accountname.blob.core.windows.net/containername"), + // }, + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ExportPipelineGet.json +func ExampleExportPipelinesClient_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.NewExportPipelinesClient().Get(ctx, "myResourceGroup", "myRegistry", "myExportPipeline", 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.ExportPipeline = armcontainerregistry.ExportPipeline{ + // Name: to.Ptr("myExportPipeline"), + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/exportPipelines"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/exportPipelines/myExportPipeline"), + // Identity: &armcontainerregistry.IdentityProperties{ + // Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssigned), + // PrincipalID: to.Ptr("fa153151-b9fd-46f4-9088-5e6600f2689v"), + // TenantID: to.Ptr("f686d426-8d16-42db-81b7-abu4gm510ccd"), + // }, + // Location: to.Ptr("westus"), + // Properties: &armcontainerregistry.ExportPipelineProperties{ + // Options: []*armcontainerregistry.PipelineOptions{ + // to.Ptr(armcontainerregistry.PipelineOptionsOverwriteBlobs)}, + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // Target: &armcontainerregistry.ExportPipelineTargetProperties{ + // Type: to.Ptr("AzureStorageBlobContainer"), + // KeyVaultURI: to.Ptr("https://myvault.vault.azure.net/secrets/acrexportsas"), + // URI: to.Ptr("https://accountname.blob.core.windows.net/containername"), + // }, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ExportPipelineCreate.json +func ExampleExportPipelinesClient_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) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewExportPipelinesClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", "myExportPipeline", armcontainerregistry.ExportPipeline{ + Identity: &armcontainerregistry.IdentityProperties{ + Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssigned), + }, + Location: to.Ptr("westus"), + Properties: &armcontainerregistry.ExportPipelineProperties{ + Options: []*armcontainerregistry.PipelineOptions{ + to.Ptr(armcontainerregistry.PipelineOptionsOverwriteBlobs)}, + Target: &armcontainerregistry.ExportPipelineTargetProperties{ + Type: to.Ptr("AzureStorageBlobContainer"), + KeyVaultURI: to.Ptr("https://myvault.vault.azure.net/secrets/acrexportsas"), + URI: to.Ptr("https://accountname.blob.core.windows.net/containername"), + }, + }, + }, 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.ExportPipeline = armcontainerregistry.ExportPipeline{ + // Name: to.Ptr("myExportPipeline"), + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/exportPipelines"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/exportPipelines/myExportPipeline"), + // Identity: &armcontainerregistry.IdentityProperties{ + // Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssigned), + // PrincipalID: to.Ptr("fa153151-b9fd-46f4-9088-5e6600f2689v"), + // TenantID: to.Ptr("f686d426-8d16-42db-81b7-abu4gm510ccd"), + // }, + // Location: to.Ptr("westus"), + // Properties: &armcontainerregistry.ExportPipelineProperties{ + // Options: []*armcontainerregistry.PipelineOptions{ + // to.Ptr(armcontainerregistry.PipelineOptionsOverwriteBlobs)}, + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // Target: &armcontainerregistry.ExportPipelineTargetProperties{ + // Type: to.Ptr("AzureStorageBlobContainer"), + // KeyVaultURI: to.Ptr("https://myvault.vault.azure.net/secrets/acrexportsas"), + // URI: to.Ptr("https://accountname.blob.core.windows.net/containername"), + // }, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ExportPipelineDelete.json +func ExampleExportPipelinesClient_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.NewExportPipelinesClient().BeginDelete(ctx, "myResourceGroup", "myRegistry", "myExportPipeline", 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/archives_server.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/archives_server.go new file mode 100644 index 000000000000..107c7b6ec1a6 --- /dev/null +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/archives_server.go @@ -0,0 +1,339 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. 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" + "net/http" + "net/url" + "regexp" +) + +// ArchivesServer is a fake server for instances of the armcontainerregistry.ArchivesClient type. +type ArchivesServer struct { + // BeginCreate is the fake for method ArchivesClient.BeginCreate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreate func(ctx context.Context, resourceGroupName string, registryName string, packageType string, archiveName string, archiveCreateParameters armcontainerregistry.Archive, options *armcontainerregistry.ArchivesClientBeginCreateOptions) (resp azfake.PollerResponder[armcontainerregistry.ArchivesClientCreateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method ArchivesClient.BeginDelete + // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, registryName string, packageType string, archiveName string, options *armcontainerregistry.ArchivesClientBeginDeleteOptions) (resp azfake.PollerResponder[armcontainerregistry.ArchivesClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method ArchivesClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, registryName string, packageType string, archiveName string, options *armcontainerregistry.ArchivesClientGetOptions) (resp azfake.Responder[armcontainerregistry.ArchivesClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method ArchivesClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, registryName string, packageType string, options *armcontainerregistry.ArchivesClientListOptions) (resp azfake.PagerResponder[armcontainerregistry.ArchivesClientListResponse]) + + // Update is the fake for method ArchivesClient.Update + // HTTP status codes to indicate success: http.StatusOK + Update func(ctx context.Context, resourceGroupName string, registryName string, packageType string, archiveName string, archiveUpdateParameters armcontainerregistry.ArchiveUpdateParameters, options *armcontainerregistry.ArchivesClientUpdateOptions) (resp azfake.Responder[armcontainerregistry.ArchivesClientUpdateResponse], errResp azfake.ErrorResponder) +} + +// NewArchivesServerTransport creates a new instance of ArchivesServerTransport with the provided implementation. +// The returned ArchivesServerTransport instance is connected to an instance of armcontainerregistry.ArchivesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewArchivesServerTransport(srv *ArchivesServer) *ArchivesServerTransport { + return &ArchivesServerTransport{ + srv: srv, + beginCreate: newTracker[azfake.PollerResponder[armcontainerregistry.ArchivesClientCreateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armcontainerregistry.ArchivesClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armcontainerregistry.ArchivesClientListResponse]](), + } +} + +// ArchivesServerTransport connects instances of armcontainerregistry.ArchivesClient to instances of ArchivesServer. +// Don't use this type directly, use NewArchivesServerTransport instead. +type ArchivesServerTransport struct { + srv *ArchivesServer + beginCreate *tracker[azfake.PollerResponder[armcontainerregistry.ArchivesClientCreateResponse]] + beginDelete *tracker[azfake.PollerResponder[armcontainerregistry.ArchivesClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armcontainerregistry.ArchivesClientListResponse]] +} + +// Do implements the policy.Transporter interface for ArchivesServerTransport. +func (a *ArchivesServerTransport) 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")} + } + + var resp *http.Response + var err error + + switch method { + case "ArchivesClient.BeginCreate": + resp, err = a.dispatchBeginCreate(req) + case "ArchivesClient.BeginDelete": + resp, err = a.dispatchBeginDelete(req) + case "ArchivesClient.Get": + resp, err = a.dispatchGet(req) + case "ArchivesClient.NewListPager": + resp, err = a.dispatchNewListPager(req) + case "ArchivesClient.Update": + resp, err = a.dispatchUpdate(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (a *ArchivesServerTransport) 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~%@]+)/packages/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/archives/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armcontainerregistry.Archive](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 + } + packageTypeParam, err := url.PathUnescape(matches[regex.SubexpIndex("packageType")]) + if err != nil { + return nil, err + } + archiveNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("archiveName")]) + if err != nil { + return nil, err + } + respr, errRespr := a.srv.BeginCreate(req.Context(), resourceGroupNameParam, registryNameParam, packageTypeParam, archiveNameParam, 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 *ArchivesServerTransport) 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~%@]+)/packages/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/archives/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || 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 + } + packageTypeParam, err := url.PathUnescape(matches[regex.SubexpIndex("packageType")]) + if err != nil { + return nil, err + } + archiveNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("archiveName")]) + if err != nil { + return nil, err + } + respr, errRespr := a.srv.BeginDelete(req.Context(), resourceGroupNameParam, registryNameParam, packageTypeParam, archiveNameParam, 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.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + a.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + a.beginDelete.remove(req) + } + + return resp, nil +} + +func (a *ArchivesServerTransport) 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~%@]+)/packages/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/archives/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || 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 + } + packageTypeParam, err := url.PathUnescape(matches[regex.SubexpIndex("packageType")]) + if err != nil { + return nil, err + } + archiveNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("archiveName")]) + if err != nil { + return nil, err + } + respr, errRespr := a.srv.Get(req.Context(), resourceGroupNameParam, registryNameParam, packageTypeParam, archiveNameParam, 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).Archive, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (a *ArchivesServerTransport) 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~%@]+)/packages/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/archives` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || 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 + } + packageTypeParam, err := url.PathUnescape(matches[regex.SubexpIndex("packageType")]) + if err != nil { + return nil, err + } + resp := a.srv.NewListPager(resourceGroupNameParam, registryNameParam, packageTypeParam, nil) + newListPager = &resp + a.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armcontainerregistry.ArchivesClientListResponse, 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 *ArchivesServerTransport) dispatchUpdate(req *http.Request) (*http.Response, error) { + if a.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~%@]+)/packages/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/archives/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armcontainerregistry.ArchiveUpdateParameters](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 + } + packageTypeParam, err := url.PathUnescape(matches[regex.SubexpIndex("packageType")]) + if err != nil { + return nil, err + } + archiveNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("archiveName")]) + if err != nil { + return nil, err + } + respr, errRespr := a.srv.Update(req.Context(), resourceGroupNameParam, registryNameParam, packageTypeParam, archiveNameParam, 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).Archive, req) + if err != nil { + return nil, err + } + return resp, nil +} diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/archiveversions_server.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/archiveversions_server.go new file mode 100644 index 000000000000..c2cf60dd312d --- /dev/null +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/archiveversions_server.go @@ -0,0 +1,300 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. 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" + "net/http" + "net/url" + "regexp" +) + +// ArchiveVersionsServer is a fake server for instances of the armcontainerregistry.ArchiveVersionsClient type. +type ArchiveVersionsServer struct { + // BeginCreate is the fake for method ArchiveVersionsClient.BeginCreate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreate func(ctx context.Context, resourceGroupName string, registryName string, packageType string, archiveName string, archiveVersionName string, options *armcontainerregistry.ArchiveVersionsClientBeginCreateOptions) (resp azfake.PollerResponder[armcontainerregistry.ArchiveVersionsClientCreateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method ArchiveVersionsClient.BeginDelete + // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, registryName string, packageType string, archiveName string, archiveVersionName string, options *armcontainerregistry.ArchiveVersionsClientBeginDeleteOptions) (resp azfake.PollerResponder[armcontainerregistry.ArchiveVersionsClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method ArchiveVersionsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, registryName string, packageType string, archiveName string, archiveVersionName string, options *armcontainerregistry.ArchiveVersionsClientGetOptions) (resp azfake.Responder[armcontainerregistry.ArchiveVersionsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method ArchiveVersionsClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, registryName string, packageType string, archiveName string, options *armcontainerregistry.ArchiveVersionsClientListOptions) (resp azfake.PagerResponder[armcontainerregistry.ArchiveVersionsClientListResponse]) +} + +// NewArchiveVersionsServerTransport creates a new instance of ArchiveVersionsServerTransport with the provided implementation. +// The returned ArchiveVersionsServerTransport instance is connected to an instance of armcontainerregistry.ArchiveVersionsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewArchiveVersionsServerTransport(srv *ArchiveVersionsServer) *ArchiveVersionsServerTransport { + return &ArchiveVersionsServerTransport{ + srv: srv, + beginCreate: newTracker[azfake.PollerResponder[armcontainerregistry.ArchiveVersionsClientCreateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armcontainerregistry.ArchiveVersionsClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armcontainerregistry.ArchiveVersionsClientListResponse]](), + } +} + +// ArchiveVersionsServerTransport connects instances of armcontainerregistry.ArchiveVersionsClient to instances of ArchiveVersionsServer. +// Don't use this type directly, use NewArchiveVersionsServerTransport instead. +type ArchiveVersionsServerTransport struct { + srv *ArchiveVersionsServer + beginCreate *tracker[azfake.PollerResponder[armcontainerregistry.ArchiveVersionsClientCreateResponse]] + beginDelete *tracker[azfake.PollerResponder[armcontainerregistry.ArchiveVersionsClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armcontainerregistry.ArchiveVersionsClientListResponse]] +} + +// Do implements the policy.Transporter interface for ArchiveVersionsServerTransport. +func (a *ArchiveVersionsServerTransport) 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")} + } + + var resp *http.Response + var err error + + switch method { + case "ArchiveVersionsClient.BeginCreate": + resp, err = a.dispatchBeginCreate(req) + case "ArchiveVersionsClient.BeginDelete": + resp, err = a.dispatchBeginDelete(req) + case "ArchiveVersionsClient.Get": + resp, err = a.dispatchGet(req) + case "ArchiveVersionsClient.NewListPager": + resp, err = a.dispatchNewListPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (a *ArchiveVersionsServerTransport) 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~%@]+)/packages/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/archives/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 6 { + 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 + } + packageTypeParam, err := url.PathUnescape(matches[regex.SubexpIndex("packageType")]) + if err != nil { + return nil, err + } + archiveNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("archiveName")]) + if err != nil { + return nil, err + } + archiveVersionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("archiveVersionName")]) + if err != nil { + return nil, err + } + respr, errRespr := a.srv.BeginCreate(req.Context(), resourceGroupNameParam, registryNameParam, packageTypeParam, archiveNameParam, archiveVersionNameParam, 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 *ArchiveVersionsServerTransport) 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~%@]+)/packages/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/archives/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 6 { + 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 + } + packageTypeParam, err := url.PathUnescape(matches[regex.SubexpIndex("packageType")]) + if err != nil { + return nil, err + } + archiveNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("archiveName")]) + if err != nil { + return nil, err + } + archiveVersionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("archiveVersionName")]) + if err != nil { + return nil, err + } + respr, errRespr := a.srv.BeginDelete(req.Context(), resourceGroupNameParam, registryNameParam, packageTypeParam, archiveNameParam, archiveVersionNameParam, 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.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + a.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + a.beginDelete.remove(req) + } + + return resp, nil +} + +func (a *ArchiveVersionsServerTransport) 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~%@]+)/packages/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/archives/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 6 { + 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 + } + packageTypeParam, err := url.PathUnescape(matches[regex.SubexpIndex("packageType")]) + if err != nil { + return nil, err + } + archiveNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("archiveName")]) + if err != nil { + return nil, err + } + archiveVersionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("archiveVersionName")]) + if err != nil { + return nil, err + } + respr, errRespr := a.srv.Get(req.Context(), resourceGroupNameParam, registryNameParam, packageTypeParam, archiveNameParam, archiveVersionNameParam, 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).ArchiveVersion, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (a *ArchiveVersionsServerTransport) 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~%@]+)/packages/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/archives/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || 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 + } + packageTypeParam, err := url.PathUnescape(matches[regex.SubexpIndex("packageType")]) + if err != nil { + return nil, err + } + archiveNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("archiveName")]) + if err != nil { + return nil, err + } + resp := a.srv.NewListPager(resourceGroupNameParam, registryNameParam, packageTypeParam, archiveNameParam, nil) + newListPager = &resp + a.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armcontainerregistry.ArchiveVersionsClientListResponse, 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 +} diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/connectedregistries_server.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/connectedregistries_server.go new file mode 100644 index 000000000000..fe5fb2e6e3ad --- /dev/null +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/connectedregistries_server.go @@ -0,0 +1,400 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. 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" + "net/http" + "net/url" + "regexp" +) + +// ConnectedRegistriesServer is a fake server for instances of the armcontainerregistry.ConnectedRegistriesClient type. +type ConnectedRegistriesServer struct { + // BeginCreate is the fake for method ConnectedRegistriesClient.BeginCreate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreate func(ctx context.Context, resourceGroupName string, registryName string, connectedRegistryName string, connectedRegistryCreateParameters armcontainerregistry.ConnectedRegistry, options *armcontainerregistry.ConnectedRegistriesClientBeginCreateOptions) (resp azfake.PollerResponder[armcontainerregistry.ConnectedRegistriesClientCreateResponse], errResp azfake.ErrorResponder) + + // BeginDeactivate is the fake for method ConnectedRegistriesClient.BeginDeactivate + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginDeactivate func(ctx context.Context, resourceGroupName string, registryName string, connectedRegistryName string, options *armcontainerregistry.ConnectedRegistriesClientBeginDeactivateOptions) (resp azfake.PollerResponder[armcontainerregistry.ConnectedRegistriesClientDeactivateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method ConnectedRegistriesClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, registryName string, connectedRegistryName string, options *armcontainerregistry.ConnectedRegistriesClientBeginDeleteOptions) (resp azfake.PollerResponder[armcontainerregistry.ConnectedRegistriesClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method ConnectedRegistriesClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, registryName string, connectedRegistryName string, options *armcontainerregistry.ConnectedRegistriesClientGetOptions) (resp azfake.Responder[armcontainerregistry.ConnectedRegistriesClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method ConnectedRegistriesClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, registryName string, options *armcontainerregistry.ConnectedRegistriesClientListOptions) (resp azfake.PagerResponder[armcontainerregistry.ConnectedRegistriesClientListResponse]) + + // BeginUpdate is the fake for method ConnectedRegistriesClient.BeginUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginUpdate func(ctx context.Context, resourceGroupName string, registryName string, connectedRegistryName string, connectedRegistryUpdateParameters armcontainerregistry.ConnectedRegistryUpdateParameters, options *armcontainerregistry.ConnectedRegistriesClientBeginUpdateOptions) (resp azfake.PollerResponder[armcontainerregistry.ConnectedRegistriesClientUpdateResponse], errResp azfake.ErrorResponder) +} + +// NewConnectedRegistriesServerTransport creates a new instance of ConnectedRegistriesServerTransport with the provided implementation. +// The returned ConnectedRegistriesServerTransport instance is connected to an instance of armcontainerregistry.ConnectedRegistriesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewConnectedRegistriesServerTransport(srv *ConnectedRegistriesServer) *ConnectedRegistriesServerTransport { + return &ConnectedRegistriesServerTransport{ + srv: srv, + beginCreate: newTracker[azfake.PollerResponder[armcontainerregistry.ConnectedRegistriesClientCreateResponse]](), + beginDeactivate: newTracker[azfake.PollerResponder[armcontainerregistry.ConnectedRegistriesClientDeactivateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armcontainerregistry.ConnectedRegistriesClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armcontainerregistry.ConnectedRegistriesClientListResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armcontainerregistry.ConnectedRegistriesClientUpdateResponse]](), + } +} + +// ConnectedRegistriesServerTransport connects instances of armcontainerregistry.ConnectedRegistriesClient to instances of ConnectedRegistriesServer. +// Don't use this type directly, use NewConnectedRegistriesServerTransport instead. +type ConnectedRegistriesServerTransport struct { + srv *ConnectedRegistriesServer + beginCreate *tracker[azfake.PollerResponder[armcontainerregistry.ConnectedRegistriesClientCreateResponse]] + beginDeactivate *tracker[azfake.PollerResponder[armcontainerregistry.ConnectedRegistriesClientDeactivateResponse]] + beginDelete *tracker[azfake.PollerResponder[armcontainerregistry.ConnectedRegistriesClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armcontainerregistry.ConnectedRegistriesClientListResponse]] + beginUpdate *tracker[azfake.PollerResponder[armcontainerregistry.ConnectedRegistriesClientUpdateResponse]] +} + +// Do implements the policy.Transporter interface for ConnectedRegistriesServerTransport. +func (c *ConnectedRegistriesServerTransport) 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")} + } + + var resp *http.Response + var err error + + switch method { + case "ConnectedRegistriesClient.BeginCreate": + resp, err = c.dispatchBeginCreate(req) + case "ConnectedRegistriesClient.BeginDeactivate": + resp, err = c.dispatchBeginDeactivate(req) + case "ConnectedRegistriesClient.BeginDelete": + resp, err = c.dispatchBeginDelete(req) + case "ConnectedRegistriesClient.Get": + resp, err = c.dispatchGet(req) + case "ConnectedRegistriesClient.NewListPager": + resp, err = c.dispatchNewListPager(req) + case "ConnectedRegistriesClient.BeginUpdate": + resp, err = c.dispatchBeginUpdate(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (c *ConnectedRegistriesServerTransport) dispatchBeginCreate(req *http.Request) (*http.Response, error) { + if c.srv.BeginCreate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreate not implemented")} + } + beginCreate := c.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~%@]+)/connectedRegistries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armcontainerregistry.ConnectedRegistry](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 + } + connectedRegistryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("connectedRegistryName")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.BeginCreate(req.Context(), resourceGroupNameParam, registryNameParam, connectedRegistryNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreate = &respr + c.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) { + c.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) { + c.beginCreate.remove(req) + } + + return resp, nil +} + +func (c *ConnectedRegistriesServerTransport) dispatchBeginDeactivate(req *http.Request) (*http.Response, error) { + if c.srv.BeginDeactivate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDeactivate not implemented")} + } + beginDeactivate := c.beginDeactivate.get(req) + if beginDeactivate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerRegistry/registries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/connectedRegistries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/deactivate` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || 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 + } + connectedRegistryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("connectedRegistryName")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.BeginDeactivate(req.Context(), resourceGroupNameParam, registryNameParam, connectedRegistryNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDeactivate = &respr + c.beginDeactivate.add(req, beginDeactivate) + } + + resp, err := server.PollerResponderNext(beginDeactivate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + c.beginDeactivate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDeactivate) { + c.beginDeactivate.remove(req) + } + + return resp, nil +} + +func (c *ConnectedRegistriesServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if c.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := c.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~%@]+)/connectedRegistries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || 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 + } + connectedRegistryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("connectedRegistryName")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.BeginDelete(req.Context(), resourceGroupNameParam, registryNameParam, connectedRegistryNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + c.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) { + c.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) { + c.beginDelete.remove(req) + } + + return resp, nil +} + +func (c *ConnectedRegistriesServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if c.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~%@]+)/connectedRegistries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || 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 + } + connectedRegistryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("connectedRegistryName")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.Get(req.Context(), resourceGroupNameParam, registryNameParam, connectedRegistryNameParam, 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).ConnectedRegistry, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *ConnectedRegistriesServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if c.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := c.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~%@]+)/connectedRegistries` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + 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) + var options *armcontainerregistry.ConnectedRegistriesClientListOptions + if filterParam != nil { + options = &armcontainerregistry.ConnectedRegistriesClientListOptions{ + Filter: filterParam, + } + } + resp := c.srv.NewListPager(resourceGroupNameParam, registryNameParam, options) + newListPager = &resp + c.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armcontainerregistry.ConnectedRegistriesClientListResponse, 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) { + c.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + c.newListPager.remove(req) + } + return resp, nil +} + +func (c *ConnectedRegistriesServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) { + if c.srv.BeginUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} + } + beginUpdate := c.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~%@]+)/connectedRegistries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armcontainerregistry.ConnectedRegistryUpdateParameters](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 + } + connectedRegistryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("connectedRegistryName")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.BeginUpdate(req.Context(), resourceGroupNameParam, registryNameParam, connectedRegistryNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginUpdate = &respr + c.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) { + c.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) { + c.beginUpdate.remove(req) + } + + return resp, nil +} diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/exportpipelines_server.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/exportpipelines_server.go new file mode 100644 index 000000000000..fb5cf2be687d --- /dev/null +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/exportpipelines_server.go @@ -0,0 +1,272 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. 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" + "net/http" + "net/url" + "regexp" +) + +// ExportPipelinesServer is a fake server for instances of the armcontainerregistry.ExportPipelinesClient type. +type ExportPipelinesServer struct { + // BeginCreate is the fake for method ExportPipelinesClient.BeginCreate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreate func(ctx context.Context, resourceGroupName string, registryName string, exportPipelineName string, exportPipelineCreateParameters armcontainerregistry.ExportPipeline, options *armcontainerregistry.ExportPipelinesClientBeginCreateOptions) (resp azfake.PollerResponder[armcontainerregistry.ExportPipelinesClientCreateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method ExportPipelinesClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, registryName string, exportPipelineName string, options *armcontainerregistry.ExportPipelinesClientBeginDeleteOptions) (resp azfake.PollerResponder[armcontainerregistry.ExportPipelinesClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method ExportPipelinesClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, registryName string, exportPipelineName string, options *armcontainerregistry.ExportPipelinesClientGetOptions) (resp azfake.Responder[armcontainerregistry.ExportPipelinesClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method ExportPipelinesClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, registryName string, options *armcontainerregistry.ExportPipelinesClientListOptions) (resp azfake.PagerResponder[armcontainerregistry.ExportPipelinesClientListResponse]) +} + +// NewExportPipelinesServerTransport creates a new instance of ExportPipelinesServerTransport with the provided implementation. +// The returned ExportPipelinesServerTransport instance is connected to an instance of armcontainerregistry.ExportPipelinesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewExportPipelinesServerTransport(srv *ExportPipelinesServer) *ExportPipelinesServerTransport { + return &ExportPipelinesServerTransport{ + srv: srv, + beginCreate: newTracker[azfake.PollerResponder[armcontainerregistry.ExportPipelinesClientCreateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armcontainerregistry.ExportPipelinesClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armcontainerregistry.ExportPipelinesClientListResponse]](), + } +} + +// ExportPipelinesServerTransport connects instances of armcontainerregistry.ExportPipelinesClient to instances of ExportPipelinesServer. +// Don't use this type directly, use NewExportPipelinesServerTransport instead. +type ExportPipelinesServerTransport struct { + srv *ExportPipelinesServer + beginCreate *tracker[azfake.PollerResponder[armcontainerregistry.ExportPipelinesClientCreateResponse]] + beginDelete *tracker[azfake.PollerResponder[armcontainerregistry.ExportPipelinesClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armcontainerregistry.ExportPipelinesClientListResponse]] +} + +// Do implements the policy.Transporter interface for ExportPipelinesServerTransport. +func (e *ExportPipelinesServerTransport) 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")} + } + + var resp *http.Response + var err error + + switch method { + case "ExportPipelinesClient.BeginCreate": + resp, err = e.dispatchBeginCreate(req) + case "ExportPipelinesClient.BeginDelete": + resp, err = e.dispatchBeginDelete(req) + case "ExportPipelinesClient.Get": + resp, err = e.dispatchGet(req) + case "ExportPipelinesClient.NewListPager": + resp, err = e.dispatchNewListPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (e *ExportPipelinesServerTransport) dispatchBeginCreate(req *http.Request) (*http.Response, error) { + if e.srv.BeginCreate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreate not implemented")} + } + beginCreate := e.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~%@]+)/exportPipelines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armcontainerregistry.ExportPipeline](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 + } + exportPipelineNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("exportPipelineName")]) + if err != nil { + return nil, err + } + respr, errRespr := e.srv.BeginCreate(req.Context(), resourceGroupNameParam, registryNameParam, exportPipelineNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreate = &respr + e.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) { + e.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) { + e.beginCreate.remove(req) + } + + return resp, nil +} + +func (e *ExportPipelinesServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if e.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := e.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~%@]+)/exportPipelines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || 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 + } + exportPipelineNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("exportPipelineName")]) + if err != nil { + return nil, err + } + respr, errRespr := e.srv.BeginDelete(req.Context(), resourceGroupNameParam, registryNameParam, exportPipelineNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + e.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) { + e.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) { + e.beginDelete.remove(req) + } + + return resp, nil +} + +func (e *ExportPipelinesServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if e.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~%@]+)/exportPipelines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || 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 + } + exportPipelineNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("exportPipelineName")]) + if err != nil { + return nil, err + } + respr, errRespr := e.srv.Get(req.Context(), resourceGroupNameParam, registryNameParam, exportPipelineNameParam, 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).ExportPipeline, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (e *ExportPipelinesServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if e.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := e.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~%@]+)/exportPipelines` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + 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 := e.srv.NewListPager(resourceGroupNameParam, registryNameParam, nil) + newListPager = &resp + e.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armcontainerregistry.ExportPipelinesClientListResponse, 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) { + e.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + e.newListPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/importpipelines_server.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/importpipelines_server.go new file mode 100644 index 000000000000..cf22468fbed3 --- /dev/null +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/importpipelines_server.go @@ -0,0 +1,272 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. 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" + "net/http" + "net/url" + "regexp" +) + +// ImportPipelinesServer is a fake server for instances of the armcontainerregistry.ImportPipelinesClient type. +type ImportPipelinesServer struct { + // BeginCreate is the fake for method ImportPipelinesClient.BeginCreate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreate func(ctx context.Context, resourceGroupName string, registryName string, importPipelineName string, importPipelineCreateParameters armcontainerregistry.ImportPipeline, options *armcontainerregistry.ImportPipelinesClientBeginCreateOptions) (resp azfake.PollerResponder[armcontainerregistry.ImportPipelinesClientCreateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method ImportPipelinesClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, registryName string, importPipelineName string, options *armcontainerregistry.ImportPipelinesClientBeginDeleteOptions) (resp azfake.PollerResponder[armcontainerregistry.ImportPipelinesClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method ImportPipelinesClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, registryName string, importPipelineName string, options *armcontainerregistry.ImportPipelinesClientGetOptions) (resp azfake.Responder[armcontainerregistry.ImportPipelinesClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method ImportPipelinesClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, registryName string, options *armcontainerregistry.ImportPipelinesClientListOptions) (resp azfake.PagerResponder[armcontainerregistry.ImportPipelinesClientListResponse]) +} + +// NewImportPipelinesServerTransport creates a new instance of ImportPipelinesServerTransport with the provided implementation. +// The returned ImportPipelinesServerTransport instance is connected to an instance of armcontainerregistry.ImportPipelinesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewImportPipelinesServerTransport(srv *ImportPipelinesServer) *ImportPipelinesServerTransport { + return &ImportPipelinesServerTransport{ + srv: srv, + beginCreate: newTracker[azfake.PollerResponder[armcontainerregistry.ImportPipelinesClientCreateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armcontainerregistry.ImportPipelinesClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armcontainerregistry.ImportPipelinesClientListResponse]](), + } +} + +// ImportPipelinesServerTransport connects instances of armcontainerregistry.ImportPipelinesClient to instances of ImportPipelinesServer. +// Don't use this type directly, use NewImportPipelinesServerTransport instead. +type ImportPipelinesServerTransport struct { + srv *ImportPipelinesServer + beginCreate *tracker[azfake.PollerResponder[armcontainerregistry.ImportPipelinesClientCreateResponse]] + beginDelete *tracker[azfake.PollerResponder[armcontainerregistry.ImportPipelinesClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armcontainerregistry.ImportPipelinesClientListResponse]] +} + +// Do implements the policy.Transporter interface for ImportPipelinesServerTransport. +func (i *ImportPipelinesServerTransport) 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")} + } + + var resp *http.Response + var err error + + switch method { + case "ImportPipelinesClient.BeginCreate": + resp, err = i.dispatchBeginCreate(req) + case "ImportPipelinesClient.BeginDelete": + resp, err = i.dispatchBeginDelete(req) + case "ImportPipelinesClient.Get": + resp, err = i.dispatchGet(req) + case "ImportPipelinesClient.NewListPager": + resp, err = i.dispatchNewListPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (i *ImportPipelinesServerTransport) dispatchBeginCreate(req *http.Request) (*http.Response, error) { + if i.srv.BeginCreate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreate not implemented")} + } + beginCreate := i.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~%@]+)/importPipelines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armcontainerregistry.ImportPipeline](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 + } + importPipelineNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("importPipelineName")]) + if err != nil { + return nil, err + } + respr, errRespr := i.srv.BeginCreate(req.Context(), resourceGroupNameParam, registryNameParam, importPipelineNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreate = &respr + i.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) { + i.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) { + i.beginCreate.remove(req) + } + + return resp, nil +} + +func (i *ImportPipelinesServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if i.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := i.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~%@]+)/importPipelines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || 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 + } + importPipelineNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("importPipelineName")]) + if err != nil { + return nil, err + } + respr, errRespr := i.srv.BeginDelete(req.Context(), resourceGroupNameParam, registryNameParam, importPipelineNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + i.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) { + i.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) { + i.beginDelete.remove(req) + } + + return resp, nil +} + +func (i *ImportPipelinesServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if i.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~%@]+)/importPipelines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || 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 + } + importPipelineNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("importPipelineName")]) + if err != nil { + return nil, err + } + respr, errRespr := i.srv.Get(req.Context(), resourceGroupNameParam, registryNameParam, importPipelineNameParam, 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).ImportPipeline, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (i *ImportPipelinesServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if i.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := i.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~%@]+)/importPipelines` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + 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 := i.srv.NewListPager(resourceGroupNameParam, registryNameParam, nil) + newListPager = &resp + i.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armcontainerregistry.ImportPipelinesClientListResponse, 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) { + i.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + i.newListPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/pipelineruns_server.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/pipelineruns_server.go new file mode 100644 index 000000000000..0ac10a9514bd --- /dev/null +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/pipelineruns_server.go @@ -0,0 +1,272 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. 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" + "net/http" + "net/url" + "regexp" +) + +// PipelineRunsServer is a fake server for instances of the armcontainerregistry.PipelineRunsClient type. +type PipelineRunsServer struct { + // BeginCreate is the fake for method PipelineRunsClient.BeginCreate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreate func(ctx context.Context, resourceGroupName string, registryName string, pipelineRunName string, pipelineRunCreateParameters armcontainerregistry.PipelineRun, options *armcontainerregistry.PipelineRunsClientBeginCreateOptions) (resp azfake.PollerResponder[armcontainerregistry.PipelineRunsClientCreateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method PipelineRunsClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, registryName string, pipelineRunName string, options *armcontainerregistry.PipelineRunsClientBeginDeleteOptions) (resp azfake.PollerResponder[armcontainerregistry.PipelineRunsClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method PipelineRunsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, registryName string, pipelineRunName string, options *armcontainerregistry.PipelineRunsClientGetOptions) (resp azfake.Responder[armcontainerregistry.PipelineRunsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method PipelineRunsClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, registryName string, options *armcontainerregistry.PipelineRunsClientListOptions) (resp azfake.PagerResponder[armcontainerregistry.PipelineRunsClientListResponse]) +} + +// NewPipelineRunsServerTransport creates a new instance of PipelineRunsServerTransport with the provided implementation. +// The returned PipelineRunsServerTransport instance is connected to an instance of armcontainerregistry.PipelineRunsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewPipelineRunsServerTransport(srv *PipelineRunsServer) *PipelineRunsServerTransport { + return &PipelineRunsServerTransport{ + srv: srv, + beginCreate: newTracker[azfake.PollerResponder[armcontainerregistry.PipelineRunsClientCreateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armcontainerregistry.PipelineRunsClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armcontainerregistry.PipelineRunsClientListResponse]](), + } +} + +// PipelineRunsServerTransport connects instances of armcontainerregistry.PipelineRunsClient to instances of PipelineRunsServer. +// Don't use this type directly, use NewPipelineRunsServerTransport instead. +type PipelineRunsServerTransport struct { + srv *PipelineRunsServer + beginCreate *tracker[azfake.PollerResponder[armcontainerregistry.PipelineRunsClientCreateResponse]] + beginDelete *tracker[azfake.PollerResponder[armcontainerregistry.PipelineRunsClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armcontainerregistry.PipelineRunsClientListResponse]] +} + +// Do implements the policy.Transporter interface for PipelineRunsServerTransport. +func (p *PipelineRunsServerTransport) 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")} + } + + var resp *http.Response + var err error + + switch method { + case "PipelineRunsClient.BeginCreate": + resp, err = p.dispatchBeginCreate(req) + case "PipelineRunsClient.BeginDelete": + resp, err = p.dispatchBeginDelete(req) + case "PipelineRunsClient.Get": + resp, err = p.dispatchGet(req) + case "PipelineRunsClient.NewListPager": + resp, err = p.dispatchNewListPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (p *PipelineRunsServerTransport) dispatchBeginCreate(req *http.Request) (*http.Response, error) { + if p.srv.BeginCreate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreate not implemented")} + } + beginCreate := p.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~%@]+)/pipelineRuns/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armcontainerregistry.PipelineRun](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 + } + pipelineRunNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("pipelineRunName")]) + if err != nil { + return nil, err + } + respr, errRespr := p.srv.BeginCreate(req.Context(), resourceGroupNameParam, registryNameParam, pipelineRunNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreate = &respr + p.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) { + p.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) { + p.beginCreate.remove(req) + } + + return resp, nil +} + +func (p *PipelineRunsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if p.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := p.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~%@]+)/pipelineRuns/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || 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 + } + pipelineRunNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("pipelineRunName")]) + if err != nil { + return nil, err + } + respr, errRespr := p.srv.BeginDelete(req.Context(), resourceGroupNameParam, registryNameParam, pipelineRunNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + p.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) { + p.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) { + p.beginDelete.remove(req) + } + + return resp, nil +} + +func (p *PipelineRunsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if p.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~%@]+)/pipelineRuns/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || 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 + } + pipelineRunNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("pipelineRunName")]) + if err != nil { + return nil, err + } + respr, errRespr := p.srv.Get(req.Context(), resourceGroupNameParam, registryNameParam, pipelineRunNameParam, 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).PipelineRun, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (p *PipelineRunsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if p.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := p.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~%@]+)/pipelineRuns` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + 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 := p.srv.NewListPager(resourceGroupNameParam, registryNameParam, nil) + newListPager = &resp + p.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armcontainerregistry.PipelineRunsClientListResponse, 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) { + p.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + p.newListPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/server_factory.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/server_factory.go index 7364eda2aa49..41de5d2a1168 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/server_factory.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/server_factory.go @@ -20,9 +20,15 @@ import ( // ServerFactory is a fake server for instances of the armcontainerregistry.ClientFactory type. type ServerFactory struct { AgentPoolsServer AgentPoolsServer + ArchiveVersionsServer ArchiveVersionsServer + ArchivesServer ArchivesServer CacheRulesServer CacheRulesServer + ConnectedRegistriesServer ConnectedRegistriesServer CredentialSetsServer CredentialSetsServer + ExportPipelinesServer ExportPipelinesServer + ImportPipelinesServer ImportPipelinesServer OperationsServer OperationsServer + PipelineRunsServer PipelineRunsServer PrivateEndpointConnectionsServer PrivateEndpointConnectionsServer RegistriesServer RegistriesServer ReplicationsServer ReplicationsServer @@ -49,9 +55,15 @@ type ServerFactoryTransport struct { srv *ServerFactory trMu sync.Mutex trAgentPoolsServer *AgentPoolsServerTransport + trArchiveVersionsServer *ArchiveVersionsServerTransport + trArchivesServer *ArchivesServerTransport trCacheRulesServer *CacheRulesServerTransport + trConnectedRegistriesServer *ConnectedRegistriesServerTransport trCredentialSetsServer *CredentialSetsServerTransport + trExportPipelinesServer *ExportPipelinesServerTransport + trImportPipelinesServer *ImportPipelinesServerTransport trOperationsServer *OperationsServerTransport + trPipelineRunsServer *PipelineRunsServerTransport trPrivateEndpointConnectionsServer *PrivateEndpointConnectionsServerTransport trRegistriesServer *RegistriesServerTransport trReplicationsServer *ReplicationsServerTransport @@ -79,17 +91,43 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { case "AgentPoolsClient": initServer(s, &s.trAgentPoolsServer, func() *AgentPoolsServerTransport { return NewAgentPoolsServerTransport(&s.srv.AgentPoolsServer) }) resp, err = s.trAgentPoolsServer.Do(req) + case "ArchiveVersionsClient": + initServer(s, &s.trArchiveVersionsServer, func() *ArchiveVersionsServerTransport { + return NewArchiveVersionsServerTransport(&s.srv.ArchiveVersionsServer) + }) + resp, err = s.trArchiveVersionsServer.Do(req) + case "ArchivesClient": + initServer(s, &s.trArchivesServer, func() *ArchivesServerTransport { return NewArchivesServerTransport(&s.srv.ArchivesServer) }) + resp, err = s.trArchivesServer.Do(req) case "CacheRulesClient": initServer(s, &s.trCacheRulesServer, func() *CacheRulesServerTransport { return NewCacheRulesServerTransport(&s.srv.CacheRulesServer) }) resp, err = s.trCacheRulesServer.Do(req) + case "ConnectedRegistriesClient": + initServer(s, &s.trConnectedRegistriesServer, func() *ConnectedRegistriesServerTransport { + return NewConnectedRegistriesServerTransport(&s.srv.ConnectedRegistriesServer) + }) + resp, err = s.trConnectedRegistriesServer.Do(req) case "CredentialSetsClient": initServer(s, &s.trCredentialSetsServer, func() *CredentialSetsServerTransport { return NewCredentialSetsServerTransport(&s.srv.CredentialSetsServer) }) resp, err = s.trCredentialSetsServer.Do(req) + case "ExportPipelinesClient": + initServer(s, &s.trExportPipelinesServer, func() *ExportPipelinesServerTransport { + return NewExportPipelinesServerTransport(&s.srv.ExportPipelinesServer) + }) + resp, err = s.trExportPipelinesServer.Do(req) + case "ImportPipelinesClient": + initServer(s, &s.trImportPipelinesServer, func() *ImportPipelinesServerTransport { + return NewImportPipelinesServerTransport(&s.srv.ImportPipelinesServer) + }) + resp, err = s.trImportPipelinesServer.Do(req) case "OperationsClient": initServer(s, &s.trOperationsServer, func() *OperationsServerTransport { return NewOperationsServerTransport(&s.srv.OperationsServer) }) resp, err = s.trOperationsServer.Do(req) + case "PipelineRunsClient": + initServer(s, &s.trPipelineRunsServer, func() *PipelineRunsServerTransport { return NewPipelineRunsServerTransport(&s.srv.PipelineRunsServer) }) + resp, err = s.trPipelineRunsServer.Do(req) case "PrivateEndpointConnectionsClient": initServer(s, &s.trPrivateEndpointConnectionsServer, func() *PrivateEndpointConnectionsServerTransport { return NewPrivateEndpointConnectionsServerTransport(&s.srv.PrivateEndpointConnectionsServer) diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/importpipelines_client.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/importpipelines_client.go new file mode 100644 index 000000000000..cbca943d0a90 --- /dev/null +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/importpipelines_client.go @@ -0,0 +1,346 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. 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" +) + +// ImportPipelinesClient contains the methods for the ImportPipelines group. +// Don't use this type directly, use NewImportPipelinesClient() instead. +type ImportPipelinesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewImportPipelinesClient creates a new instance of ImportPipelinesClient 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 - pass nil to accept the default values. +func NewImportPipelinesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ImportPipelinesClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ImportPipelinesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreate - Creates an import pipeline for a container registry with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - The name of the container registry. +// - importPipelineName - The name of the import pipeline. +// - importPipelineCreateParameters - The parameters for creating an import pipeline. +// - options - ImportPipelinesClientBeginCreateOptions contains the optional parameters for the ImportPipelinesClient.BeginCreate +// method. +func (client *ImportPipelinesClient) BeginCreate(ctx context.Context, resourceGroupName string, registryName string, importPipelineName string, importPipelineCreateParameters ImportPipeline, options *ImportPipelinesClientBeginCreateOptions) (*runtime.Poller[ImportPipelinesClientCreateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.create(ctx, resourceGroupName, registryName, importPipelineName, importPipelineCreateParameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ImportPipelinesClientCreateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ImportPipelinesClientCreateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Create - Creates an import pipeline for a container registry with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-11-01-preview +func (client *ImportPipelinesClient) create(ctx context.Context, resourceGroupName string, registryName string, importPipelineName string, importPipelineCreateParameters ImportPipeline, options *ImportPipelinesClientBeginCreateOptions) (*http.Response, error) { + var err error + const operationName = "ImportPipelinesClient.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, importPipelineName, importPipelineCreateParameters, 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 *ImportPipelinesClient) createCreateRequest(ctx context.Context, resourceGroupName string, registryName string, importPipelineName string, importPipelineCreateParameters ImportPipeline, options *ImportPipelinesClientBeginCreateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName}" + 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 importPipelineName == "" { + return nil, errors.New("parameter importPipelineName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{importPipelineName}", url.PathEscape(importPipelineName)) + 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", "2023-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, importPipelineCreateParameters); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Deletes an import pipeline from a container registry. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - The name of the container registry. +// - importPipelineName - The name of the import pipeline. +// - options - ImportPipelinesClientBeginDeleteOptions contains the optional parameters for the ImportPipelinesClient.BeginDelete +// method. +func (client *ImportPipelinesClient) BeginDelete(ctx context.Context, resourceGroupName string, registryName string, importPipelineName string, options *ImportPipelinesClientBeginDeleteOptions) (*runtime.Poller[ImportPipelinesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, registryName, importPipelineName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ImportPipelinesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ImportPipelinesClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Deletes an import pipeline from a container registry. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-11-01-preview +func (client *ImportPipelinesClient) deleteOperation(ctx context.Context, resourceGroupName string, registryName string, importPipelineName string, options *ImportPipelinesClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "ImportPipelinesClient.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, importPipelineName, 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.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ImportPipelinesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, registryName string, importPipelineName string, options *ImportPipelinesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName}" + 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 importPipelineName == "" { + return nil, errors.New("parameter importPipelineName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{importPipelineName}", url.PathEscape(importPipelineName)) + 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", "2023-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the properties of the import pipeline. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - The name of the container registry. +// - importPipelineName - The name of the import pipeline. +// - options - ImportPipelinesClientGetOptions contains the optional parameters for the ImportPipelinesClient.Get method. +func (client *ImportPipelinesClient) Get(ctx context.Context, resourceGroupName string, registryName string, importPipelineName string, options *ImportPipelinesClientGetOptions) (ImportPipelinesClientGetResponse, error) { + var err error + const operationName = "ImportPipelinesClient.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, importPipelineName, options) + if err != nil { + return ImportPipelinesClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ImportPipelinesClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ImportPipelinesClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *ImportPipelinesClient) getCreateRequest(ctx context.Context, resourceGroupName string, registryName string, importPipelineName string, options *ImportPipelinesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName}" + 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 importPipelineName == "" { + return nil, errors.New("parameter importPipelineName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{importPipelineName}", url.PathEscape(importPipelineName)) + 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", "2023-11-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 *ImportPipelinesClient) getHandleResponse(resp *http.Response) (ImportPipelinesClientGetResponse, error) { + result := ImportPipelinesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ImportPipeline); err != nil { + return ImportPipelinesClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Lists all import pipelines for the specified container registry. +// +// Generated from API version 2023-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - The name of the container registry. +// - options - ImportPipelinesClientListOptions contains the optional parameters for the ImportPipelinesClient.NewListPager +// method. +func (client *ImportPipelinesClient) NewListPager(resourceGroupName string, registryName string, options *ImportPipelinesClientListOptions) *runtime.Pager[ImportPipelinesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ImportPipelinesClientListResponse]{ + More: func(page ImportPipelinesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ImportPipelinesClientListResponse) (ImportPipelinesClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ImportPipelinesClient.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 ImportPipelinesClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *ImportPipelinesClient) listCreateRequest(ctx context.Context, resourceGroupName string, registryName string, options *ImportPipelinesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines" + 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", "2023-11-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 *ImportPipelinesClient) listHandleResponse(resp *http.Response) (ImportPipelinesClientListResponse, error) { + result := ImportPipelinesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ImportPipelineListResult); err != nil { + return ImportPipelinesClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/importpipelines_client_example_test.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/importpipelines_client_example_test.go new file mode 100644 index 000000000000..7f554176edaa --- /dev/null +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/importpipelines_client_example_test.go @@ -0,0 +1,227 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// 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" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ImportPipelineList.json +func ExampleImportPipelinesClient_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.NewImportPipelinesClient().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.ImportPipelineListResult = armcontainerregistry.ImportPipelineListResult{ + // Value: []*armcontainerregistry.ImportPipeline{ + // { + // Name: to.Ptr("myImportPipeline"), + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/importPipelines"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/importPipelines/myImportPipeline"), + // Identity: &armcontainerregistry.IdentityProperties{ + // Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeUserAssigned), + // UserAssignedIdentities: map[string]*armcontainerregistry.UserIdentityProperties{ + // "/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourcegroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2": &armcontainerregistry.UserIdentityProperties{ + // ClientID: to.Ptr("d3ce1bc2-f7d7-4a5b-9979-950f4e57680e"), + // PrincipalID: to.Ptr("b6p9f58b-6fbf-4efd-a7e0-fvd46911a466"), + // }, + // }, + // }, + // Location: to.Ptr("westus"), + // Properties: &armcontainerregistry.ImportPipelineProperties{ + // Options: []*armcontainerregistry.PipelineOptions{ + // to.Ptr(armcontainerregistry.PipelineOptionsOverwriteTags), + // to.Ptr(armcontainerregistry.PipelineOptionsDeleteSourceBlobOnSuccess), + // to.Ptr(armcontainerregistry.PipelineOptionsContinueOnErrors)}, + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // Source: &armcontainerregistry.ImportPipelineSourceProperties{ + // Type: to.Ptr(armcontainerregistry.PipelineSourceTypeAzureStorageBlobContainer), + // KeyVaultURI: to.Ptr("https://myvault.vault.azure.net/secrets/acrimportsas"), + // URI: to.Ptr("https://accountname.blob.core.windows.net/containername"), + // }, + // Trigger: &armcontainerregistry.PipelineTriggerProperties{ + // SourceTrigger: &armcontainerregistry.PipelineSourceTriggerProperties{ + // Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled), + // }, + // }, + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ImportPipelineGet.json +func ExampleImportPipelinesClient_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.NewImportPipelinesClient().Get(ctx, "myResourceGroup", "myRegistry", "myImportPipeline", 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.ImportPipeline = armcontainerregistry.ImportPipeline{ + // Name: to.Ptr("myImportPipeline"), + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/importPipelines"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/importPipelines/myImportPipeline"), + // Identity: &armcontainerregistry.IdentityProperties{ + // Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeUserAssigned), + // UserAssignedIdentities: map[string]*armcontainerregistry.UserIdentityProperties{ + // "/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourcegroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2": &armcontainerregistry.UserIdentityProperties{ + // ClientID: to.Ptr("d3ce1bc2-f7d7-4a5b-9979-950f4e57680e"), + // PrincipalID: to.Ptr("b6p9f58b-6fbf-4efd-a7e0-fvd46911a466"), + // }, + // }, + // }, + // Location: to.Ptr("westus"), + // Properties: &armcontainerregistry.ImportPipelineProperties{ + // Options: []*armcontainerregistry.PipelineOptions{ + // to.Ptr(armcontainerregistry.PipelineOptionsOverwriteTags), + // to.Ptr(armcontainerregistry.PipelineOptionsDeleteSourceBlobOnSuccess), + // to.Ptr(armcontainerregistry.PipelineOptionsContinueOnErrors)}, + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // Source: &armcontainerregistry.ImportPipelineSourceProperties{ + // Type: to.Ptr(armcontainerregistry.PipelineSourceTypeAzureStorageBlobContainer), + // KeyVaultURI: to.Ptr("https://myvault.vault.azure.net/secrets/acrimportsas"), + // URI: to.Ptr("https://accountname.blob.core.windows.net/containername"), + // }, + // Trigger: &armcontainerregistry.PipelineTriggerProperties{ + // SourceTrigger: &armcontainerregistry.PipelineSourceTriggerProperties{ + // Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled), + // }, + // }, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ImportPipelineCreate.json +func ExampleImportPipelinesClient_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) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewImportPipelinesClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", "myImportPipeline", armcontainerregistry.ImportPipeline{ + Identity: &armcontainerregistry.IdentityProperties{ + Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeUserAssigned), + UserAssignedIdentities: map[string]*armcontainerregistry.UserIdentityProperties{ + "/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourcegroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2": {}, + }, + }, + Location: to.Ptr("westus"), + Properties: &armcontainerregistry.ImportPipelineProperties{ + Options: []*armcontainerregistry.PipelineOptions{ + to.Ptr(armcontainerregistry.PipelineOptionsOverwriteTags), + to.Ptr(armcontainerregistry.PipelineOptionsDeleteSourceBlobOnSuccess), + to.Ptr(armcontainerregistry.PipelineOptionsContinueOnErrors)}, + Source: &armcontainerregistry.ImportPipelineSourceProperties{ + Type: to.Ptr(armcontainerregistry.PipelineSourceTypeAzureStorageBlobContainer), + KeyVaultURI: to.Ptr("https://myvault.vault.azure.net/secrets/acrimportsas"), + URI: to.Ptr("https://accountname.blob.core.windows.net/containername"), + }, + }, + }, 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.ImportPipeline = armcontainerregistry.ImportPipeline{ + // Name: to.Ptr("myImportPipeline"), + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/importPipelines"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/importPipelines/myImportPipeline"), + // Identity: &armcontainerregistry.IdentityProperties{ + // Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeUserAssigned), + // UserAssignedIdentities: map[string]*armcontainerregistry.UserIdentityProperties{ + // "/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourcegroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2": &armcontainerregistry.UserIdentityProperties{ + // ClientID: to.Ptr("d3ce1bc2-f7d7-4a5b-9979-950f4e57680e"), + // PrincipalID: to.Ptr("b6p9f58b-6fbf-4efd-a7e0-fvd46911a466"), + // }, + // }, + // }, + // Location: to.Ptr("westus"), + // Properties: &armcontainerregistry.ImportPipelineProperties{ + // Options: []*armcontainerregistry.PipelineOptions{ + // to.Ptr(armcontainerregistry.PipelineOptionsOverwriteTags), + // to.Ptr(armcontainerregistry.PipelineOptionsDeleteSourceBlobOnSuccess), + // to.Ptr(armcontainerregistry.PipelineOptionsContinueOnErrors)}, + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // Source: &armcontainerregistry.ImportPipelineSourceProperties{ + // Type: to.Ptr(armcontainerregistry.PipelineSourceTypeAzureStorageBlobContainer), + // KeyVaultURI: to.Ptr("https://myvault.vault.azure.net/secrets/acrimportsas"), + // URI: to.Ptr("https://accountname.blob.core.windows.net/containername"), + // }, + // Trigger: &armcontainerregistry.PipelineTriggerProperties{ + // SourceTrigger: &armcontainerregistry.PipelineSourceTriggerProperties{ + // Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled), + // }, + // }, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ImportPipelineDelete.json +func ExampleImportPipelinesClient_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.NewImportPipelinesClient().BeginDelete(ctx, "myResourceGroup", "myRegistry", "myImportPipeline", 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/models.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/models.go index f5c28b280a4d..c11da57fc2ed 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/models.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/models.go @@ -10,6 +10,12 @@ package armcontainerregistry import "time" +// ActivationProperties - The activation properties of the connected registry. +type ActivationProperties struct { + // READ-ONLY; The activation status of the connected registry. + Status *ActivationStatus +} + // Actor - The agent that initiated the event. For most situations, this could be from the authorization context of the request. type Actor struct { // The subject or username associated with the request context that generated the event. @@ -94,6 +100,108 @@ type AgentProperties struct { CPU *int32 } +// Archive - An object that represents a archive for a container registry. +type Archive struct { + // The properties of the archive. + Properties *ArchiveProperties + + // READ-ONLY; The resource ID. + ID *string + + // READ-ONLY; The name of the resource. + Name *string + + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData + + // READ-ONLY; The type of the resource. + Type *string +} + +// ArchiveListResult - The result of a request to list archives for a container registry. +type ArchiveListResult struct { + // The URI that can be used to request the next list of archives. + NextLink *string + + // The list of archives. Since this list may be incomplete, the nextLink field should be used to request the next list of + // distributions. + Value []*Archive +} + +// ArchivePackageSourceProperties - The properties of the archive package source. +type ArchivePackageSourceProperties struct { + // The type of package source for a archive. + Type *PackageSourceType + + // The external repository url. + URL *string +} + +// ArchiveProperties - The properties of a archive. +type ArchiveProperties struct { + // The package source of the archive. + PackageSource *ArchivePackageSourceProperties + + // The published version of the archive. + PublishedVersion *string + RepositoryEndpointPrefix *string + + // READ-ONLY; The provisioning state of the archive at the time the operation was called. + ProvisioningState *ProvisioningState + + // READ-ONLY + RepositoryEndpoint *string +} + +// ArchiveUpdateParameters - The parameters for updating a archive. +type ArchiveUpdateParameters struct { + // The properties of the connected registry update parameters. + Properties *ArchiveUpdateProperties +} + +// ArchiveUpdateProperties - The properties of a archive. +type ArchiveUpdateProperties struct { + // The published version of the archive. + PublishedVersion *string +} + +// ArchiveVersion - An object that represents an export pipeline for a container registry. +type ArchiveVersion struct { + // The properties of the archive. + Properties *ArchiveVersionProperties + + // READ-ONLY; The resource ID. + ID *string + + // READ-ONLY; The name of the resource. + Name *string + + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData + + // READ-ONLY; The type of the resource. + Type *string +} + +// ArchiveVersionListResult - The result of a request to list export pipelines for a container registry. +type ArchiveVersionListResult struct { + // The URI that can be used to request the next list of pipeline runs. + NextLink *string + + // The list of export pipelines. Since this list may be incomplete, the nextLink field should be used to request the next + // list of export pipelines. + Value []*ArchiveVersion +} + +// ArchiveVersionProperties - The properties of an export pipeline. +type ArchiveVersionProperties struct { + // The detailed error message for the archive version in the case of failure. + ArchiveVersionErrorMessage *string + + // READ-ONLY; The provisioning state of the archive at the time the operation was called. + ProvisioningState *ProvisioningState +} + // Argument - The properties of a run argument. type Argument struct { // REQUIRED; The name of the argument. @@ -157,6 +265,12 @@ type AuthInfoUpdateParameters struct { TokenType *TokenType } +// AzureADAuthenticationAsArmPolicy - The policy for using ARM 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. @@ -277,6 +391,94 @@ type CallbackConfig struct { CustomHeaders map[string]*string } +// ConnectedRegistry - An object that represents a connected registry for a container registry. +type ConnectedRegistry struct { + // The properties of the connected registry. + Properties *ConnectedRegistryProperties + + // READ-ONLY; The resource ID. + ID *string + + // READ-ONLY; The name of the resource. + Name *string + + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData + + // READ-ONLY; The type of the resource. + Type *string +} + +// ConnectedRegistryListResult - The result of a request to list connected registries for a container registry. +type ConnectedRegistryListResult struct { + // The URI that can be used to request the next list of connected registries. + NextLink *string + + // The list of connected registries. Since this list may be incomplete, the nextLink field should be used to request the next + // list of connected registries. + Value []*ConnectedRegistry +} + +// ConnectedRegistryProperties - The properties of a connected registry. +type ConnectedRegistryProperties struct { + // REQUIRED; The mode of the connected registry resource that indicates the permissions of the registry. + Mode *ConnectedRegistryMode + + // REQUIRED; The parent of the connected registry. + Parent *ParentProperties + + // The list of the ACR token resource IDs used to authenticate clients to the connected registry. + ClientTokenIDs []*string + + // The logging properties of the connected registry. + Logging *LoggingProperties + + // The login server properties of the connected registry. + LoginServer *LoginServerProperties + + // The list of notifications subscription information for the connected registry. + NotificationsList []*string + + // READ-ONLY; The activation properties of the connected registry. + Activation *ActivationProperties + + // READ-ONLY; The current connection state of the connected registry. + ConnectionState *ConnectionState + + // READ-ONLY; The last activity time of the connected registry. + LastActivityTime *time.Time + + // READ-ONLY; Provisioning state of the resource. + ProvisioningState *ProvisioningState + + // READ-ONLY; The list of current statuses of the connected registry. + StatusDetails []*StatusDetailProperties + + // READ-ONLY; The current version of ACR runtime on the connected registry. + Version *string +} + +// ConnectedRegistryUpdateParameters - The parameters for updating a connected registry. +type ConnectedRegistryUpdateParameters struct { + // The properties of the connected registry update parameters. + Properties *ConnectedRegistryUpdateProperties +} + +// ConnectedRegistryUpdateProperties - The parameters for updating token properties. +type ConnectedRegistryUpdateProperties struct { + // The list of the ACR token resource IDs used to authenticate clients to the connected registry. + ClientTokenIDs []*string + + // The logging properties of the connected registry. + Logging *LoggingProperties + + // The list of notifications subscription information for the connected registry. + NotificationsList []*string + + // The sync properties of the connected registry with its parent. + SyncProperties *SyncUpdateProperties +} + // CredentialHealth - The health of the auth credential. type CredentialHealth struct { // Error code representing the health check error. @@ -729,6 +931,66 @@ type EventResponseMessage struct { Version *string } +// ExportPipeline - An object that represents an export pipeline for a container registry. +type ExportPipeline struct { + // The identity of the export pipeline. + Identity *IdentityProperties + + // The location of the export pipeline. + Location *string + + // The properties of the export pipeline. + Properties *ExportPipelineProperties + + // READ-ONLY; The resource ID. + ID *string + + // READ-ONLY; The name of the resource. + Name *string + + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData + + // READ-ONLY; The type of the resource. + Type *string +} + +// ExportPipelineListResult - The result of a request to list export pipelines for a container registry. +type ExportPipelineListResult struct { + // The URI that can be used to request the next list of pipeline runs. + NextLink *string + + // The list of export pipelines. Since this list may be incomplete, the nextLink field should be used to request the next + // list of export pipelines. + Value []*ExportPipeline +} + +// ExportPipelineProperties - The properties of an export pipeline. +type ExportPipelineProperties struct { + // REQUIRED; The target properties of the export pipeline. + Target *ExportPipelineTargetProperties + + // The list of all options configured for the pipeline. + Options []*PipelineOptions + + // READ-ONLY; The provisioning state of the pipeline at the time the operation was called. + ProvisioningState *ProvisioningState +} + +// ExportPipelineTargetProperties - The properties of the export pipeline target. +type ExportPipelineTargetProperties struct { + // REQUIRED; They key vault secret uri to obtain the target storage SAS token. + KeyVaultURI *string + + // The type of target for the export pipeline. + Type *string + + // The target uri of the export pipeline. When 'AzureStorageBlob': "https://accountName.blob.core.windows.net/containerName/blobName" + // When 'AzureStorageBlobContainer': + // "https://accountName.blob.core.windows.net/containerName" + URI *string +} + // ExportPolicy - The export policy for a container registry. type ExportPolicy struct { // The value that indicates whether the policy is enabled or not. @@ -940,6 +1202,69 @@ type ImportImageParameters struct { UntaggedTargetRepositories []*string } +// ImportPipeline - An object that represents an import pipeline for a container registry. +type ImportPipeline struct { + // The identity of the import pipeline. + Identity *IdentityProperties + + // The location of the import pipeline. + Location *string + + // The properties of the import pipeline. + Properties *ImportPipelineProperties + + // READ-ONLY; The resource ID. + ID *string + + // READ-ONLY; The name of the resource. + Name *string + + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData + + // READ-ONLY; The type of the resource. + Type *string +} + +// ImportPipelineListResult - The result of a request to list import pipelines for a container registry. +type ImportPipelineListResult struct { + // The URI that can be used to request the next list of pipeline runs. + NextLink *string + + // The list of import pipelines. Since this list may be incomplete, the nextLink field should be used to request the next + // list of import pipelines. + Value []*ImportPipeline +} + +// ImportPipelineProperties - The properties of an import pipeline. +type ImportPipelineProperties struct { + // REQUIRED; The source properties of the import pipeline. + Source *ImportPipelineSourceProperties + + // The list of all options configured for the pipeline. + Options []*PipelineOptions + + // The properties that describe the trigger of the import pipeline. + Trigger *PipelineTriggerProperties + + // READ-ONLY; The provisioning state of the pipeline at the time the operation was called. + ProvisioningState *ProvisioningState +} + +// ImportPipelineSourceProperties - The properties of the import pipeline source. +type ImportPipelineSourceProperties struct { + // REQUIRED; They key vault secret uri to obtain the source storage SAS token. + KeyVaultURI *string + + // The type of source for the import pipeline. + Type *PipelineSourceType + + // The source uri of the import pipeline. When 'AzureStorageBlob': "https://accountName.blob.core.windows.net/containerName/blobName" + // When 'AzureStorageBlobContainer': + // "https://accountName.blob.core.windows.net/containerName" + URI *string +} + 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 @@ -981,6 +1306,24 @@ type KeyVaultProperties struct { VersionedKeyIdentifier *string } +// LoggingProperties - The logging properties of the connected registry. +type LoggingProperties struct { + // Indicates whether audit logs are enabled on the connected registry. + AuditLogStatus *AuditLogStatus + + // The verbosity of logs persisted on the connected registry. + LogLevel *LogLevel +} + +// LoginServerProperties - The login server properties of the connected registry. +type LoginServerProperties struct { + // READ-ONLY; The host of the connected registry. Can be FQDN or IP. + Host *string + + // READ-ONLY; The TLS properties of the connected registry login server. + TLS *TLSProperties +} + // NetworkRuleSet - The network rule set for a container registry. type NetworkRuleSet struct { // REQUIRED; The default action of allow or deny when no other rules match. @@ -1101,6 +1444,147 @@ type OverrideTaskStepProperties struct { Values []*SetValue } +// ParentProperties - The properties of the connected registry parent. +type ParentProperties struct { + // REQUIRED; The sync properties of the connected registry with its parent. + SyncProperties *SyncProperties + + // The resource ID of the parent to which the connected registry will be associated. + ID *string +} + +// PipelineRun - An object that represents a pipeline run for a container registry. +type PipelineRun struct { + // The properties of a pipeline run. + Properties *PipelineRunProperties + + // READ-ONLY; The resource ID. + ID *string + + // READ-ONLY; The name of the resource. + Name *string + + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData + + // READ-ONLY; The type of the resource. + Type *string +} + +// PipelineRunListResult - The result of a request to list pipeline runs for a container registry. +type PipelineRunListResult struct { + // The URI that can be used to request the next list of pipeline runs. + NextLink *string + + // The list of pipeline runs. Since this list may be incomplete, the nextLink field should be used to request the next list + // of pipeline runs. + Value []*PipelineRun +} + +// PipelineRunProperties - The properties of a pipeline run. +type PipelineRunProperties struct { + // How the pipeline run should be forced to recreate even if the pipeline run configuration has not changed. + ForceUpdateTag *string + + // The request parameters for a pipeline run. + Request *PipelineRunRequest + + // READ-ONLY; The provisioning state of a pipeline run. + ProvisioningState *ProvisioningState + + // READ-ONLY; The response of a pipeline run. + Response *PipelineRunResponse +} + +// PipelineRunRequest - The request properties provided for a pipeline run. +type PipelineRunRequest struct { + // List of source artifacts to be transferred by the pipeline. 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'). + Artifacts []*string + + // The digest of the tar used to transfer the artifacts. + CatalogDigest *string + + // The resource ID of the pipeline to run. + PipelineResourceID *string + + // The source properties of the pipeline run. + Source *PipelineRunSourceProperties + + // The target properties of the pipeline run. + Target *PipelineRunTargetProperties +} + +// PipelineRunResponse - The response properties returned for a pipeline run. +type PipelineRunResponse struct { + // The digest of the tar used to transfer the artifacts. + CatalogDigest *string + + // The time the pipeline run finished. + FinishTime *time.Time + + // The artifacts imported in the pipeline run. + ImportedArtifacts []*string + + // The detailed error message for the pipeline run in the case of failure. + PipelineRunErrorMessage *string + + // The current progress of the copy operation. + Progress *ProgressProperties + + // The source of the pipeline run. + Source *ImportPipelineSourceProperties + + // The time the pipeline run started. + StartTime *time.Time + + // The current status of the pipeline run. + Status *string + + // The target of the pipeline run. + Target *ExportPipelineTargetProperties + + // The trigger that caused the pipeline run. + Trigger *PipelineTriggerDescriptor +} + +type PipelineRunSourceProperties struct { + // The name of the source. + Name *string + + // The type of the source. + Type *PipelineRunSourceType +} + +type PipelineRunTargetProperties struct { + // The name of the target. + Name *string + + // The type of the target. + Type *PipelineRunTargetType +} + +type PipelineSourceTriggerDescriptor struct { + // The timestamp when the source update happened. + Timestamp *time.Time +} + +type PipelineSourceTriggerProperties struct { + // REQUIRED; The current status of the source trigger. + Status *TriggerStatus +} + +type PipelineTriggerDescriptor struct { + // The source trigger that caused the pipeline run. + SourceTrigger *PipelineSourceTriggerDescriptor +} + +type PipelineTriggerProperties struct { + // The source trigger properties of the pipeline. + SourceTrigger *PipelineSourceTriggerProperties +} + // PlatformProperties - The platform properties against which the run has to happen. type PlatformProperties struct { // REQUIRED; The operating system type required for the run. @@ -1127,6 +1611,9 @@ type PlatformUpdateParameters struct { // Policies - The policies for a container registry. type Policies struct { + // The policy for using ARM audience token for a container registry. + AzureADAuthenticationAsArmPolicy *AzureADAuthenticationAsArmPolicy + // The export policy for a container registry. ExportPolicy *ExportPolicy @@ -1136,6 +1623,9 @@ type Policies struct { // The retention policy for a container registry. RetentionPolicy *RetentionPolicy + // The soft delete policy for a container registry. + SoftDeletePolicy *SoftDeletePolicy + // The content trust policy for a container registry. TrustPolicy *TrustPolicy } @@ -1235,6 +1725,11 @@ type PrivateLinkServiceConnectionState struct { Status *ConnectionStatus } +type ProgressProperties struct { + // The percentage complete of the copy operation. + Percentage *string +} + // QuarantinePolicy - The quarantine policy for a container registry. type QuarantinePolicy struct { // The value that indicates whether the policy is enabled or not. @@ -1332,12 +1827,18 @@ type RegistryProperties struct { // The value that indicates whether the admin user is enabled. AdminUserEnabled *bool + // Enables registry-wide pull from unauthenticated clients. + AnonymousPullEnabled *bool + // Enable a single data endpoint per region for serving data. DataEndpointEnabled *bool // The encryption settings of container registry. Encryption *EncryptionProperty + // Determines whether registry artifacts are indexed for metadata search. + MetadataSearch *MetadataSearch + // Whether to allow trusted Azure services to access a network restricted registry. NetworkRuleBypassOptions *NetworkRuleBypassOptions @@ -1377,12 +1878,18 @@ type RegistryPropertiesUpdateParameters struct { // The value that indicates whether the admin user is enabled. AdminUserEnabled *bool + // Enables registry-wide pull from unauthenticated clients. + AnonymousPullEnabled *bool + // Enable a single data endpoint per region for serving data. DataEndpointEnabled *bool // The encryption settings of container registry. Encryption *EncryptionProperty + // Determines whether registry artifacts are indexed for metadata search. + MetadataSearch *MetadataSearch + // Whether to allow trusted Azure services to access a network restricted registry. NetworkRuleBypassOptions *NetworkRuleBypassOptions @@ -1782,6 +2289,18 @@ type SetValue struct { IsSecret *bool } +// SoftDeletePolicy - The soft delete policy for a container registry +type SoftDeletePolicy struct { + // The number of days after which a soft-deleted item is permanently deleted. + RetentionDays *int32 + + // The value that indicates whether the policy is enabled or not. + Status *PolicyStatus + + // READ-ONLY; The timestamp when the policy was last updated. + LastUpdatedTime *time.Time +} + // Source - The registry node that generated the event. Put differently, while the actor initiates the event, the source generates // it. type Source struct { @@ -1906,6 +2425,61 @@ type Status struct { Timestamp *time.Time } +// StatusDetailProperties - The status detail properties of the connected registry. +type StatusDetailProperties struct { + // READ-ONLY; The code of the status. + Code *string + + // READ-ONLY; The correlation ID of the status. + CorrelationID *string + + // READ-ONLY; The description of the status. + Description *string + + // READ-ONLY; The timestamp of the status. + Timestamp *time.Time + + // READ-ONLY; The component of the connected registry corresponding to the status. + Type *string +} + +// SyncProperties - The sync properties of the connected registry with its parent. +type SyncProperties struct { + // REQUIRED; The period of time for which a message is available to sync before it is expired. Specify the duration using + // the format P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601. + MessageTTL *string + + // REQUIRED; The resource ID of the ACR token used to authenticate the connected registry to its parent during sync. + TokenID *string + + // The cron expression indicating the schedule that the connected registry will sync with its parent. + Schedule *string + + // The time window during which sync is enabled for each schedule occurrence. Specify the duration using the format P[n]Y[n]M[n]DT[n]H[n]M[n]S + // as per ISO8601. + SyncWindow *string + + // READ-ONLY; The gateway endpoint used by the connected registry to communicate with its parent. + GatewayEndpoint *string + + // READ-ONLY; The last time a sync occurred between the connected registry and its parent. + LastSyncTime *time.Time +} + +// SyncUpdateProperties - The parameters for updating the sync properties of the connected registry with its parent. +type SyncUpdateProperties struct { + // The period of time for which a message is available to sync before it is expired. Specify the duration using the format + // P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601. + MessageTTL *string + + // The cron expression indicating the schedule that the connected registry will sync with its parent. + Schedule *string + + // The time window during which sync is enabled for each schedule occurrence. Specify the duration using the format P[n]Y[n]M[n]DT[n]H[n]M[n]S + // as per ISO8601. + SyncWindow *string +} + // SystemData - Metadata pertaining to creation and last modification of the resource. type SystemData struct { // The timestamp of resource creation (UTC). @@ -1927,6 +2501,24 @@ type SystemData struct { LastModifiedByType *LastModifiedByType } +// TLSCertificateProperties - The TLS certificate properties of the connected registry login server. +type TLSCertificateProperties struct { + // READ-ONLY; Indicates the location of the certificates. + Location *string + + // READ-ONLY; The type of certificate location. + Type *CertificateType +} + +// TLSProperties - The TLS properties of the connected registry login server. +type TLSProperties struct { + // READ-ONLY; The certificate used to configure HTTPS for the login server. + Certificate *TLSCertificateProperties + + // READ-ONLY; Indicates whether HTTPS is enabled for the login server. + Status *TLSStatus +} + // Target - The target of the event. type Target struct { // The digest of the content, as defined by the Registry V2 HTTP API Specification. diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/models_serde.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/models_serde.go index 19e9b7a57db0..521e39dd22d1 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/models_serde.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/models_serde.go @@ -15,6 +15,33 @@ import ( "reflect" ) +// MarshalJSON implements the json.Marshaller interface for type ActivationProperties. +func (a ActivationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "status", a.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ActivationProperties. +func (a *ActivationProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "status": + err = unpopulate(val, "Status", &a.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Actor. func (a Actor) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -279,17 +306,19 @@ func (a *AgentProperties) UnmarshalJSON(data []byte) error { 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 Archive. +func (a Archive) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "isSecret", a.IsSecret) + populate(objectMap, "id", a.ID) populate(objectMap, "name", a.Name) - populate(objectMap, "value", a.Value) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "type", a.Type) 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 Archive. +func (a *Archive) 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) @@ -297,14 +326,20 @@ func (a *Argument) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "isSecret": - err = unpopulate(val, "IsSecret", &a.IsSecret) + case "id": + err = unpopulate(val, "ID", &a.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &a.Name) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &a.Value) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) delete(rawMsg, key) } if err != nil { @@ -314,18 +349,16 @@ func (a *Argument) UnmarshalJSON(data []byte) error { 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 ArchiveListResult. +func (a ArchiveListResult) 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, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) 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 ArchiveListResult. +func (a *ArchiveListResult) 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) @@ -333,17 +366,11 @@ func (a *AuthCredential) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "credentialHealth": - err = unpopulate(val, "CredentialHealth", &a.CredentialHealth) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "passwordSecretIdentifier": - err = unpopulate(val, "PasswordSecretIdentifier", &a.PasswordSecretIdentifier) + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) delete(rawMsg, key) - case "usernameSecretIdentifier": - err = unpopulate(val, "UsernameSecretIdentifier", &a.UsernameSecretIdentifier) + case "value": + err = unpopulate(val, "Value", &a.Value) delete(rawMsg, key) } if err != nil { @@ -353,19 +380,16 @@ func (a *AuthCredential) UnmarshalJSON(data []byte) error { 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 ArchivePackageSourceProperties. +func (a ArchivePackageSourceProperties) 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, "type", a.Type) + populate(objectMap, "url", a.URL) 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 ArchivePackageSourceProperties. +func (a *ArchivePackageSourceProperties) 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) @@ -373,20 +397,11 @@ func (a *AuthInfo) UnmarshalJSON(data []byte) error { 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 "type": + err = unpopulate(val, "Type", &a.Type) delete(rawMsg, key) - case "tokenType": - err = unpopulate(val, "TokenType", &a.TokenType) + case "url": + err = unpopulate(val, "URL", &a.URL) delete(rawMsg, key) } if err != nil { @@ -396,19 +411,19 @@ func (a *AuthInfo) UnmarshalJSON(data []byte) error { 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 ArchiveProperties. +func (a ArchiveProperties) 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, "packageSource", a.PackageSource) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "publishedVersion", a.PublishedVersion) + populate(objectMap, "repositoryEndpoint", a.RepositoryEndpoint) + populate(objectMap, "repositoryEndpointPrefix", a.RepositoryEndpointPrefix) 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 ArchiveProperties. +func (a *ArchiveProperties) 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) @@ -416,20 +431,20 @@ func (a *AuthInfoUpdateParameters) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "expiresIn": - err = unpopulate(val, "ExpiresIn", &a.ExpiresIn) + case "packageSource": + err = unpopulate(val, "PackageSource", &a.PackageSource) delete(rawMsg, key) - case "refreshToken": - err = unpopulate(val, "RefreshToken", &a.RefreshToken) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) delete(rawMsg, key) - case "scope": - err = unpopulate(val, "Scope", &a.Scope) + case "publishedVersion": + err = unpopulate(val, "PublishedVersion", &a.PublishedVersion) delete(rawMsg, key) - case "token": - err = unpopulate(val, "Token", &a.Token) + case "repositoryEndpoint": + err = unpopulate(val, "RepositoryEndpoint", &a.RepositoryEndpoint) delete(rawMsg, key) - case "tokenType": - err = unpopulate(val, "TokenType", &a.TokenType) + case "repositoryEndpointPrefix": + err = unpopulate(val, "RepositoryEndpointPrefix", &a.RepositoryEndpointPrefix) delete(rawMsg, key) } if err != nil { @@ -439,499 +454,494 @@ func (a *AuthInfoUpdateParameters) UnmarshalJSON(data []byte) error { 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 ArchiveUpdateParameters. +func (a ArchiveUpdateParameters) 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, "properties", a.Properties) 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 ArchiveUpdateParameters. +func (a *ArchiveUpdateParameters) 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", a, err) } for key, val := range rawMsg { var err error switch key { - case "digest": - err = unpopulate(val, "Digest", &b.Digest) - delete(rawMsg, key) - case "registry": - err = unpopulate(val, "Registry", &b.Registry) - delete(rawMsg, key) - case "repository": - err = unpopulate(val, "Repository", &b.Repository) - delete(rawMsg, key) - case "tag": - err = unpopulate(val, "Tag", &b.Tag) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &b.Type) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, 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 ArchiveUpdateProperties. +func (a ArchiveUpdateProperties) 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, "publishedVersion", a.PublishedVersion) 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 ArchiveUpdateProperties. +func (a *ArchiveUpdateProperties) 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", a, err) } for key, val := range rawMsg { var err error switch key { - case "baseImageTriggerType": - err = unpopulate(val, "BaseImageTriggerType", &b.BaseImageTriggerType) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &b.Name) - 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) + case "publishedVersion": + err = unpopulate(val, "PublishedVersion", &a.PublishedVersion) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, 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 ArchiveVersion. +func (a ArchiveVersion) 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", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "type", a.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 ArchiveVersion. +func (a *ArchiveVersion) 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", a, 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", &a.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &b.Name) + err = unpopulate(val, "Name", &a.Name) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &b.Status) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) delete(rawMsg, key) - case "updateTriggerEndpoint": - err = unpopulate(val, "UpdateTriggerEndpoint", &b.UpdateTriggerEndpoint) + case "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) delete(rawMsg, key) - case "updateTriggerPayloadType": - err = unpopulate(val, "UpdateTriggerPayloadType", &b.UpdateTriggerPayloadType) + case "type": + err = unpopulate(val, "Type", &a.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, 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 ArchiveVersionListResult. +func (a ArchiveVersionListResult) 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", a.NextLink) + populate(objectMap, "value", a.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 ArchiveVersionListResult. +func (a *ArchiveVersionListResult) 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", a, 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) - 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", &a.NextLink) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) + case "value": + err = unpopulate(val, "Value", &a.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } 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 ArchiveVersionProperties. +func (a ArchiveVersionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "creationDate", c.CreationDate) - populate(objectMap, "credentialSetResourceId", c.CredentialSetResourceID) - populate(objectMap, "provisioningState", c.ProvisioningState) - populate(objectMap, "sourceRepository", c.SourceRepository) - populate(objectMap, "targetRepository", c.TargetRepository) + populate(objectMap, "archiveVersionErrorMessage", a.ArchiveVersionErrorMessage) + populate(objectMap, "provisioningState", a.ProvisioningState) 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 ArchiveVersionProperties. +func (a *ArchiveVersionProperties) 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", a, err) } for key, val := range rawMsg { var err error switch key { - case "creationDate": - err = unpopulateDateTimeRFC3339(val, "CreationDate", &c.CreationDate) - delete(rawMsg, key) - case "credentialSetResourceId": - err = unpopulate(val, "CredentialSetResourceID", &c.CredentialSetResourceID) + case "archiveVersionErrorMessage": + err = unpopulate(val, "ArchiveVersionErrorMessage", &a.ArchiveVersionErrorMessage) 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) + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } 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 Argument. +func (a Argument) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", c.Properties) + populate(objectMap, "isSecret", a.IsSecret) + populate(objectMap, "name", a.Name) + populate(objectMap, "value", a.Value) 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 Argument. +func (a *Argument) 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", a, err) } for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &c.Properties) + case "isSecret": + err = unpopulate(val, "IsSecret", &a.IsSecret) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } 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 AuthCredential. +func (a AuthCredential) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "credentialSetResourceId", c.CredentialSetResourceID) + populate(objectMap, "credentialHealth", a.CredentialHealth) + populate(objectMap, "name", a.Name) + populate(objectMap, "passwordSecretIdentifier", a.PasswordSecretIdentifier) + populate(objectMap, "usernameSecretIdentifier", a.UsernameSecretIdentifier) 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 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", c, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "credentialSetResourceId": - err = unpopulate(val, "CredentialSetResourceID", &c.CredentialSetResourceID) + case "credentialHealth": + err = unpopulate(val, "CredentialHealth", &a.CredentialHealth) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "passwordSecretIdentifier": + err = unpopulate(val, "PasswordSecretIdentifier", &a.PasswordSecretIdentifier) + delete(rawMsg, key) + case "usernameSecretIdentifier": + err = unpopulate(val, "UsernameSecretIdentifier", &a.UsernameSecretIdentifier) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } 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 AuthInfo. +func (a AuthInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) + 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) 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 AuthInfo. +func (a *AuthInfo) 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", a, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) + case "expiresIn": + err = unpopulate(val, "ExpiresIn", &a.ExpiresIn) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) + 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) + delete(rawMsg, key) + case "tokenType": + err = unpopulate(val, "TokenType", &a.TokenType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", a, 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 AuthInfoUpdateParameters. +func (a AuthInfoUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "customHeaders", c.CustomHeaders) - populate(objectMap, "serviceUri", c.ServiceURI) + 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) 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 AuthInfoUpdateParameters. +func (a *AuthInfoUpdateParameters) 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", a, err) } for key, val := range rawMsg { var err error switch key { - case "customHeaders": - err = unpopulate(val, "CustomHeaders", &c.CustomHeaders) + case "expiresIn": + err = unpopulate(val, "ExpiresIn", &a.ExpiresIn) delete(rawMsg, key) - case "serviceUri": - err = unpopulate(val, "ServiceURI", &c.ServiceURI) + 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) + delete(rawMsg, key) + case "tokenType": + err = unpopulate(val, "TokenType", &a.TokenType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", a, 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 AzureADAuthenticationAsArmPolicy. +func (a AzureADAuthenticationAsArmPolicy) 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", a.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 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", c, err) + return fmt.Errorf("unmarshalling type %T: %v", a, 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", &a.Status) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", a, 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 BaseImageDependency. +func (b BaseImageDependency) 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, "digest", b.Digest) + populate(objectMap, "registry", b.Registry) + populate(objectMap, "repository", b.Repository) + populate(objectMap, "tag", b.Tag) + populate(objectMap, "type", b.Type) 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 BaseImageDependency. +func (b *BaseImageDependency) 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", b, 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) + case "digest": + err = unpopulate(val, "Digest", &b.Digest) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) + case "registry": + err = unpopulate(val, "Registry", &b.Registry) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) + case "repository": + err = unpopulate(val, "Repository", &b.Repository) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &c.SystemData) + case "tag": + err = unpopulate(val, "Tag", &b.Tag) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &c.Type) + err = unpopulate(val, "Type", &b.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", b, 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 BaseImageTrigger. +func (b BaseImageTrigger) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) + 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) 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 BaseImageTrigger. +func (b *BaseImageTrigger) 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", b, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) + case "baseImageTriggerType": + err = unpopulate(val, "BaseImageTriggerType", &b.BaseImageTriggerType) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) + case "name": + err = unpopulate(val, "Name", &b.Name) + 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) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CredentialSetProperties. -func (c CredentialSetProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type BaseImageTriggerUpdateParameters. +func (b BaseImageTriggerUpdateParameters) 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) + 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) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CredentialSetProperties. -func (c *CredentialSetProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BaseImageTriggerUpdateParameters. +func (b *BaseImageTriggerUpdateParameters) 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", b, err) } for key, val := range rawMsg { var err error switch key { - case "authCredentials": - err = unpopulate(val, "AuthCredentials", &c.AuthCredentials) + case "baseImageTriggerType": + err = unpopulate(val, "BaseImageTriggerType", &b.BaseImageTriggerType) delete(rawMsg, key) - case "creationDate": - err = unpopulateDateTimeRFC3339(val, "CreationDate", &c.CreationDate) + case "name": + err = unpopulate(val, "Name", &b.Name) delete(rawMsg, key) - case "loginServer": - err = unpopulate(val, "LoginServer", &c.LoginServer) + case "status": + err = unpopulate(val, "Status", &b.Status) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + case "updateTriggerEndpoint": + err = unpopulate(val, "UpdateTriggerEndpoint", &b.UpdateTriggerEndpoint) + delete(rawMsg, key) + case "updateTriggerPayloadType": + err = unpopulate(val, "UpdateTriggerPayloadType", &b.UpdateTriggerPayloadType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CredentialSetUpdateParameters. -func (c CredentialSetUpdateParameters) 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, "identity", c.Identity) + 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 CredentialSetUpdateParameters. -func (c *CredentialSetUpdateParameters) 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", c, err) @@ -939,12 +949,21 @@ func (c *CredentialSetUpdateParameters) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "identity": - err = unpopulate(val, "Identity", &c.Identity) + 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) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -953,15 +972,19 @@ func (c *CredentialSetUpdateParameters) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CredentialSetUpdateProperties. -func (c CredentialSetUpdateProperties) 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, "authCredentials", c.AuthCredentials) + populateDateTimeRFC3339(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 CredentialSetUpdateProperties. -func (c *CredentialSetUpdateProperties) 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", c, err) @@ -969,8 +992,20 @@ func (c *CredentialSetUpdateProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "authCredentials": - err = unpopulate(val, "AuthCredentials", &c.AuthCredentials) + case "creationDate": + err = unpopulateDateTimeRFC3339(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 { @@ -980,16 +1015,15 @@ func (c *CredentialSetUpdateProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type Credentials. -func (c Credentials) 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, "customRegistries", c.CustomRegistries) - populate(objectMap, "sourceRegistry", c.SourceRegistry) + populate(objectMap, "properties", c.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Credentials. -func (c *Credentials) 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", c, err) @@ -997,11 +1031,8 @@ func (c *Credentials) UnmarshalJSON(data []byte) error { 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) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) delete(rawMsg, key) } if err != nil { @@ -1011,17 +1042,15 @@ func (c *Credentials) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CustomRegistryCredentials. -func (c CustomRegistryCredentials) 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, "identity", c.Identity) - populate(objectMap, "password", c.Password) - populate(objectMap, "userName", c.UserName) + populate(objectMap, "credentialSetResourceId", c.CredentialSetResourceID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CustomRegistryCredentials. -func (c *CustomRegistryCredentials) 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", c, err) @@ -1029,14 +1058,8 @@ func (c *CustomRegistryCredentials) 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 "password": - err = unpopulate(val, "Password", &c.Password) - delete(rawMsg, key) - case "userName": - err = unpopulate(val, "UserName", &c.UserName) + case "credentialSetResourceId": + err = unpopulate(val, "CredentialSetResourceID", &c.CredentialSetResourceID) delete(rawMsg, key) } if err != nil { @@ -1046,1525 +1069,2864 @@ func (c *CustomRegistryCredentials) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DockerBuildRequest. -func (d DockerBuildRequest) 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, "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" + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DockerBuildRequest. -func (d *DockerBuildRequest) 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", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, 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) + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) + case "value": + err = unpopulate(val, "Value", &c.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DockerBuildStep. -func (d DockerBuildStep) 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, "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 + populate(objectMap, "customHeaders", c.CustomHeaders) + populate(objectMap, "serviceUri", c.ServiceURI) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DockerBuildStep. -func (d *DockerBuildStep) 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", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, 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) + case "customHeaders": + err = unpopulate(val, "CustomHeaders", &c.CustomHeaders) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) + case "serviceUri": + err = unpopulate(val, "ServiceURI", &c.ServiceURI) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DockerBuildStepUpdateParameters. -func (d DockerBuildStepUpdateParameters) 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, "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 + 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 DockerBuildStepUpdateParameters. -func (d *DockerBuildStepUpdateParameters) 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", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, 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) + case "id": + err = unpopulate(val, "ID", &c.ID) delete(rawMsg, key) - case "isPushEnabled": - err = unpopulate(val, "IsPushEnabled", &d.IsPushEnabled) + case "name": + err = unpopulate(val, "Name", &c.Name) delete(rawMsg, key) - case "noCache": - err = unpopulate(val, "NoCache", &d.NoCache) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &d.Target) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &d.Type) + err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EncodedTaskRunRequest. -func (e EncodedTaskRunRequest) 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, "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) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EncodedTaskRunRequest. -func (e *EncodedTaskRunRequest) 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", e, err) + return fmt.Errorf("unmarshalling type %T: %v", c, 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) + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) delete(rawMsg, key) - case "values": - err = unpopulate(val, "Values", &e.Values) + case "value": + err = unpopulate(val, "Value", &c.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EncodedTaskStep. -func (e EncodedTaskStep) 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, "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) + populate(objectMap, "activation", c.Activation) + populate(objectMap, "clientTokenIds", c.ClientTokenIDs) + populate(objectMap, "connectionState", c.ConnectionState) + 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) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EncodedTaskStep. -func (e *EncodedTaskStep) 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", e, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "baseImageDependencies": - err = unpopulate(val, "BaseImageDependencies", &e.BaseImageDependencies) + case "activation": + err = unpopulate(val, "Activation", &c.Activation) delete(rawMsg, key) - case "contextAccessToken": - err = unpopulate(val, "ContextAccessToken", &e.ContextAccessToken) + case "clientTokenIds": + err = unpopulate(val, "ClientTokenIDs", &c.ClientTokenIDs) delete(rawMsg, key) - case "contextPath": - err = unpopulate(val, "ContextPath", &e.ContextPath) + case "connectionState": + err = unpopulate(val, "ConnectionState", &c.ConnectionState) delete(rawMsg, key) - case "encodedTaskContent": - err = unpopulate(val, "EncodedTaskContent", &e.EncodedTaskContent) + case "lastActivityTime": + err = unpopulateDateTimeRFC3339(val, "LastActivityTime", &c.LastActivityTime) delete(rawMsg, key) - case "encodedValuesContent": - err = unpopulate(val, "EncodedValuesContent", &e.EncodedValuesContent) + case "logging": + err = unpopulate(val, "Logging", &c.Logging) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) + case "loginServer": + err = unpopulate(val, "LoginServer", &c.LoginServer) delete(rawMsg, key) - case "values": - err = unpopulate(val, "Values", &e.Values) + 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) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &c.Version) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EncodedTaskStepUpdateParameters. -func (e EncodedTaskStepUpdateParameters) 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, "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) + populate(objectMap, "properties", c.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EncodedTaskStepUpdateParameters. -func (e *EncodedTaskStepUpdateParameters) 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", e, err) + return fmt.Errorf("unmarshalling type %T: %v", c, 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) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EncryptionProperty. -func (e EncryptionProperty) 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, "keyVaultProperties", e.KeyVaultProperties) - populate(objectMap, "status", e.Status) + populate(objectMap, "clientTokenIds", c.ClientTokenIDs) + 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 EncryptionProperty. -func (e *EncryptionProperty) 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", e, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "keyVaultProperties": - err = unpopulate(val, "KeyVaultProperties", &e.KeyVaultProperties) + case "clientTokenIds": + err = unpopulate(val, "ClientTokenIDs", &c.ClientTokenIDs) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &e.Status) + case "logging": + err = unpopulate(val, "Logging", &c.Logging) + delete(rawMsg, key) + case "notificationsList": + err = unpopulate(val, "NotificationsList", &c.NotificationsList) + delete(rawMsg, key) + case "syncProperties": + err = unpopulate(val, "SyncProperties", &c.SyncProperties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Event. -func (e Event) 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, "eventRequestMessage", e.EventRequestMessage) - populate(objectMap, "eventResponseMessage", e.EventResponseMessage) - populate(objectMap, "id", e.ID) + 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 Event. -func (e *Event) 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", e, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "eventRequestMessage": - err = unpopulate(val, "EventRequestMessage", &e.EventRequestMessage) + case "errorCode": + err = unpopulate(val, "ErrorCode", &c.ErrorCode) delete(rawMsg, key) - case "eventResponseMessage": - err = unpopulate(val, "EventResponseMessage", &e.EventResponseMessage) + case "errorMessage": + err = unpopulate(val, "ErrorMessage", &c.ErrorMessage) delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &e.ID) + case "status": + err = unpopulate(val, "Status", &c.Status) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EventContent. -func (e EventContent) 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, "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) + 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 EventContent. -func (e *EventContent) 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", e, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "action": - err = unpopulate(val, "Action", &e.Action) + 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) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + 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 CredentialSetListResult. +func (c CredentialSetListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// 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) + } + 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) + 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 ExportPipeline. +func (e ExportPipeline) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", e.ID) + populate(objectMap, "identity", e.Identity) + populate(objectMap, "location", e.Location) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "systemData", e.SystemData) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExportPipeline. +func (e *ExportPipeline) 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) + case "identity": + err = unpopulate(val, "Identity", &e.Identity) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &e.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &e.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + 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 ExportPipelineListResult. +func (e ExportPipelineListResult) 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 ExportPipelineListResult. +func (e *ExportPipelineListResult) 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 ExportPipelineProperties. +func (e ExportPipelineProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "options", e.Options) + populate(objectMap, "provisioningState", e.ProvisioningState) + populate(objectMap, "target", e.Target) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExportPipelineProperties. +func (e *ExportPipelineProperties) 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 "options": + err = unpopulate(val, "Options", &e.Options) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &e.Target) + 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 ExportPipelineTargetProperties. +func (e ExportPipelineTargetProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "keyVaultUri", e.KeyVaultURI) + populate(objectMap, "type", e.Type) + populate(objectMap, "uri", e.URI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExportPipelineTargetProperties. +func (e *ExportPipelineTargetProperties) 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 "keyVaultUri": + err = unpopulate(val, "KeyVaultURI", &e.KeyVaultURI) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + delete(rawMsg, key) + case "uri": + err = unpopulate(val, "URI", &e.URI) + 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 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 "request": - err = unpopulate(val, "Request", &e.Request) + 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 ImportPipeline. +func (i ImportPipeline) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", i.ID) + populate(objectMap, "identity", i.Identity) + populate(objectMap, "location", i.Location) + populate(objectMap, "name", i.Name) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "systemData", i.SystemData) + populate(objectMap, "type", i.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImportPipeline. +func (i *ImportPipeline) 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 "identity": + err = unpopulate(val, "Identity", &i.Identity) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &i.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &i.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &i.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + 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 ImportPipelineListResult. +func (i ImportPipelineListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", i.NextLink) + populate(objectMap, "value", i.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImportPipelineListResult. +func (i *ImportPipelineListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &i.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &i.Value) + 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 ImportPipelineProperties. +func (i ImportPipelineProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "options", i.Options) + populate(objectMap, "provisioningState", i.ProvisioningState) + populate(objectMap, "source", i.Source) + populate(objectMap, "trigger", i.Trigger) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImportPipelineProperties. +func (i *ImportPipelineProperties) 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 "options": + err = unpopulate(val, "Options", &i.Options) delete(rawMsg, key) - case "source": - err = unpopulate(val, "Source", &e.Source) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &i.ProvisioningState) delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &e.Target) + case "source": + err = unpopulate(val, "Source", &i.Source) delete(rawMsg, key) - case "timestamp": - err = unpopulateDateTimeRFC3339(val, "Timestamp", &e.Timestamp) + case "trigger": + err = unpopulate(val, "Trigger", &i.Trigger) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EventInfo. -func (e EventInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ImportPipelineSourceProperties. +func (i ImportPipelineSourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", e.ID) + populate(objectMap, "keyVaultUri", i.KeyVaultURI) + populate(objectMap, "type", i.Type) + populate(objectMap, "uri", i.URI) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EventInfo. -func (e *EventInfo) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ImportPipelineSourceProperties. +func (i *ImportPipelineSourceProperties) 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) + 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", &e.ID) + case "keyVaultUri": + err = unpopulate(val, "KeyVaultURI", &i.KeyVaultURI) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + delete(rawMsg, key) + case "uri": + err = unpopulate(val, "URI", &i.URI) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EventListResult. -func (e EventListResult) 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, "nextLink", e.NextLink) - populate(objectMap, "value", e.Value) + 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 EventListResult. -func (e *EventListResult) 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", e, 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", &e.NextLink) + case "credentials": + err = unpopulate(val, "Credentials", &i.Credentials) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &e.Value) + 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", e, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EventRequestMessage. -func (e EventRequestMessage) 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, "content", e.Content) - populate(objectMap, "headers", e.Headers) - populate(objectMap, "method", e.Method) - populate(objectMap, "requestUri", e.RequestURI) - populate(objectMap, "version", e.Version) + populate(objectMap, "password", i.Password) + populate(objectMap, "username", i.Username) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EventRequestMessage. -func (e *EventRequestMessage) 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", e, err) + return fmt.Errorf("unmarshalling type %T: %v", i, 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) + case "password": + err = unpopulate(val, "Password", &i.Password) delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &e.Version) + case "username": + err = unpopulate(val, "Username", &i.Username) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EventResponseMessage. -func (e EventResponseMessage) 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, "content", e.Content) - populate(objectMap, "headers", e.Headers) - populate(objectMap, "reasonPhrase", e.ReasonPhrase) - populate(objectMap, "statusCode", e.StatusCode) - populate(objectMap, "version", e.Version) + 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 EventResponseMessage. -func (e *EventResponseMessage) 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", e, err) + return fmt.Errorf("unmarshalling type %T: %v", k, err) } for key, val := range rawMsg { var err error switch key { - case "content": - err = unpopulate(val, "Content", &e.Content) + case "identity": + err = unpopulate(val, "Identity", &k.Identity) delete(rawMsg, key) - case "headers": - err = unpopulate(val, "Headers", &e.Headers) + case "keyIdentifier": + err = unpopulate(val, "KeyIdentifier", &k.KeyIdentifier) delete(rawMsg, key) - case "reasonPhrase": - err = unpopulate(val, "ReasonPhrase", &e.ReasonPhrase) + case "keyRotationEnabled": + err = unpopulate(val, "KeyRotationEnabled", &k.KeyRotationEnabled) delete(rawMsg, key) - case "statusCode": - err = unpopulate(val, "StatusCode", &e.StatusCode) + case "lastKeyRotationTimestamp": + err = unpopulateDateTimeRFC3339(val, "LastKeyRotationTimestamp", &k.LastKeyRotationTimestamp) delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &e.Version) + case "versionedKeyIdentifier": + err = unpopulate(val, "VersionedKeyIdentifier", &k.VersionedKeyIdentifier) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", k, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ExportPolicy. -func (e ExportPolicy) 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, "status", e.Status) + populate(objectMap, "auditLogStatus", l.AuditLogStatus) + populate(objectMap, "logLevel", l.LogLevel) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ExportPolicy. -func (e *ExportPolicy) 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", e, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "status": - err = unpopulate(val, "Status", &e.Status) + 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", e, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type FileTaskRunRequest. -func (f FileTaskRunRequest) 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, "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) + populate(objectMap, "host", l.Host) + populate(objectMap, "tls", l.TLS) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type FileTaskRunRequest. -func (f *FileTaskRunRequest) 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", f, err) + return fmt.Errorf("unmarshalling type %T: %v", l, 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) + case "host": + err = unpopulate(val, "Host", &l.Host) delete(rawMsg, key) - case "valuesFilePath": - err = unpopulate(val, "ValuesFilePath", &f.ValuesFilePath) + case "tls": + err = unpopulate(val, "TLS", &l.TLS) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type FileTaskStep. -func (f FileTaskStep) 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, "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) + populate(objectMap, "defaultAction", n.DefaultAction) + populate(objectMap, "ipRules", n.IPRules) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type FileTaskStep. -func (f *FileTaskStep) 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", f, err) + return fmt.Errorf("unmarshalling type %T: %v", n, 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) + case "defaultAction": + err = unpopulate(val, "DefaultAction", &n.DefaultAction) delete(rawMsg, key) - case "valuesFilePath": - err = unpopulate(val, "ValuesFilePath", &f.ValuesFilePath) + case "ipRules": + err = unpopulate(val, "IPRules", &n.IPRules) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type FileTaskStepUpdateParameters. -func (f FileTaskStepUpdateParameters) 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, "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) + 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 FileTaskStepUpdateParameters. -func (f *FileTaskStepUpdateParameters) 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", f, err) + return fmt.Errorf("unmarshalling type %T: %v", o, 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) + case "display": + err = unpopulate(val, "Display", &o.Display) delete(rawMsg, key) - case "taskFilePath": - err = unpopulate(val, "TaskFilePath", &f.TaskFilePath) + case "isDataAction": + err = unpopulate(val, "IsDataAction", &o.IsDataAction) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &f.Type) + case "name": + err = unpopulate(val, "Name", &o.Name) delete(rawMsg, key) - case "values": - err = unpopulate(val, "Values", &f.Values) + case "origin": + err = unpopulate(val, "Origin", &o.Origin) delete(rawMsg, key) - case "valuesFilePath": - err = unpopulate(val, "ValuesFilePath", &f.ValuesFilePath) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GenerateCredentialsParameters. -func (g GenerateCredentialsParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OperationDisplayDefinition. +func (o OperationDisplayDefinition) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "expiry", g.Expiry) - populate(objectMap, "name", g.Name) - populate(objectMap, "tokenId", g.TokenID) + 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 GenerateCredentialsParameters. -func (g *GenerateCredentialsParameters) 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", g, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "expiry": - err = unpopulateDateTimeRFC3339(val, "Expiry", &g.Expiry) + case "description": + err = unpopulate(val, "Description", &o.Description) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &g.Name) + case "operation": + err = unpopulate(val, "Operation", &o.Operation) delete(rawMsg, key) - case "tokenId": - err = unpopulate(val, "TokenID", &g.TokenID) + 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", g, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GenerateCredentialsResult. -func (g GenerateCredentialsResult) 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, "passwords", g.Passwords) - populate(objectMap, "username", g.Username) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GenerateCredentialsResult. -func (g *GenerateCredentialsResult) 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", g, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "passwords": - err = unpopulate(val, "Passwords", &g.Passwords) + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) delete(rawMsg, key) - case "username": - err = unpopulate(val, "Username", &g.Username) + case "value": + err = unpopulate(val, "Value", &o.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IPRule. -func (i IPRule) 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, "action", i.Action) - populate(objectMap, "value", i.IPAddressOrRange) + 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 IPRule. -func (i *IPRule) 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "action": - err = unpopulate(val, "Action", &i.Action) + case "blobDuration": + err = unpopulate(val, "BlobDuration", &o.BlobDuration) delete(rawMsg, key) - case "value": - err = unpopulate(val, "IPAddressOrRange", &i.IPAddressOrRange) + 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IdentityProperties. -func (i IdentityProperties) 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, "principalId", i.PrincipalID) - populate(objectMap, "tenantId", i.TenantID) - populate(objectMap, "type", i.Type) - populate(objectMap, "userAssignedIdentities", i.UserAssignedIdentities) + 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 IdentityProperties. -func (i *IdentityProperties) 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "principalId": - err = unpopulate(val, "PrincipalID", &i.PrincipalID) + case "aggregationType": + err = unpopulate(val, "AggregationType", &o.AggregationType) delete(rawMsg, key) - case "tenantId": - err = unpopulate(val, "TenantID", &i.TenantID) + case "displayDescription": + err = unpopulate(val, "DisplayDescription", &o.DisplayDescription) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &i.Type) + case "displayName": + err = unpopulate(val, "DisplayName", &o.DisplayName) delete(rawMsg, key) - case "userAssignedIdentities": - err = unpopulate(val, "UserAssignedIdentities", &i.UserAssignedIdentities) + 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ImageDescriptor. -func (i ImageDescriptor) 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, "digest", i.Digest) - populate(objectMap, "registry", i.Registry) - populate(objectMap, "repository", i.Repository) - populate(objectMap, "tag", i.Tag) + populate(objectMap, "serviceSpecification", o.ServiceSpecification) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ImageDescriptor. -func (i *ImageDescriptor) 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", o, 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) + case "serviceSpecification": + err = unpopulate(val, "ServiceSpecification", &o.ServiceSpecification) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ImageUpdateTrigger. -func (i ImageUpdateTrigger) 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", i.ID) - populate(objectMap, "images", i.Images) - populateDateTimeRFC3339(objectMap, "timestamp", i.Timestamp) + populate(objectMap, "logSpecifications", o.LogSpecifications) + populate(objectMap, "metricSpecifications", o.MetricSpecifications) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ImageUpdateTrigger. -func (i *ImageUpdateTrigger) 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", i, 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", &i.ID) - delete(rawMsg, key) - case "images": - err = unpopulate(val, "Images", &i.Images) + case "logSpecifications": + err = unpopulate(val, "LogSpecifications", &o.LogSpecifications) delete(rawMsg, key) - case "timestamp": - err = unpopulateDateTimeRFC3339(val, "Timestamp", &i.Timestamp) + case "metricSpecifications": + err = unpopulate(val, "MetricSpecifications", &o.MetricSpecifications) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ImportImageParameters. -func (i ImportImageParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OverrideTaskStepProperties. +func (o OverrideTaskStepProperties) 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) + 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 ImportImageParameters. -func (i *ImportImageParameters) UnmarshalJSON(data []byte) error { +// 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "mode": - err = unpopulate(val, "Mode", &i.Mode) + case "arguments": + err = unpopulate(val, "Arguments", &o.Arguments) delete(rawMsg, key) - case "source": - err = unpopulate(val, "Source", &i.Source) + 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 "targetTags": - err = unpopulate(val, "TargetTags", &i.TargetTags) + case "updateTriggerToken": + err = unpopulate(val, "UpdateTriggerToken", &o.UpdateTriggerToken) delete(rawMsg, key) - case "untaggedTargetRepositories": - err = unpopulate(val, "UntaggedTargetRepositories", &i.UntaggedTargetRepositories) + case "values": + err = unpopulate(val, "Values", &o.Values) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ImportSource. -func (i ImportSource) 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, "credentials", i.Credentials) - populate(objectMap, "registryUri", i.RegistryURI) - populate(objectMap, "resourceId", i.ResourceID) - populate(objectMap, "sourceImage", i.SourceImage) + populate(objectMap, "id", p.ID) + populate(objectMap, "syncProperties", p.SyncProperties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ImportSource. -func (i *ImportSource) 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", p, 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) + case "id": + err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) - case "sourceImage": - err = unpopulate(val, "SourceImage", &i.SourceImage) + case "syncProperties": + err = unpopulate(val, "SyncProperties", &p.SyncProperties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ImportSourceCredentials. -func (i ImportSourceCredentials) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PipelineRun. +func (p PipelineRun) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "password", i.Password) - populate(objectMap, "username", i.Username) + 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 ImportSourceCredentials. -func (i *ImportSourceCredentials) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PipelineRun. +func (p *PipelineRun) 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) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "password": - err = unpopulate(val, "Password", &i.Password) + case "id": + err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) - case "username": - err = unpopulate(val, "Username", &i.Username) + 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type KeyVaultProperties. -func (k KeyVaultProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PipelineRunListResult. +func (p PipelineRunListResult) 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) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultProperties. -func (k *KeyVaultProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PipelineRunListResult. +func (p *PipelineRunListResult) 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) + return fmt.Errorf("unmarshalling type %T: %v", p, 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) + case "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) delete(rawMsg, key) - case "versionedKeyIdentifier": - err = unpopulate(val, "VersionedKeyIdentifier", &k.VersionedKeyIdentifier) + case "value": + err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkRuleSet. -func (n NetworkRuleSet) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PipelineRunProperties. +func (p PipelineRunProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "defaultAction", n.DefaultAction) - populate(objectMap, "ipRules", n.IPRules) + populate(objectMap, "forceUpdateTag", p.ForceUpdateTag) + populate(objectMap, "provisioningState", p.ProvisioningState) + populate(objectMap, "request", p.Request) + populate(objectMap, "response", p.Response) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkRuleSet. -func (n *NetworkRuleSet) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PipelineRunProperties. +func (p *PipelineRunProperties) 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) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "defaultAction": - err = unpopulate(val, "DefaultAction", &n.DefaultAction) + case "forceUpdateTag": + err = unpopulate(val, "ForceUpdateTag", &p.ForceUpdateTag) delete(rawMsg, key) - case "ipRules": - err = unpopulate(val, "IPRules", &n.IPRules) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + delete(rawMsg, key) + case "request": + err = unpopulate(val, "Request", &p.Request) + delete(rawMsg, key) + case "response": + err = unpopulate(val, "Response", &p.Response) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationDefinition. -func (o OperationDefinition) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PipelineRunRequest. +func (p PipelineRunRequest) 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) + populate(objectMap, "artifacts", p.Artifacts) + populate(objectMap, "catalogDigest", p.CatalogDigest) + populate(objectMap, "pipelineResourceId", p.PipelineResourceID) + populate(objectMap, "source", p.Source) + populate(objectMap, "target", p.Target) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDefinition. -func (o *OperationDefinition) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PipelineRunRequest. +func (p *PipelineRunRequest) 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) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "display": - err = unpopulate(val, "Display", &o.Display) + case "artifacts": + err = unpopulate(val, "Artifacts", &p.Artifacts) delete(rawMsg, key) - case "isDataAction": - err = unpopulate(val, "IsDataAction", &o.IsDataAction) + case "catalogDigest": + err = unpopulate(val, "CatalogDigest", &p.CatalogDigest) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &o.Name) + case "pipelineResourceId": + err = unpopulate(val, "PipelineResourceID", &p.PipelineResourceID) delete(rawMsg, key) - case "origin": - err = unpopulate(val, "Origin", &o.Origin) + case "source": + err = unpopulate(val, "Source", &p.Source) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &o.Properties) + case "target": + err = unpopulate(val, "Target", &p.Target) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationDisplayDefinition. -func (o OperationDisplayDefinition) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PipelineRunResponse. +func (p PipelineRunResponse) 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) + populate(objectMap, "catalogDigest", p.CatalogDigest) + populateDateTimeRFC3339(objectMap, "finishTime", p.FinishTime) + populate(objectMap, "importedArtifacts", p.ImportedArtifacts) + populate(objectMap, "pipelineRunErrorMessage", p.PipelineRunErrorMessage) + populate(objectMap, "progress", p.Progress) + populate(objectMap, "source", p.Source) + populateDateTimeRFC3339(objectMap, "startTime", p.StartTime) + populate(objectMap, "status", p.Status) + populate(objectMap, "target", p.Target) + populate(objectMap, "trigger", p.Trigger) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplayDefinition. -func (o *OperationDisplayDefinition) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PipelineRunResponse. +func (p *PipelineRunResponse) 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) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &o.Description) + case "catalogDigest": + err = unpopulate(val, "CatalogDigest", &p.CatalogDigest) delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &o.Operation) + case "finishTime": + err = unpopulateDateTimeRFC3339(val, "FinishTime", &p.FinishTime) delete(rawMsg, key) - case "provider": - err = unpopulate(val, "Provider", &o.Provider) + case "importedArtifacts": + err = unpopulate(val, "ImportedArtifacts", &p.ImportedArtifacts) delete(rawMsg, key) - case "resource": - err = unpopulate(val, "Resource", &o.Resource) + case "pipelineRunErrorMessage": + err = unpopulate(val, "PipelineRunErrorMessage", &p.PipelineRunErrorMessage) + delete(rawMsg, key) + case "progress": + err = unpopulate(val, "Progress", &p.Progress) + delete(rawMsg, key) + case "source": + err = unpopulate(val, "Source", &p.Source) + delete(rawMsg, key) + case "startTime": + err = unpopulateDateTimeRFC3339(val, "StartTime", &p.StartTime) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &p.Status) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &p.Target) + delete(rawMsg, key) + case "trigger": + err = unpopulate(val, "Trigger", &p.Trigger) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationListResult. -func (o OperationListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PipelineRunSourceProperties. +func (p PipelineRunSourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", o.NextLink) - populate(objectMap, "value", o.Value) + populate(objectMap, "name", p.Name) + populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult. -func (o *OperationListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PipelineRunSourceProperties. +func (p *PipelineRunSourceProperties) 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) + 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", &o.NextLink) + case "name": + err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &o.Value) + case "type": + err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationLogSpecificationDefinition. -func (o OperationLogSpecificationDefinition) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PipelineRunTargetProperties. +func (p PipelineRunTargetProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "blobDuration", o.BlobDuration) - populate(objectMap, "displayName", o.DisplayName) - populate(objectMap, "name", o.Name) + populate(objectMap, "name", p.Name) + populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationLogSpecificationDefinition. -func (o *OperationLogSpecificationDefinition) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PipelineRunTargetProperties. +func (p *PipelineRunTargetProperties) 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) + return fmt.Errorf("unmarshalling type %T: %v", p, 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) + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationMetricSpecificationDefinition. -func (o OperationMetricSpecificationDefinition) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PipelineSourceTriggerDescriptor. +func (p PipelineSourceTriggerDescriptor) 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) + populateDateTimeRFC3339(objectMap, "timestamp", p.Timestamp) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationMetricSpecificationDefinition. -func (o *OperationMetricSpecificationDefinition) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PipelineSourceTriggerDescriptor. +func (p *PipelineSourceTriggerDescriptor) 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) + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "timestamp": + err = unpopulateDateTimeRFC3339(val, "Timestamp", &p.Timestamp) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationPropertiesDefinition. -func (o OperationPropertiesDefinition) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PipelineSourceTriggerProperties. +func (p PipelineSourceTriggerProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "serviceSpecification", o.ServiceSpecification) + populate(objectMap, "status", p.Status) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationPropertiesDefinition. -func (o *OperationPropertiesDefinition) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PipelineSourceTriggerProperties. +func (p *PipelineSourceTriggerProperties) 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) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "serviceSpecification": - err = unpopulate(val, "ServiceSpecification", &o.ServiceSpecification) + case "status": + err = unpopulate(val, "Status", &p.Status) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationServiceSpecificationDefinition. -func (o OperationServiceSpecificationDefinition) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PipelineTriggerDescriptor. +func (p PipelineTriggerDescriptor) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "logSpecifications", o.LogSpecifications) - populate(objectMap, "metricSpecifications", o.MetricSpecifications) + populate(objectMap, "sourceTrigger", p.SourceTrigger) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationServiceSpecificationDefinition. -func (o *OperationServiceSpecificationDefinition) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PipelineTriggerDescriptor. +func (p *PipelineTriggerDescriptor) 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) + return fmt.Errorf("unmarshalling type %T: %v", p, 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) + case "sourceTrigger": + err = unpopulate(val, "SourceTrigger", &p.SourceTrigger) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OverrideTaskStepProperties. -func (o OverrideTaskStepProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PipelineTriggerProperties. +func (p PipelineTriggerProperties) 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) + populate(objectMap, "sourceTrigger", p.SourceTrigger) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OverrideTaskStepProperties. -func (o *OverrideTaskStepProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PipelineTriggerProperties. +func (p *PipelineTriggerProperties) 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) + return fmt.Errorf("unmarshalling type %T: %v", p, 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) + case "sourceTrigger": + err = unpopulate(val, "SourceTrigger", &p.SourceTrigger) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil @@ -2643,9 +4005,11 @@ func (p *PlatformUpdateParameters) UnmarshalJSON(data []byte) error { // 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, "softDeletePolicy", p.SoftDeletePolicy) populate(objectMap, "trustPolicy", p.TrustPolicy) return json.Marshal(objectMap) } @@ -2659,6 +4023,9 @@ func (p *Policies) UnmarshalJSON(data []byte) error { 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) @@ -2668,6 +4035,9 @@ func (p *Policies) UnmarshalJSON(data []byte) error { case "retentionPolicy": err = unpopulate(val, "RetentionPolicy", &p.RetentionPolicy) delete(rawMsg, key) + case "softDeletePolicy": + err = unpopulate(val, "SoftDeletePolicy", &p.SoftDeletePolicy) + delete(rawMsg, key) case "trustPolicy": err = unpopulate(val, "TrustPolicy", &p.TrustPolicy) delete(rawMsg, key) @@ -2955,6 +4325,33 @@ func (p *PrivateLinkServiceConnectionState) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ProgressProperties. +func (p ProgressProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "percentage", p.Percentage) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProgressProperties. +func (p *ProgressProperties) 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 "percentage": + err = unpopulate(val, "Percentage", &p.Percentage) + 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) @@ -3231,11 +4628,13 @@ func (r *RegistryPassword) UnmarshalJSON(data []byte) error { func (r RegistryProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "adminUserEnabled", r.AdminUserEnabled) + populate(objectMap, "anonymousPullEnabled", r.AnonymousPullEnabled) 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, "metadataSearch", r.MetadataSearch) populate(objectMap, "networkRuleBypassOptions", r.NetworkRuleBypassOptions) populate(objectMap, "networkRuleSet", r.NetworkRuleSet) populate(objectMap, "policies", r.Policies) @@ -3259,6 +4658,9 @@ func (r *RegistryProperties) UnmarshalJSON(data []byte) error { case "adminUserEnabled": err = unpopulate(val, "AdminUserEnabled", &r.AdminUserEnabled) delete(rawMsg, key) + case "anonymousPullEnabled": + err = unpopulate(val, "AnonymousPullEnabled", &r.AnonymousPullEnabled) + delete(rawMsg, key) case "creationDate": err = unpopulateDateTimeRFC3339(val, "CreationDate", &r.CreationDate) delete(rawMsg, key) @@ -3274,6 +4676,9 @@ func (r *RegistryProperties) UnmarshalJSON(data []byte) error { case "loginServer": err = unpopulate(val, "LoginServer", &r.LoginServer) delete(rawMsg, key) + case "metadataSearch": + err = unpopulate(val, "MetadataSearch", &r.MetadataSearch) + delete(rawMsg, key) case "networkRuleBypassOptions": err = unpopulate(val, "NetworkRuleBypassOptions", &r.NetworkRuleBypassOptions) delete(rawMsg, key) @@ -3310,8 +4715,10 @@ func (r *RegistryProperties) UnmarshalJSON(data []byte) error { func (r RegistryPropertiesUpdateParameters) 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, "metadataSearch", r.MetadataSearch) populate(objectMap, "networkRuleBypassOptions", r.NetworkRuleBypassOptions) populate(objectMap, "networkRuleSet", r.NetworkRuleSet) populate(objectMap, "policies", r.Policies) @@ -3331,12 +4738,18 @@ func (r *RegistryPropertiesUpdateParameters) UnmarshalJSON(data []byte) error { 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 "metadataSearch": + err = unpopulate(val, "MetadataSearch", &r.MetadataSearch) + delete(rawMsg, key) case "networkRuleBypassOptions": err = unpopulate(val, "NetworkRuleBypassOptions", &r.NetworkRuleBypassOptions) delete(rawMsg, key) @@ -4332,6 +5745,41 @@ func (s *SetValue) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type SoftDeletePolicy. +func (s SoftDeletePolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateDateTimeRFC3339(objectMap, "lastUpdatedTime", s.LastUpdatedTime) + populate(objectMap, "retentionDays", s.RetentionDays) + populate(objectMap, "status", s.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SoftDeletePolicy. +func (s *SoftDeletePolicy) 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 "lastUpdatedTime": + err = unpopulateDateTimeRFC3339(val, "LastUpdatedTime", &s.LastUpdatedTime) + delete(rawMsg, key) + case "retentionDays": + err = unpopulate(val, "RetentionDays", &s.RetentionDays) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &s.Status) + 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 Source. func (s Source) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -4663,6 +6111,131 @@ func (s *Status) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type StatusDetailProperties. +func (s StatusDetailProperties) 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) + return json.Marshal(objectMap) +} + +// 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", s, 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) + 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 SyncProperties. +func (s SyncProperties) 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) + return json.Marshal(objectMap) +} + +// 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "gatewayEndpoint": + err = unpopulate(val, "GatewayEndpoint", &s.GatewayEndpoint) + delete(rawMsg, key) + case "lastSyncTime": + err = unpopulateDateTimeRFC3339(val, "LastSyncTime", &s.LastSyncTime) + delete(rawMsg, key) + case "messageTtl": + err = unpopulate(val, "MessageTTL", &s.MessageTTL) + delete(rawMsg, key) + 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", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SyncUpdateProperties. +func (s SyncUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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", s, 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) + delete(rawMsg, key) + case "syncWindow": + err = unpopulate(val, "SyncWindow", &s.SyncWindow) + 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 SystemData. func (s SystemData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -4710,6 +6283,68 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type TLSCertificateProperties. +func (t TLSCertificateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "location", t.Location) + populate(objectMap, "type", t.Type) + return json.Marshal(objectMap) +} + +// 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "location": + err = unpopulate(val, "Location", &t.Location) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &t.Type) + 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 TLSProperties. +func (t TLSProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "certificate", t.Certificate) + populate(objectMap, "status", t.Status) + return json.Marshal(objectMap) +} + +// 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) + } + 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) + 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 Target. func (t Target) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/operations_client.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/operations_client.go index fb9d9834770d..faa03da54340 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/operations_client.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/operations_client.go @@ -39,7 +39,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Lists all of the available Azure Container Registry REST API operations. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -72,7 +72,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/operations_client_example_test.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/operations_client_example_test.go index fc0b639b934d..60def2ee4537 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/operations_client_example_test.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/operations_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/OperationList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/OperationList.json func ExampleOperationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/options.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/options.go index 8571ed3a4244..11dc1c99ab0d 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/options.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/options.go @@ -41,6 +41,55 @@ type AgentPoolsClientListOptions struct { // placeholder for future optional parameters } +// ArchiveVersionsClientBeginCreateOptions contains the optional parameters for the ArchiveVersionsClient.BeginCreate method. +type ArchiveVersionsClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ArchiveVersionsClientBeginDeleteOptions contains the optional parameters for the ArchiveVersionsClient.BeginDelete method. +type ArchiveVersionsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ArchiveVersionsClientGetOptions contains the optional parameters for the ArchiveVersionsClient.Get method. +type ArchiveVersionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ArchiveVersionsClientListOptions contains the optional parameters for the ArchiveVersionsClient.NewListPager method. +type ArchiveVersionsClientListOptions struct { + // placeholder for future optional parameters +} + +// ArchivesClientBeginCreateOptions contains the optional parameters for the ArchivesClient.BeginCreate method. +type ArchivesClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ArchivesClientBeginDeleteOptions contains the optional parameters for the ArchivesClient.BeginDelete method. +type ArchivesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ArchivesClientGetOptions contains the optional parameters for the ArchivesClient.Get method. +type ArchivesClientGetOptions struct { + // placeholder for future optional parameters +} + +// ArchivesClientListOptions contains the optional parameters for the ArchivesClient.NewListPager method. +type ArchivesClientListOptions struct { + // placeholder for future optional parameters +} + +// ArchivesClientUpdateOptions contains the optional parameters for the ArchivesClient.Update method. +type ArchivesClientUpdateOptions struct { + // placeholder for future optional parameters +} + // CacheRulesClientBeginCreateOptions contains the optional parameters for the CacheRulesClient.BeginCreate method. type CacheRulesClientBeginCreateOptions struct { // Resumes the LRO from the provided token. @@ -69,6 +118,47 @@ type CacheRulesClientListOptions struct { // placeholder for future optional parameters } +// ConnectedRegistriesClientBeginCreateOptions contains the optional parameters for the ConnectedRegistriesClient.BeginCreate +// method. +type ConnectedRegistriesClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ConnectedRegistriesClientBeginDeactivateOptions contains the optional parameters for the ConnectedRegistriesClient.BeginDeactivate +// method. +type ConnectedRegistriesClientBeginDeactivateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ConnectedRegistriesClientBeginDeleteOptions contains the optional parameters for the ConnectedRegistriesClient.BeginDelete +// method. +type ConnectedRegistriesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ConnectedRegistriesClientBeginUpdateOptions contains the optional parameters for the ConnectedRegistriesClient.BeginUpdate +// method. +type ConnectedRegistriesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ConnectedRegistriesClientGetOptions contains the optional parameters for the ConnectedRegistriesClient.Get method. +type ConnectedRegistriesClientGetOptions struct { + // placeholder for future optional parameters +} + +// 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. + Filter *string +} + // CredentialSetsClientBeginCreateOptions contains the optional parameters for the CredentialSetsClient.BeginCreate method. type CredentialSetsClientBeginCreateOptions struct { // Resumes the LRO from the provided token. @@ -97,11 +187,77 @@ type CredentialSetsClientListOptions struct { // placeholder for future optional parameters } +// ExportPipelinesClientBeginCreateOptions contains the optional parameters for the ExportPipelinesClient.BeginCreate method. +type ExportPipelinesClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ExportPipelinesClientBeginDeleteOptions contains the optional parameters for the ExportPipelinesClient.BeginDelete method. +type ExportPipelinesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ExportPipelinesClientGetOptions contains the optional parameters for the ExportPipelinesClient.Get method. +type ExportPipelinesClientGetOptions struct { + // placeholder for future optional parameters +} + +// ExportPipelinesClientListOptions contains the optional parameters for the ExportPipelinesClient.NewListPager method. +type ExportPipelinesClientListOptions struct { + // placeholder for future optional parameters +} + +// ImportPipelinesClientBeginCreateOptions contains the optional parameters for the ImportPipelinesClient.BeginCreate method. +type ImportPipelinesClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ImportPipelinesClientBeginDeleteOptions contains the optional parameters for the ImportPipelinesClient.BeginDelete method. +type ImportPipelinesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ImportPipelinesClientGetOptions contains the optional parameters for the ImportPipelinesClient.Get method. +type ImportPipelinesClientGetOptions struct { + // placeholder for future optional parameters +} + +// ImportPipelinesClientListOptions contains the optional parameters for the ImportPipelinesClient.NewListPager method. +type ImportPipelinesClientListOptions struct { + // placeholder for future optional parameters +} + // OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. type OperationsClientListOptions struct { // placeholder for future optional parameters } +// PipelineRunsClientBeginCreateOptions contains the optional parameters for the PipelineRunsClient.BeginCreate method. +type PipelineRunsClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PipelineRunsClientBeginDeleteOptions contains the optional parameters for the PipelineRunsClient.BeginDelete method. +type PipelineRunsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PipelineRunsClientGetOptions contains the optional parameters for the PipelineRunsClient.Get method. +type PipelineRunsClientGetOptions struct { + // placeholder for future optional parameters +} + +// PipelineRunsClientListOptions contains the optional parameters for the PipelineRunsClient.NewListPager method. +type PipelineRunsClientListOptions struct { + // placeholder for future optional parameters +} + // PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginCreateOrUpdate // method. type PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions struct { diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/pipelineruns_client.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/pipelineruns_client.go new file mode 100644 index 000000000000..8c512d8d06ba --- /dev/null +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/pipelineruns_client.go @@ -0,0 +1,345 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. 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" +) + +// PipelineRunsClient contains the methods for the PipelineRuns group. +// Don't use this type directly, use NewPipelineRunsClient() instead. +type PipelineRunsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewPipelineRunsClient creates a new instance of PipelineRunsClient 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 - pass nil to accept the default values. +func NewPipelineRunsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PipelineRunsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &PipelineRunsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreate - Creates a pipeline run for a container registry with the specified parameters +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - The name of the container registry. +// - pipelineRunName - The name of the pipeline run. +// - pipelineRunCreateParameters - The parameters for creating a pipeline run. +// - options - PipelineRunsClientBeginCreateOptions contains the optional parameters for the PipelineRunsClient.BeginCreate +// method. +func (client *PipelineRunsClient) BeginCreate(ctx context.Context, resourceGroupName string, registryName string, pipelineRunName string, pipelineRunCreateParameters PipelineRun, options *PipelineRunsClientBeginCreateOptions) (*runtime.Poller[PipelineRunsClientCreateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.create(ctx, resourceGroupName, registryName, pipelineRunName, pipelineRunCreateParameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PipelineRunsClientCreateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[PipelineRunsClientCreateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Create - Creates a pipeline run for a container registry with the specified parameters +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-11-01-preview +func (client *PipelineRunsClient) create(ctx context.Context, resourceGroupName string, registryName string, pipelineRunName string, pipelineRunCreateParameters PipelineRun, options *PipelineRunsClientBeginCreateOptions) (*http.Response, error) { + var err error + const operationName = "PipelineRunsClient.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, pipelineRunName, pipelineRunCreateParameters, 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 *PipelineRunsClient) createCreateRequest(ctx context.Context, resourceGroupName string, registryName string, pipelineRunName string, pipelineRunCreateParameters PipelineRun, options *PipelineRunsClientBeginCreateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName}" + 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 pipelineRunName == "" { + return nil, errors.New("parameter pipelineRunName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{pipelineRunName}", url.PathEscape(pipelineRunName)) + 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", "2023-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, pipelineRunCreateParameters); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Deletes a pipeline run from a container registry. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - The name of the container registry. +// - pipelineRunName - The name of the pipeline run. +// - options - PipelineRunsClientBeginDeleteOptions contains the optional parameters for the PipelineRunsClient.BeginDelete +// method. +func (client *PipelineRunsClient) BeginDelete(ctx context.Context, resourceGroupName string, registryName string, pipelineRunName string, options *PipelineRunsClientBeginDeleteOptions) (*runtime.Poller[PipelineRunsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, registryName, pipelineRunName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PipelineRunsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[PipelineRunsClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Deletes a pipeline run from a container registry. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-11-01-preview +func (client *PipelineRunsClient) deleteOperation(ctx context.Context, resourceGroupName string, registryName string, pipelineRunName string, options *PipelineRunsClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "PipelineRunsClient.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, pipelineRunName, 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.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *PipelineRunsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, registryName string, pipelineRunName string, options *PipelineRunsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName}" + 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 pipelineRunName == "" { + return nil, errors.New("parameter pipelineRunName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{pipelineRunName}", url.PathEscape(pipelineRunName)) + 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", "2023-11-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 pipeline run. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - The name of the container registry. +// - pipelineRunName - The name of the pipeline run. +// - options - PipelineRunsClientGetOptions contains the optional parameters for the PipelineRunsClient.Get method. +func (client *PipelineRunsClient) Get(ctx context.Context, resourceGroupName string, registryName string, pipelineRunName string, options *PipelineRunsClientGetOptions) (PipelineRunsClientGetResponse, error) { + var err error + const operationName = "PipelineRunsClient.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, pipelineRunName, options) + if err != nil { + return PipelineRunsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PipelineRunsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PipelineRunsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *PipelineRunsClient) getCreateRequest(ctx context.Context, resourceGroupName string, registryName string, pipelineRunName string, options *PipelineRunsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName}" + 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 pipelineRunName == "" { + return nil, errors.New("parameter pipelineRunName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{pipelineRunName}", url.PathEscape(pipelineRunName)) + 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", "2023-11-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 *PipelineRunsClient) getHandleResponse(resp *http.Response) (PipelineRunsClientGetResponse, error) { + result := PipelineRunsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PipelineRun); err != nil { + return PipelineRunsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Lists all the pipeline runs for the specified container registry. +// +// Generated from API version 2023-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - registryName - The name of the container registry. +// - options - PipelineRunsClientListOptions contains the optional parameters for the PipelineRunsClient.NewListPager method. +func (client *PipelineRunsClient) NewListPager(resourceGroupName string, registryName string, options *PipelineRunsClientListOptions) *runtime.Pager[PipelineRunsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[PipelineRunsClientListResponse]{ + More: func(page PipelineRunsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *PipelineRunsClientListResponse) (PipelineRunsClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "PipelineRunsClient.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 PipelineRunsClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *PipelineRunsClient) listCreateRequest(ctx context.Context, resourceGroupName string, registryName string, options *PipelineRunsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns" + 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", "2023-11-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 *PipelineRunsClient) listHandleResponse(resp *http.Response) (PipelineRunsClientListResponse, error) { + result := PipelineRunsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PipelineRunListResult); err != nil { + return PipelineRunsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/pipelineruns_client_example_test.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/pipelineruns_client_example_test.go new file mode 100644 index 000000000000..387bcea1def9 --- /dev/null +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/pipelineruns_client_example_test.go @@ -0,0 +1,296 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// 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" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/PipelineRunList.json +func ExamplePipelineRunsClient_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.NewPipelineRunsClient().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.PipelineRunListResult = armcontainerregistry.PipelineRunListResult{ + // Value: []*armcontainerregistry.PipelineRun{ + // { + // Name: to.Ptr("myPipelineRun"), + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/pipelineRuns"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/pipelineRuns/myPipelineRun"), + // Properties: &armcontainerregistry.PipelineRunProperties{ + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // Response: &armcontainerregistry.PipelineRunResponse{ + // CatalogDigest: to.Ptr("sha256@"), + // Progress: &armcontainerregistry.ProgressProperties{ + // Percentage: to.Ptr("20"), + // }, + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-04T17:23:21.926Z"); return t}()), + // Status: to.Ptr("Running"), + // Target: &armcontainerregistry.ExportPipelineTargetProperties{ + // Type: to.Ptr("AzureStorageBlob"), + // KeyVaultURI: to.Ptr("https://myvault.vault.azure.net/secrets/acrexportsas"), + // URI: to.Ptr("https://accountname.blob.core.windows.net/containername/myblob.tar.gz"), + // }, + // }, + // Request: &armcontainerregistry.PipelineRunRequest{ + // Artifacts: []*string{ + // to.Ptr("sourceRepository/hello-world"), + // to.Ptr("sourceRepository2@sha256:00000000000000000000000000000000000")}, + // PipelineResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/exportPipelines/myExportPipeline"), + // }, + // }, + // }, + // { + // Name: to.Ptr("myPipelineRun"), + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/pipelineRuns"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/pipelineRuns/myPipelineRun"), + // Properties: &armcontainerregistry.PipelineRunProperties{ + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // Response: &armcontainerregistry.PipelineRunResponse{ + // CatalogDigest: to.Ptr("sha256@"), + // ImportedArtifacts: []*string{ + // to.Ptr("sourceRepository/hello-world"), + // to.Ptr("sourceRepository2@sha256:00000000000000000000000000000000000")}, + // Progress: &armcontainerregistry.ProgressProperties{ + // Percentage: to.Ptr("100"), + // }, + // Source: &armcontainerregistry.ImportPipelineSourceProperties{ + // Type: to.Ptr(armcontainerregistry.PipelineSourceType("AzureStorageBlob")), + // KeyVaultURI: to.Ptr("https://myvault.vault.azure.net/secrets/acrimportsas"), + // URI: to.Ptr("https://accountname.blob.core.windows.net/containername/myblob.tar.gz"), + // }, + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-03T17:23:21.926Z"); return t}()), + // Status: to.Ptr("Succeeded"), + // }, + // Request: &armcontainerregistry.PipelineRunRequest{ + // PipelineResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/importPipelines/myImportPipeline"), + // }, + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/PipelineRunGet.json +func ExamplePipelineRunsClient_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.NewPipelineRunsClient().Get(ctx, "myResourceGroup", "myRegistry", "myPipelineRun", 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.PipelineRun = armcontainerregistry.PipelineRun{ + // Name: to.Ptr("myPipelineRun"), + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/pipelineRuns"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/pipelineRuns/myPipelineRun"), + // Properties: &armcontainerregistry.PipelineRunProperties{ + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // Response: &armcontainerregistry.PipelineRunResponse{ + // CatalogDigest: to.Ptr("sha256@"), + // Progress: &armcontainerregistry.ProgressProperties{ + // Percentage: to.Ptr("20"), + // }, + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-04T17:23:21.926Z"); return t}()), + // Status: to.Ptr("Running"), + // Target: &armcontainerregistry.ExportPipelineTargetProperties{ + // Type: to.Ptr("AzureStorageBlob"), + // KeyVaultURI: to.Ptr("https://myvault.vault.azure.net/secrets/acrexportsas"), + // URI: to.Ptr("https://accountname.blob.core.windows.net/containername/myblob.tar.gz"), + // }, + // }, + // Request: &armcontainerregistry.PipelineRunRequest{ + // Artifacts: []*string{ + // to.Ptr("sourceRepository/hello-world"), + // to.Ptr("sourceRepository2@sha256:00000000000000000000000000000000000")}, + // PipelineResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/exportPipelines/myExportPipeline"), + // }, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/PipelineRunCreate_Export.json +func ExamplePipelineRunsClient_BeginCreate_pipelineRunCreateExport() { + 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.NewPipelineRunsClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", "myPipelineRun", armcontainerregistry.PipelineRun{ + Properties: &armcontainerregistry.PipelineRunProperties{ + Request: &armcontainerregistry.PipelineRunRequest{ + Artifacts: []*string{ + to.Ptr("sourceRepository/hello-world"), + to.Ptr("sourceRepository2@sha256:00000000000000000000000000000000000")}, + PipelineResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/exportPipelines/myExportPipeline"), + Target: &armcontainerregistry.PipelineRunTargetProperties{ + Name: to.Ptr("myblob.tar.gz"), + Type: to.Ptr(armcontainerregistry.PipelineRunTargetTypeAzureStorageBlob), + }, + }, + }, + }, 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.PipelineRun = armcontainerregistry.PipelineRun{ + // Name: to.Ptr("myPipelineRun"), + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/pipelineRuns"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/pipelineRuns/myPipelineRun"), + // Properties: &armcontainerregistry.PipelineRunProperties{ + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // Response: &armcontainerregistry.PipelineRunResponse{ + // CatalogDigest: to.Ptr("sha256@"), + // Progress: &armcontainerregistry.ProgressProperties{ + // Percentage: to.Ptr("20"), + // }, + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-04T17:23:21.926Z"); return t}()), + // Status: to.Ptr("Running"), + // Target: &armcontainerregistry.ExportPipelineTargetProperties{ + // Type: to.Ptr("AzureStorageBlob"), + // KeyVaultURI: to.Ptr("https://myvault.vault.azure.net/secrets/acrexportsas"), + // URI: to.Ptr("https://accountname.blob.core.windows.net/containername/myblob.tar.gz"), + // }, + // }, + // Request: &armcontainerregistry.PipelineRunRequest{ + // Artifacts: []*string{ + // to.Ptr("sourceRepository/hello-world"), + // to.Ptr("sourceRepository2@sha256:00000000000000000000000000000000000")}, + // PipelineResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/exportPipelines/myExportPipeline"), + // }, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/PipelineRunCreate_Import.json +func ExamplePipelineRunsClient_BeginCreate_pipelineRunCreateImport() { + 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.NewPipelineRunsClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", "myPipelineRun", armcontainerregistry.PipelineRun{ + Properties: &armcontainerregistry.PipelineRunProperties{ + ForceUpdateTag: to.Ptr("2020-03-04T17:23:21.9261521+00:00"), + Request: &armcontainerregistry.PipelineRunRequest{ + CatalogDigest: to.Ptr("sha256@"), + PipelineResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/importPipelines/myImportPipeline"), + Source: &armcontainerregistry.PipelineRunSourceProperties{ + Name: to.Ptr("myblob.tar.gz"), + Type: to.Ptr(armcontainerregistry.PipelineRunSourceTypeAzureStorageBlob), + }, + }, + }, + }, 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.PipelineRun = armcontainerregistry.PipelineRun{ + // Name: to.Ptr("myPipelineRun"), + // Type: to.Ptr("Microsoft.ContainerRegistry/registries/pipelineRuns"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/pipelineRuns/myPipelineRun"), + // Properties: &armcontainerregistry.PipelineRunProperties{ + // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), + // Response: &armcontainerregistry.PipelineRunResponse{ + // CatalogDigest: to.Ptr("sha256@"), + // ImportedArtifacts: []*string{ + // to.Ptr("sourceRepository/hello-world"), + // to.Ptr("sourceRepository2@sha256:00000000000000000000000000000000000")}, + // Progress: &armcontainerregistry.ProgressProperties{ + // Percentage: to.Ptr("100"), + // }, + // Source: &armcontainerregistry.ImportPipelineSourceProperties{ + // Type: to.Ptr(armcontainerregistry.PipelineSourceType("AzureStorageBlob")), + // KeyVaultURI: to.Ptr("https://myvault.vault.azure.net/secrets/acrimportsas"), + // URI: to.Ptr("https://accountname.blob.core.windows.net/containername/myblob.tar.gz"), + // }, + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-04T17:23:21.926Z"); return t}()), + // Status: to.Ptr("Succeeded"), + // }, + // Request: &armcontainerregistry.PipelineRunRequest{ + // PipelineResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/importPipelines/myImportPipeline"), + // }, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/PipelineRunDelete.json +func ExamplePipelineRunsClient_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.NewPipelineRunsClient().BeginDelete(ctx, "myResourceGroup", "myRegistry", "myPipelineRun", 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/privateendpointconnections_client.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/privateendpointconnections_client.go index 695290cc979f..958bcdb5d1f5 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/privateendpointconnections_client.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/privateendpointconnections_client.go @@ -46,7 +46,7 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor // BeginCreateOrUpdate - Update the state of specified private endpoint connection associated with the container registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - registryName - The name of the container registry. // - privateEndpointConnectionName - The name of the private endpoint connection. @@ -74,7 +74,7 @@ func (client *PrivateEndpointConnectionsClient) BeginCreateOrUpdate(ctx context. // CreateOrUpdate - Update the state of specified private endpoint connection associated with the container registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview func (client *PrivateEndpointConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, registryName string, privateEndpointConnectionName string, privateEndpointConnection PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "PrivateEndpointConnectionsClient.BeginCreateOrUpdate" @@ -120,7 +120,7 @@ func (client *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, privateEndpointConnection); err != nil { @@ -132,7 +132,7 @@ func (client *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx // BeginDelete - Deletes the specified private endpoint connection associated with the container registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - registryName - The name of the container registry. // - privateEndpointConnectionName - The name of the private endpoint connection. @@ -159,7 +159,7 @@ func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, // Delete - Deletes the specified private endpoint connection associated with the container registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, registryName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "PrivateEndpointConnectionsClient.BeginDelete" @@ -205,7 +205,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -213,7 +213,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. // Get - Get the specified private endpoint connection associated with the container registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - registryName - The name of the container registry. // - privateEndpointConnectionName - The name of the private endpoint connection. @@ -265,7 +265,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -282,7 +282,7 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res // NewListPager - List all private endpoint connections in a container registry. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - registryName - The name of the container registry. // - options - PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListPager @@ -330,7 +330,7 @@ func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") 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 49407e2e37ca..342ad3e5e980 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/privateendpointconnections_client_example_test.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/privateendpointconnections_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/PrivateEndpointConnectionList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/PrivateEndpointConnectionList.json func ExamplePrivateEndpointConnectionsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -62,7 +62,7 @@ func ExamplePrivateEndpointConnectionsClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/PrivateEndpointConnectionGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/PrivateEndpointConnectionGet.json func ExamplePrivateEndpointConnectionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -98,7 +98,7 @@ func ExamplePrivateEndpointConnectionsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/PrivateEndpointConnectionCreateOrUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/PrivateEndpointConnectionCreateOrUpdate.json func ExamplePrivateEndpointConnectionsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -145,7 +145,7 @@ func ExamplePrivateEndpointConnectionsClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/PrivateEndpointConnectionDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/PrivateEndpointConnectionDelete.json func ExamplePrivateEndpointConnectionsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/registries_client.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/registries_client.go index d33c46433fd8..28776a974527 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/registries_client.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/registries_client.go @@ -47,7 +47,7 @@ func NewRegistriesClient(subscriptionID string, credential azcore.TokenCredentia // characters, be globally unique, and between 5 and 50 characters in length. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - registryNameCheckRequest - The object containing information for the availability request. // - options - RegistriesClientCheckNameAvailabilityOptions contains the optional parameters for the RegistriesClient.CheckNameAvailability // method. @@ -85,7 +85,7 @@ func (client *RegistriesClient) checkNameAvailabilityCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, registryNameCheckRequest); err != nil { @@ -106,7 +106,7 @@ func (client *RegistriesClient) checkNameAvailabilityHandleResponse(resp *http.R // BeginCreate - Creates a container registry with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - registryName - The name of the container registry. // - registry - The parameters for creating a container registry. @@ -132,7 +132,7 @@ func (client *RegistriesClient) BeginCreate(ctx context.Context, resourceGroupNa // Create - Creates a container registry with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview func (client *RegistriesClient) create(ctx context.Context, resourceGroupName string, registryName string, registry Registry, options *RegistriesClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "RegistriesClient.BeginCreate" @@ -174,7 +174,7 @@ func (client *RegistriesClient) createCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, registry); err != nil { @@ -186,7 +186,7 @@ func (client *RegistriesClient) createCreateRequest(ctx context.Context, resourc // BeginDelete - Deletes a container registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - registryName - The name of the container registry. // - options - RegistriesClientBeginDeleteOptions contains the optional parameters for the RegistriesClient.BeginDelete method. @@ -211,7 +211,7 @@ func (client *RegistriesClient) BeginDelete(ctx context.Context, resourceGroupNa // Delete - Deletes a container registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview func (client *RegistriesClient) deleteOperation(ctx context.Context, resourceGroupName string, registryName string, options *RegistriesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "RegistriesClient.BeginDelete" @@ -253,7 +253,7 @@ func (client *RegistriesClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -261,7 +261,7 @@ func (client *RegistriesClient) deleteCreateRequest(ctx context.Context, resourc // BeginGenerateCredentials - Generate keys for a token of a specified container registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - registryName - The name of the container registry. // - generateCredentialsParameters - The parameters for generating credentials. @@ -288,7 +288,7 @@ func (client *RegistriesClient) BeginGenerateCredentials(ctx context.Context, re // GenerateCredentials - Generate keys for a token of a specified container registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview func (client *RegistriesClient) generateCredentials(ctx context.Context, resourceGroupName string, registryName string, generateCredentialsParameters GenerateCredentialsParameters, options *RegistriesClientBeginGenerateCredentialsOptions) (*http.Response, error) { var err error const operationName = "RegistriesClient.BeginGenerateCredentials" @@ -330,7 +330,7 @@ func (client *RegistriesClient) generateCredentialsCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, generateCredentialsParameters); err != nil { @@ -342,7 +342,7 @@ func (client *RegistriesClient) generateCredentialsCreateRequest(ctx context.Con // Get - Gets the properties of the specified container registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - registryName - The name of the container registry. // - options - RegistriesClientGetOptions contains the optional parameters for the RegistriesClient.Get method. @@ -388,7 +388,7 @@ func (client *RegistriesClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -471,7 +471,7 @@ func (client *RegistriesClient) getBuildSourceUploadURLHandleResponse(resp *http // 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. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - registryName - The name of the container registry. // - groupName - The name of the private link resource. @@ -523,7 +523,7 @@ func (client *RegistriesClient) getPrivateLinkResourceCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -541,7 +541,7 @@ func (client *RegistriesClient) getPrivateLinkResourceHandleResponse(resp *http. // BeginImportImage - Copies an image to this container registry from the specified container registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - registryName - The name of the container registry. // - parameters - The parameters specifying the image to copy and the source container registry. @@ -568,7 +568,7 @@ func (client *RegistriesClient) BeginImportImage(ctx context.Context, resourceGr // ImportImage - Copies an image to this container registry from the specified container registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview func (client *RegistriesClient) importImage(ctx context.Context, resourceGroupName string, registryName string, parameters ImportImageParameters, options *RegistriesClientBeginImportImageOptions) (*http.Response, error) { var err error const operationName = "RegistriesClient.BeginImportImage" @@ -610,7 +610,7 @@ func (client *RegistriesClient) importImageCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err @@ -620,7 +620,7 @@ func (client *RegistriesClient) importImageCreateRequest(ctx context.Context, re // NewListPager - Lists all the container registries under the specified subscription. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - options - RegistriesClientListOptions contains the optional parameters for the RegistriesClient.NewListPager method. func (client *RegistriesClient) NewListPager(options *RegistriesClientListOptions) *runtime.Pager[RegistriesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[RegistriesClientListResponse]{ @@ -657,7 +657,7 @@ func (client *RegistriesClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -674,7 +674,7 @@ func (client *RegistriesClient) listHandleResponse(resp *http.Response) (Registr // NewListByResourceGroupPager - Lists all the container registries under the specified resource group. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - RegistriesClientListByResourceGroupOptions contains the optional parameters for the RegistriesClient.NewListByResourceGroupPager // method. @@ -717,7 +717,7 @@ func (client *RegistriesClient) listByResourceGroupCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -735,7 +735,7 @@ func (client *RegistriesClient) listByResourceGroupHandleResponse(resp *http.Res // ListCredentials - Lists the login credentials for the specified container registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - registryName - The name of the container registry. // - options - RegistriesClientListCredentialsOptions contains the optional parameters for the RegistriesClient.ListCredentials @@ -782,7 +782,7 @@ func (client *RegistriesClient) listCredentialsCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -799,7 +799,7 @@ func (client *RegistriesClient) listCredentialsHandleResponse(resp *http.Respons // NewListPrivateLinkResourcesPager - Lists the private link resources for a container registry. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - registryName - The name of the container registry. // - options - RegistriesClientListPrivateLinkResourcesOptions contains the optional parameters for the RegistriesClient.NewListPrivateLinkResourcesPager @@ -847,7 +847,7 @@ func (client *RegistriesClient) listPrivateLinkResourcesCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -865,7 +865,7 @@ func (client *RegistriesClient) listPrivateLinkResourcesHandleResponse(resp *htt // ListUsages - Gets the quota usages for the specified container registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - registryName - The name of the container registry. // - options - RegistriesClientListUsagesOptions contains the optional parameters for the RegistriesClient.ListUsages method. @@ -911,7 +911,7 @@ func (client *RegistriesClient) listUsagesCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -929,7 +929,7 @@ func (client *RegistriesClient) listUsagesHandleResponse(resp *http.Response) (R // RegenerateCredential - Regenerates one of the login credentials for the specified container registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - registryName - The name of the container registry. // - regenerateCredentialParameters - Specifies name of the password which should be regenerated -- password or password2. @@ -977,7 +977,7 @@ func (client *RegistriesClient) regenerateCredentialCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, regenerateCredentialParameters); err != nil { @@ -1078,7 +1078,7 @@ func (client *RegistriesClient) scheduleRunCreateRequest(ctx context.Context, re // BeginUpdate - Updates a container registry with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - registryName - The name of the container registry. // - registryUpdateParameters - The parameters for updating a container registry. @@ -1104,7 +1104,7 @@ func (client *RegistriesClient) BeginUpdate(ctx context.Context, resourceGroupNa // Update - Updates a container registry with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview func (client *RegistriesClient) update(ctx context.Context, resourceGroupName string, registryName string, registryUpdateParameters RegistryUpdateParameters, options *RegistriesClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "RegistriesClient.BeginUpdate" @@ -1146,7 +1146,7 @@ func (client *RegistriesClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, registryUpdateParameters); err != nil { diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/registries_client_example_test.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/registries_client_example_test.go index b02cb5735e20..6d96b0f24247 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/registries_client_example_test.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/registries_client_example_test.go @@ -20,7 +20,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/ImportImageByManifestDigest.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ImportImageByManifestDigest.json func ExampleRegistriesClient_BeginImportImage_importImageByManifestDigest() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -51,7 +51,7 @@ func ExampleRegistriesClient_BeginImportImage_importImageByManifestDigest() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/ImportImageByTag.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ImportImageByTag.json func ExampleRegistriesClient_BeginImportImage_importImageByTag() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -82,7 +82,7 @@ func ExampleRegistriesClient_BeginImportImage_importImageByTag() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/ImportImageFromPublicRegistry.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ImportImageFromPublicRegistry.json func ExampleRegistriesClient_BeginImportImage_importImageFromPublicRegistry() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -113,7 +113,7 @@ func ExampleRegistriesClient_BeginImportImage_importImageFromPublicRegistry() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/RegistryCheckNameAvailable.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryCheckNameAvailable.json func ExampleRegistriesClient_CheckNameAvailability_registryCheckNameAvailable() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -139,7 +139,7 @@ func ExampleRegistriesClient_CheckNameAvailability_registryCheckNameAvailable() // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/RegistryCheckNameNotAvailable.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryCheckNameNotAvailable.json func ExampleRegistriesClient_CheckNameAvailability_registryCheckNameNotAvailable() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -167,7 +167,7 @@ func ExampleRegistriesClient_CheckNameAvailability_registryCheckNameNotAvailable // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/RegistryList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryList.json func ExampleRegistriesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -201,6 +201,7 @@ func ExampleRegistriesClient_NewListPager() { // }, // 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{ @@ -209,6 +210,7 @@ func ExampleRegistriesClient_NewListPager() { // Status: to.Ptr(armcontainerregistry.EncryptionStatusDisabled), // }, // LoginServer: to.Ptr("myRegistry.azurecr-test.io"), + // MetadataSearch: to.Ptr(armcontainerregistry.MetadataSearchDisabled), // NetworkRuleBypassOptions: to.Ptr(armcontainerregistry.NetworkRuleBypassOptionsAzureServices), // NetworkRuleSet: &armcontainerregistry.NetworkRuleSet{ // DefaultAction: to.Ptr(armcontainerregistry.DefaultActionAllow), @@ -247,7 +249,7 @@ func ExampleRegistriesClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/RegistryListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryListByResourceGroup.json func ExampleRegistriesClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -281,6 +283,7 @@ func ExampleRegistriesClient_NewListByResourceGroupPager() { // }, // 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{ @@ -289,6 +292,7 @@ func ExampleRegistriesClient_NewListByResourceGroupPager() { // Status: to.Ptr(armcontainerregistry.EncryptionStatusDisabled), // }, // LoginServer: to.Ptr("myRegistry.azurecr-test.io"), + // MetadataSearch: to.Ptr(armcontainerregistry.MetadataSearchDisabled), // NetworkRuleBypassOptions: to.Ptr(armcontainerregistry.NetworkRuleBypassOptionsAzureServices), // NetworkRuleSet: &armcontainerregistry.NetworkRuleSet{ // DefaultAction: to.Ptr(armcontainerregistry.DefaultActionAllow), @@ -327,7 +331,7 @@ func ExampleRegistriesClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/RegistryGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryGet.json func ExampleRegistriesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -355,6 +359,7 @@ func ExampleRegistriesClient_Get() { // }, // 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{ @@ -363,6 +368,7 @@ func ExampleRegistriesClient_Get() { // Status: to.Ptr(armcontainerregistry.EncryptionStatusDisabled), // }, // LoginServer: to.Ptr("myRegistry.azurecr-test.io"), + // MetadataSearch: to.Ptr(armcontainerregistry.MetadataSearchDisabled), // NetworkRuleBypassOptions: to.Ptr(armcontainerregistry.NetworkRuleBypassOptionsAzureServices), // NetworkRuleSet: &armcontainerregistry.NetworkRuleSet{ // DefaultAction: to.Ptr(armcontainerregistry.DefaultActionAllow), @@ -399,7 +405,7 @@ func ExampleRegistriesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/RegistryCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryCreate.json func ExampleRegistriesClient_BeginCreate_registryCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -442,6 +448,7 @@ func ExampleRegistriesClient_BeginCreate_registryCreate() { // }, // 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{ @@ -450,6 +457,7 @@ func ExampleRegistriesClient_BeginCreate_registryCreate() { // Status: to.Ptr(armcontainerregistry.EncryptionStatusDisabled), // }, // LoginServer: to.Ptr("myRegistry.azurecr-test.io"), + // MetadataSearch: to.Ptr(armcontainerregistry.MetadataSearchDisabled), // NetworkRuleBypassOptions: to.Ptr(armcontainerregistry.NetworkRuleBypassOptionsAzureServices), // NetworkRuleSet: &armcontainerregistry.NetworkRuleSet{ // DefaultAction: to.Ptr(armcontainerregistry.DefaultActionAllow), @@ -486,7 +494,7 @@ func ExampleRegistriesClient_BeginCreate_registryCreate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/RegistryCreateZoneRedundant.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryCreateZoneRedundant.json func ExampleRegistriesClient_BeginCreate_registryCreateZoneRedundant() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -529,6 +537,7 @@ func ExampleRegistriesClient_BeginCreate_registryCreateZoneRedundant() { // }, // 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{ @@ -537,6 +546,7 @@ func ExampleRegistriesClient_BeginCreate_registryCreateZoneRedundant() { // Status: to.Ptr(armcontainerregistry.EncryptionStatusDisabled), // }, // LoginServer: to.Ptr("myRegistry.azurecr-test.io"), + // MetadataSearch: to.Ptr(armcontainerregistry.MetadataSearchDisabled), // NetworkRuleBypassOptions: to.Ptr(armcontainerregistry.NetworkRuleBypassOptionsAzureServices), // NetworkRuleSet: &armcontainerregistry.NetworkRuleSet{ // DefaultAction: to.Ptr(armcontainerregistry.DefaultActionAllow), @@ -573,7 +583,7 @@ func ExampleRegistriesClient_BeginCreate_registryCreateZoneRedundant() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/RegistryDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryDelete.json func ExampleRegistriesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -594,7 +604,7 @@ func ExampleRegistriesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/RegistryUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryUpdate.json func ExampleRegistriesClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -636,6 +646,7 @@ func ExampleRegistriesClient_BeginUpdate() { // }, // 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{ @@ -644,6 +655,7 @@ func ExampleRegistriesClient_BeginUpdate() { // Status: to.Ptr(armcontainerregistry.EncryptionStatusDisabled), // }, // LoginServer: to.Ptr("myRegistry.azurecr-test.io"), + // MetadataSearch: to.Ptr(armcontainerregistry.MetadataSearchDisabled), // NetworkRuleBypassOptions: to.Ptr(armcontainerregistry.NetworkRuleBypassOptionsAzureServices), // NetworkRuleSet: &armcontainerregistry.NetworkRuleSet{ // DefaultAction: to.Ptr(armcontainerregistry.DefaultActionAllow), @@ -680,7 +692,7 @@ func ExampleRegistriesClient_BeginUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/RegistryListUsages.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryListUsages.json func ExampleRegistriesClient_ListUsages() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -715,7 +727,7 @@ func ExampleRegistriesClient_ListUsages() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/RegistryListPrivateLinkResources.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryListPrivateLinkResources.json func ExampleRegistriesClient_NewListPrivateLinkResourcesPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -756,7 +768,7 @@ func ExampleRegistriesClient_NewListPrivateLinkResourcesPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/RegistryGetPrivateLinkResource.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryGetPrivateLinkResource.json func ExampleRegistriesClient_GetPrivateLinkResource() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -789,7 +801,7 @@ func ExampleRegistriesClient_GetPrivateLinkResource() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/RegistryListCredentials.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryListCredentials.json func ExampleRegistriesClient_ListCredentials() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -821,7 +833,7 @@ func ExampleRegistriesClient_ListCredentials() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/RegistryRegenerateCredential.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryRegenerateCredential.json func ExampleRegistriesClient_RegenerateCredential() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -855,7 +867,7 @@ func ExampleRegistriesClient_RegenerateCredential() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/RegistryGenerateCredentials.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/RegistryGenerateCredentials.json func ExampleRegistriesClient_BeginGenerateCredentials() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -896,7 +908,7 @@ func ExampleRegistriesClient_BeginGenerateCredentials() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun.json func ExampleRegistriesClient_BeginScheduleRun_registriesScheduleRun() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -958,7 +970,7 @@ func ExampleRegistriesClient_BeginScheduleRun_registriesScheduleRun() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_EncodedTaskRun.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_EncodedTaskRun.json func ExampleRegistriesClient_BeginScheduleRun_registriesScheduleRunEncodedTaskRun() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1014,7 +1026,7 @@ func ExampleRegistriesClient_BeginScheduleRun_registriesScheduleRunEncodedTaskRu // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_FileTaskRun.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_FileTaskRun.json func ExampleRegistriesClient_BeginScheduleRun_registriesScheduleRunFileTaskRun() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1071,7 +1083,7 @@ func ExampleRegistriesClient_BeginScheduleRun_registriesScheduleRunFileTaskRun() // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_Task.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_Task.json func ExampleRegistriesClient_BeginScheduleRun_registriesScheduleRunTask() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1136,7 +1148,7 @@ func ExampleRegistriesClient_BeginScheduleRun_registriesScheduleRunTask() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_FileTask_WithCustomCredentials.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_FileTask_WithCustomCredentials.json func ExampleRegistriesClient_BeginScheduleRun_registriesScheduleRunTaskWithCustomCredentials() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1205,7 +1217,7 @@ func ExampleRegistriesClient_BeginScheduleRun_registriesScheduleRunTaskWithCusto // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_WithCustomCredentials.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_WithCustomCredentials.json func ExampleRegistriesClient_BeginScheduleRun_registriesScheduleRunWithCustomCredentials() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1295,7 +1307,7 @@ func ExampleRegistriesClient_BeginScheduleRun_registriesScheduleRunWithCustomCre // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_WithLogTemplate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_WithLogTemplate.json func ExampleRegistriesClient_BeginScheduleRun_registriesScheduleRunWithLogTemplate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1358,7 +1370,7 @@ func ExampleRegistriesClient_BeginScheduleRun_registriesScheduleRunWithLogTempla // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesGetBuildSourceUploadUrl.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesGetBuildSourceUploadUrl.json func ExampleRegistriesClient_GetBuildSourceUploadURL() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/replications_client.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/replications_client.go index abefe243ba7b..b7d3bb996900 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/replications_client.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/replications_client.go @@ -46,7 +46,7 @@ func NewReplicationsClient(subscriptionID string, credential azcore.TokenCredent // BeginCreate - Creates a replication for a container registry with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - registryName - The name of the container registry. // - replicationName - The name of the replication. @@ -74,7 +74,7 @@ func (client *ReplicationsClient) BeginCreate(ctx context.Context, resourceGroup // Create - Creates a replication for a container registry with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview func (client *ReplicationsClient) create(ctx context.Context, resourceGroupName string, registryName string, replicationName string, replication Replication, options *ReplicationsClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "ReplicationsClient.BeginCreate" @@ -120,7 +120,7 @@ func (client *ReplicationsClient) createCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, replication); err != nil { @@ -132,7 +132,7 @@ func (client *ReplicationsClient) createCreateRequest(ctx context.Context, resou // BeginDelete - Deletes a replication from a container registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - registryName - The name of the container registry. // - replicationName - The name of the replication. @@ -159,7 +159,7 @@ func (client *ReplicationsClient) BeginDelete(ctx context.Context, resourceGroup // Delete - Deletes a replication from a container registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview func (client *ReplicationsClient) deleteOperation(ctx context.Context, resourceGroupName string, registryName string, replicationName string, options *ReplicationsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ReplicationsClient.BeginDelete" @@ -205,7 +205,7 @@ func (client *ReplicationsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -213,7 +213,7 @@ func (client *ReplicationsClient) deleteCreateRequest(ctx context.Context, resou // Get - Gets the properties of the specified replication. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - registryName - The name of the container registry. // - replicationName - The name of the replication. @@ -264,7 +264,7 @@ func (client *ReplicationsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -281,7 +281,7 @@ func (client *ReplicationsClient) getHandleResponse(resp *http.Response) (Replic // NewListPager - Lists all the replications for the specified container registry. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - registryName - The name of the container registry. // - options - ReplicationsClientListOptions contains the optional parameters for the ReplicationsClient.NewListPager method. @@ -328,7 +328,7 @@ func (client *ReplicationsClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -346,7 +346,7 @@ func (client *ReplicationsClient) listHandleResponse(resp *http.Response) (Repli // BeginUpdate - Updates a replication for a container registry with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - registryName - The name of the container registry. // - replicationName - The name of the replication. @@ -374,7 +374,7 @@ func (client *ReplicationsClient) BeginUpdate(ctx context.Context, resourceGroup // Update - Updates a replication for a container registry with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview func (client *ReplicationsClient) update(ctx context.Context, resourceGroupName string, registryName string, replicationName string, replicationUpdateParameters ReplicationUpdateParameters, options *ReplicationsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "ReplicationsClient.BeginUpdate" @@ -420,7 +420,7 @@ func (client *ReplicationsClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, replicationUpdateParameters); err != nil { diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/replications_client_example_test.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/replications_client_example_test.go index d69581e1ab0e..86e339ab4171 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/replications_client_example_test.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/replications_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/ReplicationList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ReplicationList.json func ExampleReplicationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -65,7 +65,7 @@ func ExampleReplicationsClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/ReplicationGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ReplicationGet.json func ExampleReplicationsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -104,7 +104,7 @@ func ExampleReplicationsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/ReplicationCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ReplicationCreate.json func ExampleReplicationsClient_BeginCreate_replicationCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -152,7 +152,7 @@ func ExampleReplicationsClient_BeginCreate_replicationCreate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/ReplicationCreateZoneRedundant.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ReplicationCreateZoneRedundant.json func ExampleReplicationsClient_BeginCreate_replicationCreateZoneRedundant() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -204,7 +204,7 @@ func ExampleReplicationsClient_BeginCreate_replicationCreateZoneRedundant() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/ReplicationDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ReplicationDelete.json func ExampleReplicationsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -225,7 +225,7 @@ func ExampleReplicationsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/ReplicationUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ReplicationUpdate.json func ExampleReplicationsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/response_types.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/response_types.go index 08ed39340769..78d2b0720534 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/response_types.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/response_types.go @@ -46,6 +46,58 @@ type AgentPoolsClientUpdateResponse struct { AgentPool } +// ArchiveVersionsClientCreateResponse contains the response from method ArchiveVersionsClient.BeginCreate. +type ArchiveVersionsClientCreateResponse struct { + // An object that represents an export pipeline for a container registry. + ArchiveVersion +} + +// ArchiveVersionsClientDeleteResponse contains the response from method ArchiveVersionsClient.BeginDelete. +type ArchiveVersionsClientDeleteResponse struct { + // placeholder for future response values +} + +// ArchiveVersionsClientGetResponse contains the response from method ArchiveVersionsClient.Get. +type ArchiveVersionsClientGetResponse struct { + // An object that represents an export pipeline for a container registry. + ArchiveVersion +} + +// ArchiveVersionsClientListResponse contains the response from method ArchiveVersionsClient.NewListPager. +type ArchiveVersionsClientListResponse struct { + // The result of a request to list export pipelines for a container registry. + ArchiveVersionListResult +} + +// ArchivesClientCreateResponse contains the response from method ArchivesClient.BeginCreate. +type ArchivesClientCreateResponse struct { + // An object that represents a archive for a container registry. + Archive +} + +// ArchivesClientDeleteResponse contains the response from method ArchivesClient.BeginDelete. +type ArchivesClientDeleteResponse struct { + // placeholder for future response values +} + +// ArchivesClientGetResponse contains the response from method ArchivesClient.Get. +type ArchivesClientGetResponse struct { + // An object that represents a archive for a container registry. + Archive +} + +// ArchivesClientListResponse contains the response from method ArchivesClient.NewListPager. +type ArchivesClientListResponse struct { + // The result of a request to list archives for a container registry. + ArchiveListResult +} + +// ArchivesClientUpdateResponse contains the response from method ArchivesClient.Update. +type ArchivesClientUpdateResponse struct { + // An object that represents a archive for a container registry. + Archive +} + // CacheRulesClientCreateResponse contains the response from method CacheRulesClient.BeginCreate. type CacheRulesClientCreateResponse struct { // An object that represents a cache rule for a container registry. @@ -75,6 +127,40 @@ type CacheRulesClientUpdateResponse struct { CacheRule } +// ConnectedRegistriesClientCreateResponse contains the response from method ConnectedRegistriesClient.BeginCreate. +type ConnectedRegistriesClientCreateResponse struct { + // An object that represents a connected registry for a container registry. + ConnectedRegistry +} + +// ConnectedRegistriesClientDeactivateResponse contains the response from method ConnectedRegistriesClient.BeginDeactivate. +type ConnectedRegistriesClientDeactivateResponse struct { + // placeholder for future response values +} + +// ConnectedRegistriesClientDeleteResponse contains the response from method ConnectedRegistriesClient.BeginDelete. +type ConnectedRegistriesClientDeleteResponse struct { + // placeholder for future response values +} + +// ConnectedRegistriesClientGetResponse contains the response from method ConnectedRegistriesClient.Get. +type ConnectedRegistriesClientGetResponse struct { + // An object that represents a connected registry for a container registry. + ConnectedRegistry +} + +// ConnectedRegistriesClientListResponse contains the response from method ConnectedRegistriesClient.NewListPager. +type ConnectedRegistriesClientListResponse struct { + // The result of a request to list connected registries for a container registry. + ConnectedRegistryListResult +} + +// ConnectedRegistriesClientUpdateResponse contains the response from method ConnectedRegistriesClient.BeginUpdate. +type ConnectedRegistriesClientUpdateResponse struct { + // An object that represents a connected registry for a container registry. + ConnectedRegistry +} + // CredentialSetsClientCreateResponse contains the response from method CredentialSetsClient.BeginCreate. type CredentialSetsClientCreateResponse struct { // An object that represents a credential set resource for a container registry. @@ -104,12 +190,81 @@ type CredentialSetsClientUpdateResponse struct { CredentialSet } +// ExportPipelinesClientCreateResponse contains the response from method ExportPipelinesClient.BeginCreate. +type ExportPipelinesClientCreateResponse struct { + // An object that represents an export pipeline for a container registry. + ExportPipeline +} + +// ExportPipelinesClientDeleteResponse contains the response from method ExportPipelinesClient.BeginDelete. +type ExportPipelinesClientDeleteResponse struct { + // placeholder for future response values +} + +// ExportPipelinesClientGetResponse contains the response from method ExportPipelinesClient.Get. +type ExportPipelinesClientGetResponse struct { + // An object that represents an export pipeline for a container registry. + ExportPipeline +} + +// ExportPipelinesClientListResponse contains the response from method ExportPipelinesClient.NewListPager. +type ExportPipelinesClientListResponse struct { + // The result of a request to list export pipelines for a container registry. + ExportPipelineListResult +} + +// ImportPipelinesClientCreateResponse contains the response from method ImportPipelinesClient.BeginCreate. +type ImportPipelinesClientCreateResponse struct { + // An object that represents an import pipeline for a container registry. + ImportPipeline +} + +// ImportPipelinesClientDeleteResponse contains the response from method ImportPipelinesClient.BeginDelete. +type ImportPipelinesClientDeleteResponse struct { + // placeholder for future response values +} + +// ImportPipelinesClientGetResponse contains the response from method ImportPipelinesClient.Get. +type ImportPipelinesClientGetResponse struct { + // An object that represents an import pipeline for a container registry. + ImportPipeline +} + +// ImportPipelinesClientListResponse contains the response from method ImportPipelinesClient.NewListPager. +type ImportPipelinesClientListResponse struct { + // The result of a request to list import pipelines for a container registry. + ImportPipelineListResult +} + // OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { // The result of a request to list container registry operations. OperationListResult } +// PipelineRunsClientCreateResponse contains the response from method PipelineRunsClient.BeginCreate. +type PipelineRunsClientCreateResponse struct { + // An object that represents a pipeline run for a container registry. + PipelineRun +} + +// PipelineRunsClientDeleteResponse contains the response from method PipelineRunsClient.BeginDelete. +type PipelineRunsClientDeleteResponse struct { + // placeholder for future response values +} + +// PipelineRunsClientGetResponse contains the response from method PipelineRunsClient.Get. +type PipelineRunsClientGetResponse struct { + // An object that represents a pipeline run for a container registry. + PipelineRun +} + +// PipelineRunsClientListResponse contains the response from method PipelineRunsClient.NewListPager. +type PipelineRunsClientListResponse struct { + // The result of a request to list pipeline runs for a container registry. + PipelineRunListResult +} + // PrivateEndpointConnectionsClientCreateOrUpdateResponse contains the response from method PrivateEndpointConnectionsClient.BeginCreateOrUpdate. type PrivateEndpointConnectionsClientCreateOrUpdateResponse struct { // An object that represents a private endpoint connection for a container registry. diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/runs_client_example_test.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/runs_client_example_test.go index 868202be0cc7..818106717d3e 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/runs_client_example_test.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/runs_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RunsList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RunsList.json func ExampleRunsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -96,7 +96,7 @@ func ExampleRunsClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RunsGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RunsGet.json func ExampleRunsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -164,7 +164,7 @@ func ExampleRunsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RunsUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RunsUpdate.json func ExampleRunsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -238,7 +238,7 @@ func ExampleRunsClient_BeginUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RunsGetLogSasUrl.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RunsGetLogSasUrl.json func ExampleRunsClient_GetLogSasURL() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -261,7 +261,7 @@ func ExampleRunsClient_GetLogSasURL() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RunsCancel.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RunsCancel.json func ExampleRunsClient_BeginCancel() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/scopemaps_client.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/scopemaps_client.go index cff215097a4b..bc68830e0ca8 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/scopemaps_client.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/scopemaps_client.go @@ -46,7 +46,7 @@ func NewScopeMapsClient(subscriptionID string, credential azcore.TokenCredential // BeginCreate - Creates a scope map for a container registry with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - registryName - The name of the container registry. // - scopeMapName - The name of the scope map. @@ -73,7 +73,7 @@ func (client *ScopeMapsClient) BeginCreate(ctx context.Context, resourceGroupNam // Create - Creates a scope map for a container registry with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview func (client *ScopeMapsClient) create(ctx context.Context, resourceGroupName string, registryName string, scopeMapName string, scopeMapCreateParameters ScopeMap, options *ScopeMapsClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "ScopeMapsClient.BeginCreate" @@ -119,7 +119,7 @@ func (client *ScopeMapsClient) createCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, scopeMapCreateParameters); err != nil { @@ -131,7 +131,7 @@ func (client *ScopeMapsClient) createCreateRequest(ctx context.Context, resource // BeginDelete - Deletes a scope map from a container registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - registryName - The name of the container registry. // - scopeMapName - The name of the scope map. @@ -157,7 +157,7 @@ func (client *ScopeMapsClient) BeginDelete(ctx context.Context, resourceGroupNam // Delete - Deletes a scope map from a container registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview func (client *ScopeMapsClient) deleteOperation(ctx context.Context, resourceGroupName string, registryName string, scopeMapName string, options *ScopeMapsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ScopeMapsClient.BeginDelete" @@ -203,7 +203,7 @@ func (client *ScopeMapsClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -212,7 +212,7 @@ func (client *ScopeMapsClient) deleteCreateRequest(ctx context.Context, resource // Get - Gets the properties of the specified scope map. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - registryName - The name of the container registry. // - scopeMapName - The name of the scope map. @@ -263,7 +263,7 @@ func (client *ScopeMapsClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -280,7 +280,7 @@ func (client *ScopeMapsClient) getHandleResponse(resp *http.Response) (ScopeMaps // NewListPager - Lists all the scope maps for the specified container registry. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - registryName - The name of the container registry. // - options - ScopeMapsClientListOptions contains the optional parameters for the ScopeMapsClient.NewListPager method. @@ -327,7 +327,7 @@ func (client *ScopeMapsClient) listCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -345,7 +345,7 @@ func (client *ScopeMapsClient) listHandleResponse(resp *http.Response) (ScopeMap // BeginUpdate - Updates a scope map with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - registryName - The name of the container registry. // - scopeMapName - The name of the scope map. @@ -372,7 +372,7 @@ func (client *ScopeMapsClient) BeginUpdate(ctx context.Context, resourceGroupNam // Update - Updates a scope map with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview func (client *ScopeMapsClient) update(ctx context.Context, resourceGroupName string, registryName string, scopeMapName string, scopeMapUpdateParameters ScopeMapUpdateParameters, options *ScopeMapsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "ScopeMapsClient.BeginUpdate" @@ -418,7 +418,7 @@ func (client *ScopeMapsClient) updateCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, scopeMapUpdateParameters); err != nil { diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/scopemaps_client_example_test.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/scopemaps_client_example_test.go index 521a50221c71..c39860457a02 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/scopemaps_client_example_test.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/scopemaps_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/ScopeMapList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ScopeMapList.json func ExampleScopeMapsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -59,7 +59,7 @@ func ExampleScopeMapsClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/ScopeMapGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ScopeMapGet.json func ExampleScopeMapsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -92,7 +92,7 @@ func ExampleScopeMapsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/ScopeMapCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ScopeMapCreate.json func ExampleScopeMapsClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -136,7 +136,7 @@ func ExampleScopeMapsClient_BeginCreate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/ScopeMapDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ScopeMapDelete.json func ExampleScopeMapsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -157,7 +157,7 @@ func ExampleScopeMapsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/ScopeMapUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/ScopeMapUpdate.json func ExampleScopeMapsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/taskruns_client_example_test.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/taskruns_client_example_test.go index 91851b841720..ddd2af92cb5b 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/taskruns_client_example_test.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/taskruns_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsGet.json func ExampleTaskRunsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -83,7 +83,7 @@ func ExampleTaskRunsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsCreate.json func ExampleTaskRunsClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -165,7 +165,7 @@ func ExampleTaskRunsClient_BeginCreate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsDelete.json func ExampleTaskRunsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -186,7 +186,7 @@ func ExampleTaskRunsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsUpdate.json func ExampleTaskRunsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -269,7 +269,7 @@ func ExampleTaskRunsClient_BeginUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsGetDetails.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsGetDetails.json func ExampleTaskRunsClient_GetDetails() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -334,7 +334,7 @@ func ExampleTaskRunsClient_GetDetails() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsList.json func ExampleTaskRunsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/tasks_client_example_test.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/tasks_client_example_test.go index 7f9cdaa7f972..329a95a85074 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/tasks_client_example_test.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/tasks_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksList.json func ExampleTasksClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -119,7 +119,7 @@ func ExampleTasksClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksGet.json func ExampleTasksClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -212,7 +212,7 @@ func ExampleTasksClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksCreate.json func ExampleTasksClient_BeginCreate_tasksCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -373,7 +373,7 @@ func ExampleTasksClient_BeginCreate_tasksCreate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksCreate_QuickTask.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksCreate_QuickTask.json func ExampleTasksClient_BeginCreate_tasksCreateQuickTask() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -423,7 +423,7 @@ func ExampleTasksClient_BeginCreate_tasksCreateQuickTask() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/ManagedIdentity/TasksCreate_WithSystemAndUserIdentities.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/ManagedIdentity/TasksCreate_WithSystemAndUserIdentities.json func ExampleTasksClient_BeginCreate_tasksCreateWithSystemAndUserIdentities() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -591,7 +591,7 @@ func ExampleTasksClient_BeginCreate_tasksCreateWithSystemAndUserIdentities() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/ManagedIdentity/TasksCreate_WithUserIdentities.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/ManagedIdentity/TasksCreate_WithUserIdentities.json func ExampleTasksClient_BeginCreate_tasksCreateWithUserIdentities() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -762,7 +762,7 @@ func ExampleTasksClient_BeginCreate_tasksCreateWithUserIdentities() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/ManagedIdentity/TasksCreate_WithSystemIdentity.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/ManagedIdentity/TasksCreate_WithSystemIdentity.json func ExampleTasksClient_BeginCreate_tasksCreateWithUserIdentitiesWithSystemIdentity() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -918,7 +918,7 @@ func ExampleTasksClient_BeginCreate_tasksCreateWithUserIdentitiesWithSystemIdent // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksDelete.json func ExampleTasksClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -939,7 +939,7 @@ func ExampleTasksClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksUpdate.json func ExampleTasksClient_BeginUpdate_tasksUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1082,7 +1082,7 @@ func ExampleTasksClient_BeginUpdate_tasksUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksUpdate_QuickTask.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksUpdate_QuickTask.json func ExampleTasksClient_BeginUpdate_tasksUpdateQuickTask() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1129,7 +1129,7 @@ func ExampleTasksClient_BeginUpdate_tasksUpdateQuickTask() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/ManagedIdentity/TasksUpdate_WithKeyVaultCustomCredentials.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/ManagedIdentity/TasksUpdate_WithKeyVaultCustomCredentials.json func ExampleTasksClient_BeginUpdate_tasksUpdateWithKeyVaultCustomCredentials() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1271,7 +1271,7 @@ func ExampleTasksClient_BeginUpdate_tasksUpdateWithKeyVaultCustomCredentials() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/ManagedIdentity/TasksUpdate_WithMSICustomCredentials.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/ManagedIdentity/TasksUpdate_WithMSICustomCredentials.json func ExampleTasksClient_BeginUpdate_tasksUpdateWithMsiCustomCredentials() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1403,7 +1403,7 @@ func ExampleTasksClient_BeginUpdate_tasksUpdateWithMsiCustomCredentials() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksUpdate_WithOpaqueCustomCredentials.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksUpdate_WithOpaqueCustomCredentials.json func ExampleTasksClient_BeginUpdate_tasksUpdateWithOpaqueCustomCredentials() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1542,7 +1542,7 @@ func ExampleTasksClient_BeginUpdate_tasksUpdateWithOpaqueCustomCredentials() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksGetDetails.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksGetDetails.json func ExampleTasksClient_GetDetails() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/tokens_client.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/tokens_client.go index 27274babc57c..7b34992b2349 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/tokens_client.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/tokens_client.go @@ -46,7 +46,7 @@ func NewTokensClient(subscriptionID string, credential azcore.TokenCredential, o // BeginCreate - Creates a token for a container registry with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - registryName - The name of the container registry. // - tokenName - The name of the token. @@ -73,7 +73,7 @@ func (client *TokensClient) BeginCreate(ctx context.Context, resourceGroupName s // Create - Creates a token for a container registry with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview func (client *TokensClient) create(ctx context.Context, resourceGroupName string, registryName string, tokenName string, tokenCreateParameters Token, options *TokensClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "TokensClient.BeginCreate" @@ -119,7 +119,7 @@ func (client *TokensClient) createCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, tokenCreateParameters); err != nil { @@ -131,7 +131,7 @@ func (client *TokensClient) createCreateRequest(ctx context.Context, resourceGro // BeginDelete - Deletes a token from a container registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - registryName - The name of the container registry. // - tokenName - The name of the token. @@ -157,7 +157,7 @@ func (client *TokensClient) BeginDelete(ctx context.Context, resourceGroupName s // Delete - Deletes a token from a container registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview func (client *TokensClient) deleteOperation(ctx context.Context, resourceGroupName string, registryName string, tokenName string, options *TokensClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "TokensClient.BeginDelete" @@ -203,7 +203,7 @@ func (client *TokensClient) deleteCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -212,7 +212,7 @@ func (client *TokensClient) deleteCreateRequest(ctx context.Context, resourceGro // Get - Gets the properties of the specified token. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - registryName - The name of the container registry. // - tokenName - The name of the token. @@ -263,7 +263,7 @@ func (client *TokensClient) getCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -280,7 +280,7 @@ func (client *TokensClient) getHandleResponse(resp *http.Response) (TokensClient // NewListPager - Lists all the tokens for the specified container registry. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - registryName - The name of the container registry. // - options - TokensClientListOptions contains the optional parameters for the TokensClient.NewListPager method. @@ -327,7 +327,7 @@ func (client *TokensClient) listCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -345,7 +345,7 @@ func (client *TokensClient) listHandleResponse(resp *http.Response) (TokensClien // BeginUpdate - Updates a token with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - registryName - The name of the container registry. // - tokenName - The name of the token. @@ -372,7 +372,7 @@ func (client *TokensClient) BeginUpdate(ctx context.Context, resourceGroupName s // Update - Updates a token with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview func (client *TokensClient) update(ctx context.Context, resourceGroupName string, registryName string, tokenName string, tokenUpdateParameters TokenUpdateParameters, options *TokensClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "TokensClient.BeginUpdate" @@ -418,7 +418,7 @@ func (client *TokensClient) updateCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, tokenUpdateParameters); err != nil { diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/tokens_client_example_test.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/tokens_client_example_test.go index 8362628817f3..71d236858d97 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/tokens_client_example_test.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/tokens_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/TokenList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/TokenList.json func ExampleTokensClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -57,7 +57,7 @@ func ExampleTokensClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/TokenGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/TokenGet.json func ExampleTokensClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -88,7 +88,7 @@ func ExampleTokensClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/TokenCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/TokenCreate.json func ExampleTokensClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -143,7 +143,7 @@ func ExampleTokensClient_BeginCreate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/TokenDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/TokenDelete.json func ExampleTokensClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -164,7 +164,7 @@ func ExampleTokensClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/TokenUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/TokenUpdate.json func ExampleTokensClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/webhooks_client.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/webhooks_client.go index 9ee0845d20cd..31276c3680b9 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/webhooks_client.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/webhooks_client.go @@ -46,7 +46,7 @@ func NewWebhooksClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreate - Creates a webhook for a container registry with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - registryName - The name of the container registry. // - webhookName - The name of the webhook. @@ -73,7 +73,7 @@ func (client *WebhooksClient) BeginCreate(ctx context.Context, resourceGroupName // Create - Creates a webhook for a container registry with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview func (client *WebhooksClient) create(ctx context.Context, resourceGroupName string, registryName string, webhookName string, webhookCreateParameters WebhookCreateParameters, options *WebhooksClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "WebhooksClient.BeginCreate" @@ -119,7 +119,7 @@ func (client *WebhooksClient) createCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, webhookCreateParameters); err != nil { @@ -131,7 +131,7 @@ func (client *WebhooksClient) createCreateRequest(ctx context.Context, resourceG // BeginDelete - Deletes a webhook from a container registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - registryName - The name of the container registry. // - webhookName - The name of the webhook. @@ -157,7 +157,7 @@ func (client *WebhooksClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Deletes a webhook from a container registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview func (client *WebhooksClient) deleteOperation(ctx context.Context, resourceGroupName string, registryName string, webhookName string, options *WebhooksClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "WebhooksClient.BeginDelete" @@ -203,7 +203,7 @@ func (client *WebhooksClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -211,7 +211,7 @@ func (client *WebhooksClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Gets the properties of the specified webhook. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - registryName - The name of the container registry. // - webhookName - The name of the webhook. @@ -262,7 +262,7 @@ func (client *WebhooksClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -280,7 +280,7 @@ func (client *WebhooksClient) getHandleResponse(resp *http.Response) (WebhooksCl // GetCallbackConfig - Gets the configuration of service URI and custom headers for the webhook. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - registryName - The name of the container registry. // - webhookName - The name of the webhook. @@ -332,7 +332,7 @@ func (client *WebhooksClient) getCallbackConfigCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -349,7 +349,7 @@ func (client *WebhooksClient) getCallbackConfigHandleResponse(resp *http.Respons // NewListPager - Lists all the webhooks for the specified container registry. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - registryName - The name of the container registry. // - options - WebhooksClientListOptions contains the optional parameters for the WebhooksClient.NewListPager method. @@ -396,7 +396,7 @@ func (client *WebhooksClient) listCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -413,7 +413,7 @@ func (client *WebhooksClient) listHandleResponse(resp *http.Response) (WebhooksC // NewListEventsPager - Lists recent events for the specified webhook. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - registryName - The name of the container registry. // - webhookName - The name of the webhook. @@ -465,7 +465,7 @@ func (client *WebhooksClient) listEventsCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -483,7 +483,7 @@ func (client *WebhooksClient) listEventsHandleResponse(resp *http.Response) (Web // Ping - Triggers a ping event to be sent to the webhook. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - registryName - The name of the container registry. // - webhookName - The name of the webhook. @@ -534,7 +534,7 @@ func (client *WebhooksClient) pingCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -552,7 +552,7 @@ func (client *WebhooksClient) pingHandleResponse(resp *http.Response) (WebhooksC // BeginUpdate - Updates a webhook with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - registryName - The name of the container registry. // - webhookName - The name of the webhook. @@ -579,7 +579,7 @@ func (client *WebhooksClient) BeginUpdate(ctx context.Context, resourceGroupName // Update - Updates a webhook with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-07-01 +// Generated from API version 2023-11-01-preview func (client *WebhooksClient) update(ctx context.Context, resourceGroupName string, registryName string, webhookName string, webhookUpdateParameters WebhookUpdateParameters, options *WebhooksClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "WebhooksClient.BeginUpdate" @@ -625,7 +625,7 @@ func (client *WebhooksClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-07-01") + reqQP.Set("api-version", "2023-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, webhookUpdateParameters); err != nil { diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/webhooks_client_example_test.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/webhooks_client_example_test.go index 0b8144c603aa..104937b054eb 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/webhooks_client_example_test.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/webhooks_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/WebhookList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/WebhookList.json func ExampleWebhooksClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -62,7 +62,7 @@ func ExampleWebhooksClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/WebhookGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/WebhookGet.json func ExampleWebhooksClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -98,7 +98,7 @@ func ExampleWebhooksClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/WebhookCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/WebhookCreate.json func ExampleWebhooksClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -153,7 +153,7 @@ func ExampleWebhooksClient_BeginCreate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/WebhookDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/WebhookDelete.json func ExampleWebhooksClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -174,7 +174,7 @@ func ExampleWebhooksClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/WebhookUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/WebhookUpdate.json func ExampleWebhooksClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -228,7 +228,7 @@ func ExampleWebhooksClient_BeginUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/WebhookPing.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/WebhookPing.json func ExampleWebhooksClient_Ping() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -251,7 +251,7 @@ func ExampleWebhooksClient_Ping() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/WebhookListEvents.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/WebhookListEvents.json func ExampleWebhooksClient_NewListEventsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -326,7 +326,7 @@ func ExampleWebhooksClient_NewListEventsPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/WebhookGetCallbackConfig.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bf204aab860f2eb58a9d346b00d44760f2a9b0a2/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-11-01-preview/examples/WebhookGetCallbackConfig.json func ExampleWebhooksClient_GetCallbackConfig() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil {