From c4f58f10de747144dff9c2d36a0245c80baaddbe Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 13 May 2025 06:44:31 +0000 Subject: [PATCH] CodeGen from PR 34584 in Azure/azure-rest-api-specs Merge ee60433f52c5106dfb0a70169c8c4a7d43907282 into ba0c086df0ebe03a61579485c1c10de0d17804b2 --- .../armcontainerregistry/CHANGELOG.md | 7 + .../agentpools_client_example_test.go | 221 -- .../armcontainerregistry/archives_client.go | 24 +- .../archives_client_example_test.go | 225 -- .../archiveversions_client.go | 20 +- .../archiveversions_client_example_test.go | 153 -- .../armcontainerregistry/autorest.md | 7 +- .../armcontainerregistry/cacherules_client.go | 26 +- .../cacherules_client_example_test.go | 194 -- .../connectedregistries_client.go | 32 +- ...connectedregistries_client_example_test.go | 326 --- .../armcontainerregistry/constants.go | 6 +- .../credentialsets_client.go | 26 +- .../credentialsets_client_example_test.go | 254 --- .../exportpipelines_client.go | 20 +- .../exportpipelines_client_example_test.go | 189 -- .../armcontainerregistry/fake/time_rfc3339.go | 110 - .../armcontainerregistry/go.mod | 2 +- .../importpipelines_client.go | 20 +- .../importpipelines_client_example_test.go | 227 -- .../armcontainerregistry/models.go | 6 + .../armcontainerregistry/models_serde.go | 8 + .../armcontainerregistry/operations_client.go | 4 +- .../operations_client_example_test.go | 55 - .../pipelineruns_client.go | 20 +- .../pipelineruns_client_example_test.go | 296 --- .../privateendpointconnections_client.go | 20 +- ...endpointconnections_client_example_test.go | 167 -- .../armcontainerregistry/registries_client.go | 66 +- .../registries_client_example_test.go | 1567 -------------- .../replications_client.go | 26 +- .../replications_client_example_test.go | 273 --- .../runs_client_example_test.go | 275 --- .../armcontainerregistry/scopemaps_client.go | 26 +- .../scopemaps_client_example_test.go | 202 -- .../taskruns_client_example_test.go | 404 ---- .../tasks_client_example_test.go | 1895 ----------------- .../armcontainerregistry/tokens_client.go | 26 +- .../tokens_client_example_test.go | 218 -- .../armcontainerregistry/webhooks_client.go | 38 +- .../webhooks_client_example_test.go | 353 --- 41 files changed, 225 insertions(+), 7809 deletions(-) delete mode 100644 sdk/resourcemanager/containerregistry/armcontainerregistry/agentpools_client_example_test.go delete mode 100644 sdk/resourcemanager/containerregistry/armcontainerregistry/archives_client_example_test.go delete mode 100644 sdk/resourcemanager/containerregistry/armcontainerregistry/archiveversions_client_example_test.go delete mode 100644 sdk/resourcemanager/containerregistry/armcontainerregistry/cacherules_client_example_test.go delete mode 100644 sdk/resourcemanager/containerregistry/armcontainerregistry/connectedregistries_client_example_test.go delete mode 100644 sdk/resourcemanager/containerregistry/armcontainerregistry/credentialsets_client_example_test.go delete mode 100644 sdk/resourcemanager/containerregistry/armcontainerregistry/exportpipelines_client_example_test.go delete mode 100644 sdk/resourcemanager/containerregistry/armcontainerregistry/fake/time_rfc3339.go delete mode 100644 sdk/resourcemanager/containerregistry/armcontainerregistry/importpipelines_client_example_test.go delete mode 100644 sdk/resourcemanager/containerregistry/armcontainerregistry/operations_client_example_test.go delete mode 100644 sdk/resourcemanager/containerregistry/armcontainerregistry/pipelineruns_client_example_test.go delete mode 100644 sdk/resourcemanager/containerregistry/armcontainerregistry/privateendpointconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/containerregistry/armcontainerregistry/registries_client_example_test.go delete mode 100644 sdk/resourcemanager/containerregistry/armcontainerregistry/replications_client_example_test.go delete mode 100644 sdk/resourcemanager/containerregistry/armcontainerregistry/runs_client_example_test.go delete mode 100644 sdk/resourcemanager/containerregistry/armcontainerregistry/scopemaps_client_example_test.go delete mode 100644 sdk/resourcemanager/containerregistry/armcontainerregistry/taskruns_client_example_test.go delete mode 100644 sdk/resourcemanager/containerregistry/armcontainerregistry/tasks_client_example_test.go delete mode 100644 sdk/resourcemanager/containerregistry/armcontainerregistry/tokens_client_example_test.go delete mode 100644 sdk/resourcemanager/containerregistry/armcontainerregistry/webhooks_client_example_test.go diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/CHANGELOG.md b/sdk/resourcemanager/containerregistry/armcontainerregistry/CHANGELOG.md index 815594890a68..51b7f0b20939 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/CHANGELOG.md +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/CHANGELOG.md @@ -1,5 +1,12 @@ # Release History +## 1.3.0-beta.4 (2025-05-13) +### Features Added + +- New field `NetworkRuleBypassAllowedForTasks` in struct `RegistryProperties` +- New field `NetworkRuleBypassAllowedForTasks` in struct `RegistryPropertiesUpdateParameters` + + ## 1.3.0-beta.3 (2025-04-24) ### Breaking Changes diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/agentpools_client_example_test.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/agentpools_client_example_test.go deleted file mode 100644 index bb9f051dadec..000000000000 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/agentpools_client_example_test.go +++ /dev/null @@ -1,221 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/AgentPoolsGet.json -func ExampleAgentPoolsClient_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.NewAgentPoolsClient().Get(ctx, "myResourceGroup", "myRegistry", "myAgentPool", 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.AgentPool = armcontainerregistry.AgentPool{ - // Name: to.Ptr("myAgentPool"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/agentPools"), - // ID: to.Ptr("/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourceGroups/huanwudfwestgroup/providers/Microsoft.ContainerRegistry/registries/huanglidfwest01/agentPools/testagent26"), - // Location: to.Ptr("WESTUS"), - // Properties: &armcontainerregistry.AgentPoolProperties{ - // Count: to.Ptr[int32](1), - // OS: to.Ptr(armcontainerregistry.OSLinux), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // Tier: to.Ptr("S1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/AgentPoolsCreate.json -func ExampleAgentPoolsClient_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.NewAgentPoolsClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", "myAgentPool", armcontainerregistry.AgentPool{ - Location: to.Ptr("WESTUS"), - Tags: map[string]*string{ - "key": to.Ptr("value"), - }, - Properties: &armcontainerregistry.AgentPoolProperties{ - Count: to.Ptr[int32](1), - OS: to.Ptr(armcontainerregistry.OSLinux), - Tier: to.Ptr("S1"), - }, - }, 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.AgentPool = armcontainerregistry.AgentPool{ - // Name: to.Ptr("myAgentPool"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/agentPools"), - // ID: to.Ptr("/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourceGroups/huanwudfwestgroup/providers/Microsoft.ContainerRegistry/registries/huanglidfwest01/agentPools/testagent26"), - // Location: to.Ptr("WESTUS"), - // Properties: &armcontainerregistry.AgentPoolProperties{ - // Count: to.Ptr[int32](1), - // OS: to.Ptr(armcontainerregistry.OSLinux), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // Tier: to.Ptr("S1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/AgentPoolsDelete.json -func ExampleAgentPoolsClient_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.NewAgentPoolsClient().BeginDelete(ctx, "myResourceGroup", "myRegistry", "myAgentPool", 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/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/AgentPoolsUpdate.json -func ExampleAgentPoolsClient_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.NewAgentPoolsClient().BeginUpdate(ctx, "myResourceGroup", "myRegistry", "myAgentPool", armcontainerregistry.AgentPoolUpdateParameters{ - Properties: &armcontainerregistry.AgentPoolPropertiesUpdateParameters{ - Count: to.Ptr[int32](1), - }, - }, 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.AgentPool = armcontainerregistry.AgentPool{ - // Name: to.Ptr("myAgentPool"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/agentPools"), - // ID: to.Ptr("/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourceGroups/huanwudfwestgroup/providers/Microsoft.ContainerRegistry/registries/huanglidfwest01/agentPools/testagent26"), - // Location: to.Ptr("WESTUS"), - // Properties: &armcontainerregistry.AgentPoolProperties{ - // Count: to.Ptr[int32](1), - // OS: to.Ptr(armcontainerregistry.OSLinux), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // Tier: to.Ptr("S1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/AgentPoolsList.json -func ExampleAgentPoolsClient_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.NewAgentPoolsClient().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.AgentPoolListResult = armcontainerregistry.AgentPoolListResult{ - // Value: []*armcontainerregistry.AgentPool{ - // { - // Name: to.Ptr("myAgentPool"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/agentPools"), - // ID: to.Ptr("/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourceGroups/huanwudfwestgroup/providers/Microsoft.ContainerRegistry/registries/huanglidfwest01/agentPools/testagent26"), - // Location: to.Ptr("WESTUS"), - // Properties: &armcontainerregistry.AgentPoolProperties{ - // Count: to.Ptr[int32](1), - // OS: to.Ptr(armcontainerregistry.OSLinux), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // Tier: to.Ptr("S1"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/AgentPoolsGetQueueStatus.json -func ExampleAgentPoolsClient_GetQueueStatus() { - 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.NewAgentPoolsClient().GetQueueStatus(ctx, "myResourceGroup", "myRegistry", "myAgentPool", 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.AgentPoolQueueStatus = armcontainerregistry.AgentPoolQueueStatus{ - // Count: to.Ptr[int32](10), - // } -} diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/archives_client.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/archives_client.go index ed9236307719..31254b303693 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/archives_client.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/archives_client.go @@ -43,7 +43,7 @@ func NewArchivesClient(subscriptionID string, credential azcore.TokenCredential, // 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 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -71,7 +71,7 @@ func (client *ArchivesClient) BeginCreate(ctx context.Context, resourceGroupName // 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 2025-03-01-preview +// Generated from API version 2025-05-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" @@ -121,7 +121,7 @@ func (client *ArchivesClient) createCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, archiveCreateParameters); err != nil { @@ -133,7 +133,7 @@ func (client *ArchivesClient) createCreateRequest(ctx context.Context, resourceG // BeginDelete - Deletes a archive from a container registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -160,7 +160,7 @@ func (client *ArchivesClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Deletes a archive from a container registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-03-01-preview +// Generated from API version 2025-05-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" @@ -210,7 +210,7 @@ func (client *ArchivesClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -219,7 +219,7 @@ func (client *ArchivesClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Gets the properties of the archive. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -275,7 +275,7 @@ func (client *ArchivesClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -292,7 +292,7 @@ func (client *ArchivesClient) getHandleResponse(resp *http.Response) (ArchivesCl // NewListPager - Lists all archives for the specified container registry and package type. // -// Generated from API version 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -344,7 +344,7 @@ func (client *ArchivesClient) listCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -362,7 +362,7 @@ func (client *ArchivesClient) listHandleResponse(resp *http.Response) (ArchivesC // 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 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -419,7 +419,7 @@ func (client *ArchivesClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, archiveUpdateParameters); err != nil { diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/archives_client_example_test.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/archives_client_example_test.go deleted file mode 100644 index a248de443bc2..000000000000 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/archives_client_example_test.go +++ /dev/null @@ -1,225 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-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/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-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/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-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/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-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/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-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 index c69c5fcc6d3f..ea83b1dec667 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/archiveversions_client.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/archiveversions_client.go @@ -43,7 +43,7 @@ func NewArchiveVersionsClient(subscriptionID string, credential azcore.TokenCred // 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 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -72,7 +72,7 @@ func (client *ArchiveVersionsClient) BeginCreate(ctx context.Context, resourceGr // 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 2025-03-01-preview +// Generated from API version 2025-05-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" @@ -126,7 +126,7 @@ func (client *ArchiveVersionsClient) createCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -135,7 +135,7 @@ func (client *ArchiveVersionsClient) createCreateRequest(ctx context.Context, re // BeginDelete - Deletes a archive version from a container registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -164,7 +164,7 @@ func (client *ArchiveVersionsClient) BeginDelete(ctx context.Context, resourceGr // Delete - Deletes a archive version from a container registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-03-01-preview +// Generated from API version 2025-05-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" @@ -218,7 +218,7 @@ func (client *ArchiveVersionsClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -227,7 +227,7 @@ func (client *ArchiveVersionsClient) deleteCreateRequest(ctx context.Context, re // Get - Gets the properties of the archive version. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -288,7 +288,7 @@ func (client *ArchiveVersionsClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -305,7 +305,7 @@ func (client *ArchiveVersionsClient) getHandleResponse(resp *http.Response) (Arc // NewListPager - Lists all archive versions for the specified container registry, repository type and archive name. // -// Generated from API version 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -363,7 +363,7 @@ func (client *ArchiveVersionsClient) listCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-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/archiveversions_client_example_test.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/archiveversions_client_example_test.go deleted file mode 100644 index c8e363d182df..000000000000 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/archiveversions_client_example_test.go +++ /dev/null @@ -1,153 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-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/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-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/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-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/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-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/autorest.md b/sdk/resourcemanager/containerregistry/armcontainerregistry/autorest.md index 85b58f667841..218cd795bc90 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/autorest.md +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/containerregistry/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/containerregistry/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.3.0-beta.3 -tag: package-2025-03-preview +module-version: 1.3.0-beta.4 ``` diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/cacherules_client.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/cacherules_client.go index a82a0d3d0975..0c828f47ac06 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/cacherules_client.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/cacherules_client.go @@ -43,7 +43,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 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -70,7 +70,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 2025-03-01-preview +// Generated from API version 2025-05-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" @@ -116,7 +116,7 @@ func (client *CacheRulesClient) createCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, cacheRuleCreateParameters); err != nil { @@ -128,7 +128,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 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -154,7 +154,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 2025-03-01-preview +// Generated from API version 2025-05-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" @@ -200,7 +200,7 @@ func (client *CacheRulesClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -209,7 +209,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 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -260,7 +260,7 @@ func (client *CacheRulesClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -277,7 +277,7 @@ func (client *CacheRulesClient) getHandleResponse(resp *http.Response) (CacheRul // NewListPager - Lists all cache rule resources for the specified container registry. // -// Generated from API version 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -324,7 +324,7 @@ func (client *CacheRulesClient) listCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -342,7 +342,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 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -369,7 +369,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 2025-03-01-preview +// Generated from API version 2025-05-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" @@ -415,7 +415,7 @@ func (client *CacheRulesClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-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 deleted file mode 100644 index 66121bf20647..000000000000 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/cacherules_client_example_test.go +++ /dev/null @@ -1,194 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/CacheRuleList.json -func ExampleCacheRulesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCacheRulesClient().NewListPager("myResourceGroup", "myRegistry", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CacheRulesListResult = armcontainerregistry.CacheRulesListResult{ - // Value: []*armcontainerregistry.CacheRule{ - // { - // Name: to.Ptr("myCacheRule"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/cacheRules"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/cacheRules/myCacheRule"), - // Properties: &armcontainerregistry.CacheRuleProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-07T18:20:33.837Z"); return t}()), - // CredentialSetResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet"), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // SourceRepository: to.Ptr("docker.io/library/hello-world"), - // TargetRepository: to.Ptr("cached-docker-hub/hello-world"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/CacheRuleGet.json -func ExampleCacheRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCacheRulesClient().Get(ctx, "myResourceGroup", "myRegistry", "myCacheRule", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CacheRule = armcontainerregistry.CacheRule{ - // Name: to.Ptr("myCacheRule"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/cacheRules"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/cacheRules/myCacheRule"), - // Properties: &armcontainerregistry.CacheRuleProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-07T18:20:33.837Z"); return t}()), - // CredentialSetResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet"), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // SourceRepository: to.Ptr("docker.io/library/hello-world"), - // TargetRepository: to.Ptr("cached-docker-hub/hello-world"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/CacheRuleCreate.json -func ExampleCacheRulesClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCacheRulesClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", "myCacheRule", armcontainerregistry.CacheRule{ - Properties: &armcontainerregistry.CacheRuleProperties{ - CredentialSetResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet"), - SourceRepository: to.Ptr("docker.io/library/hello-world"), - TargetRepository: to.Ptr("cached-docker-hub/hello-world"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CacheRule = armcontainerregistry.CacheRule{ - // Name: to.Ptr("myCacheRule"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/cacheRules"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/cacheRules/myCacheRule"), - // Properties: &armcontainerregistry.CacheRuleProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-07T18:20:33.837Z"); return t}()), - // CredentialSetResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet"), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // SourceRepository: to.Ptr("docker.io/library/hello-world"), - // TargetRepository: to.Ptr("cached-docker-hub/hello-world"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/CacheRuleDelete.json -func ExampleCacheRulesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCacheRulesClient().BeginDelete(ctx, "myResourceGroup", "myRegistry", "myCacheRule", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/CacheRuleUpdate.json -func ExampleCacheRulesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCacheRulesClient().BeginUpdate(ctx, "myResourceGroup", "myRegistry", "myCacheRule", armcontainerregistry.CacheRuleUpdateParameters{ - Properties: &armcontainerregistry.CacheRuleUpdateProperties{ - CredentialSetResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CacheRule = armcontainerregistry.CacheRule{ - // Name: to.Ptr("myCacheRule"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/cacheRules"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/cacheRules/myCacheRule"), - // Properties: &armcontainerregistry.CacheRuleProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-07T18:20:33.837Z"); return t}()), - // CredentialSetResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet2"), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // SourceRepository: to.Ptr("docker.io/library/hello-world"), - // TargetRepository: to.Ptr("cached-docker-hub/hello-world"), - // }, - // } -} diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/connectedregistries_client.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/connectedregistries_client.go index 3c37f0d253f1..b8e7b89094c7 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/connectedregistries_client.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/connectedregistries_client.go @@ -43,7 +43,7 @@ func NewConnectedRegistriesClient(subscriptionID string, credential azcore.Token // 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 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -71,7 +71,7 @@ func (client *ConnectedRegistriesClient) BeginCreate(ctx context.Context, resour // 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 2025-03-01-preview +// Generated from API version 2025-05-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" @@ -117,7 +117,7 @@ func (client *ConnectedRegistriesClient) createCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, connectedRegistryCreateParameters); err != nil { @@ -129,7 +129,7 @@ func (client *ConnectedRegistriesClient) createCreateRequest(ctx context.Context // BeginDeactivate - Deactivates the connected registry instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -156,7 +156,7 @@ func (client *ConnectedRegistriesClient) BeginDeactivate(ctx context.Context, re // Deactivate - Deactivates the connected registry instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-03-01-preview +// Generated from API version 2025-05-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" @@ -202,7 +202,7 @@ func (client *ConnectedRegistriesClient) deactivateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -211,7 +211,7 @@ func (client *ConnectedRegistriesClient) deactivateCreateRequest(ctx context.Con // BeginDelete - Deletes a connected registry from a container registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -238,7 +238,7 @@ func (client *ConnectedRegistriesClient) BeginDelete(ctx context.Context, resour // Delete - Deletes a connected registry from a container registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-03-01-preview +// Generated from API version 2025-05-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" @@ -284,7 +284,7 @@ func (client *ConnectedRegistriesClient) deleteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -293,7 +293,7 @@ func (client *ConnectedRegistriesClient) deleteCreateRequest(ctx context.Context // Get - Gets the properties of the connected registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -344,7 +344,7 @@ func (client *ConnectedRegistriesClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -361,7 +361,7 @@ func (client *ConnectedRegistriesClient) getHandleResponse(resp *http.Response) // NewListPager - Lists all connected registries for the specified container registry. // -// Generated from API version 2025-03-01-preview +// Generated from API version 2025-05-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 @@ -412,7 +412,7 @@ func (client *ConnectedRegistriesClient) listCreateRequest(ctx context.Context, if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -430,7 +430,7 @@ func (client *ConnectedRegistriesClient) listHandleResponse(resp *http.Response) // BeginUpdate - Updates a connected registry with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -458,7 +458,7 @@ func (client *ConnectedRegistriesClient) BeginUpdate(ctx context.Context, resour // Update - Updates a connected registry with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-03-01-preview +// Generated from API version 2025-05-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" @@ -504,7 +504,7 @@ func (client *ConnectedRegistriesClient) updateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, connectedRegistryUpdateParameters); err != nil { diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/connectedregistries_client_example_test.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/connectedregistries_client_example_test.go deleted file mode 100644 index 9b56be9a1d9a..000000000000 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/connectedregistries_client_example_test.go +++ /dev/null @@ -1,326 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-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")}, - // GarbageCollection: &armcontainerregistry.GarbageCollectionProperties{ - // Enabled: to.Ptr(true), - // Schedule: to.Ptr("0 5 * * *"), - // }, - // Logging: &armcontainerregistry.LoggingProperties{ - // AuditLogStatus: to.Ptr(armcontainerregistry.AuditLogStatusDisabled), - // LogLevel: to.Ptr(armcontainerregistry.LogLevelInformation), - // }, - // Mode: to.Ptr(armcontainerregistry.ConnectedRegistryModeReadWrite), - // NotificationsList: []*string{ - // to.Ptr("hello-world:*:*"), - // to.Ptr("sample/repo/*:1.0:*")}, - // Parent: &armcontainerregistry.ParentProperties{ - // SyncProperties: &armcontainerregistry.SyncProperties{ - // MessageTTL: to.Ptr("P2D"), - // Schedule: to.Ptr("0 9 * * *"), - // SyncWindow: to.Ptr("PT3H"), - // TokenID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/syncToken"), - // }, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-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")}, - // GarbageCollection: &armcontainerregistry.GarbageCollectionProperties{ - // Enabled: to.Ptr(true), - // Schedule: to.Ptr("0 5 * * *"), - // }, - // Logging: &armcontainerregistry.LoggingProperties{ - // AuditLogStatus: to.Ptr(armcontainerregistry.AuditLogStatusDisabled), - // LogLevel: to.Ptr(armcontainerregistry.LogLevelInformation), - // }, - // Mode: to.Ptr(armcontainerregistry.ConnectedRegistryModeReadWrite), - // NotificationsList: []*string{ - // to.Ptr("hello-world:*:*"), - // to.Ptr("sample/repo/*:1.0:*")}, - // Parent: &armcontainerregistry.ParentProperties{ - // SyncProperties: &armcontainerregistry.SyncProperties{ - // MessageTTL: to.Ptr("P2D"), - // Schedule: to.Ptr("0 9 * * *"), - // SyncWindow: to.Ptr("PT3H"), - // TokenID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/syncToken"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-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")}, - GarbageCollection: &armcontainerregistry.GarbageCollectionProperties{ - Enabled: to.Ptr(true), - Schedule: to.Ptr("0 5 * * *"), - }, - Mode: to.Ptr(armcontainerregistry.ConnectedRegistryModeReadWrite), - NotificationsList: []*string{ - to.Ptr("hello-world:*:*"), - to.Ptr("sample/repo/*:1.0:*")}, - Parent: &armcontainerregistry.ParentProperties{ - SyncProperties: &armcontainerregistry.SyncProperties{ - MessageTTL: to.Ptr("P2D"), - Schedule: to.Ptr("0 9 * * *"), - SyncWindow: to.Ptr("PT3H"), - TokenID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/syncToken"), - }, - }, - }, - }, nil) - 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")}, - // GarbageCollection: &armcontainerregistry.GarbageCollectionProperties{ - // Enabled: to.Ptr(true), - // Schedule: to.Ptr("0 5 * * *"), - // }, - // Logging: &armcontainerregistry.LoggingProperties{ - // AuditLogStatus: to.Ptr(armcontainerregistry.AuditLogStatusDisabled), - // LogLevel: to.Ptr(armcontainerregistry.LogLevelInformation), - // }, - // Mode: to.Ptr(armcontainerregistry.ConnectedRegistryModeReadWrite), - // NotificationsList: []*string{ - // to.Ptr("hello-world:*:*"), - // to.Ptr("sample/repo/*:1.0:*")}, - // Parent: &armcontainerregistry.ParentProperties{ - // SyncProperties: &armcontainerregistry.SyncProperties{ - // MessageTTL: to.Ptr("P2D"), - // Schedule: to.Ptr("0 9 * * *"), - // SyncWindow: to.Ptr("PT3H"), - // TokenID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/syncToken"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-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/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-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")}, - GarbageCollection: &armcontainerregistry.GarbageCollectionProperties{ - Enabled: to.Ptr(true), - Schedule: to.Ptr("0 5 * * *"), - }, - Logging: &armcontainerregistry.LoggingProperties{ - AuditLogStatus: to.Ptr(armcontainerregistry.AuditLogStatusEnabled), - LogLevel: to.Ptr(armcontainerregistry.LogLevelDebug), - }, - NotificationsList: []*string{ - to.Ptr("hello-world:*:*"), - to.Ptr("sample/repo/*:1.0:*")}, - SyncProperties: &armcontainerregistry.SyncUpdateProperties{ - MessageTTL: to.Ptr("P30D"), - Schedule: to.Ptr("0 0 */10 * *"), - SyncWindow: to.Ptr("P2D"), - }, - }, - }, nil) - 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")}, - // GarbageCollection: &armcontainerregistry.GarbageCollectionProperties{ - // Enabled: to.Ptr(true), - // Schedule: to.Ptr("0 5 * * *"), - // }, - // Logging: &armcontainerregistry.LoggingProperties{ - // AuditLogStatus: to.Ptr(armcontainerregistry.AuditLogStatusEnabled), - // LogLevel: to.Ptr(armcontainerregistry.LogLevelDebug), - // }, - // 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/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-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 c7dbb3a9fb5c..42e7bb59ac0a 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/constants.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/constants.go @@ -7,7 +7,7 @@ package armcontainerregistry const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry" - moduleVersion = "v1.3.0-beta.3" + moduleVersion = "v1.3.0-beta.4" ) // Action - The action of IP ACL rule. @@ -551,7 +551,7 @@ func PossiblePolicyStatusValues() []PolicyStatus { } } -// ProvisioningState - The provisioning state of the archive at the time the operation was called. +// ProvisioningState - The provisioning state of this agent pool type ProvisioningState string const ( @@ -909,7 +909,7 @@ func PossibleTokenTypeValues() []TokenType { } } -// TriggerStatus - The current status of the source trigger. +// TriggerStatus - The current status of trigger. type TriggerStatus string const ( diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/credentialsets_client.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/credentialsets_client.go index ca21e43c3ecc..ed5d17057bc3 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/credentialsets_client.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/credentialsets_client.go @@ -43,7 +43,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 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -71,7 +71,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 2025-03-01-preview +// Generated from API version 2025-05-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" @@ -117,7 +117,7 @@ func (client *CredentialSetsClient) createCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, credentialSetCreateParameters); err != nil { @@ -129,7 +129,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 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -156,7 +156,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 2025-03-01-preview +// Generated from API version 2025-05-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" @@ -202,7 +202,7 @@ func (client *CredentialSetsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -211,7 +211,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 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -262,7 +262,7 @@ func (client *CredentialSetsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -279,7 +279,7 @@ func (client *CredentialSetsClient) getHandleResponse(resp *http.Response) (Cred // NewListPager - Lists all credential set resources for the specified container registry. // -// Generated from API version 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -326,7 +326,7 @@ func (client *CredentialSetsClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -344,7 +344,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 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -372,7 +372,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 2025-03-01-preview +// Generated from API version 2025-05-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" @@ -418,7 +418,7 @@ func (client *CredentialSetsClient) updateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-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 deleted file mode 100644 index eec64d8de37b..000000000000 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/credentialsets_client_example_test.go +++ /dev/null @@ -1,254 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/CredentialSetList.json -func ExampleCredentialSetsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCredentialSetsClient().NewListPager("myResourceGroup", "myRegistry", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CredentialSetListResult = armcontainerregistry.CredentialSetListResult{ - // Value: []*armcontainerregistry.CredentialSet{ - // { - // Name: to.Ptr("myCredentialSet"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/credentialSets"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet"), - // Identity: &armcontainerregistry.IdentityProperties{ - // Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // Properties: &armcontainerregistry.CredentialSetProperties{ - // AuthCredentials: []*armcontainerregistry.AuthCredential{ - // { - // Name: to.Ptr(armcontainerregistry.CredentialNameCredential1), - // CredentialHealth: &armcontainerregistry.CredentialHealth{ - // Status: to.Ptr(armcontainerregistry.CredentialHealthStatusHealthy), - // }, - // PasswordSecretIdentifier: to.Ptr("https://myvault.vault.azure.net/secrets/password"), - // UsernameSecretIdentifier: to.Ptr("https://myvault.vault.azure.net/secrets/username"), - // }}, - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-07T18:20:08.012Z"); return t}()), - // LoginServer: to.Ptr("docker.io"), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/CredentialSetGet.json -func ExampleCredentialSetsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCredentialSetsClient().Get(ctx, "myResourceGroup", "myRegistry", "myCredentialSet", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CredentialSet = armcontainerregistry.CredentialSet{ - // Name: to.Ptr("myCredentialSet"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/credentialSets"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet"), - // Identity: &armcontainerregistry.IdentityProperties{ - // Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // Properties: &armcontainerregistry.CredentialSetProperties{ - // AuthCredentials: []*armcontainerregistry.AuthCredential{ - // { - // Name: to.Ptr(armcontainerregistry.CredentialNameCredential1), - // CredentialHealth: &armcontainerregistry.CredentialHealth{ - // Status: to.Ptr(armcontainerregistry.CredentialHealthStatusHealthy), - // }, - // PasswordSecretIdentifier: to.Ptr("https://myvault.vault.azure.net/secrets/password"), - // UsernameSecretIdentifier: to.Ptr("https://myvault.vault.azure.net/secrets/username"), - // }}, - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-07T18:20:08.012Z"); return t}()), - // LoginServer: to.Ptr("docker.io"), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/CredentialSetCreate.json -func ExampleCredentialSetsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCredentialSetsClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", "myCredentialSet", armcontainerregistry.CredentialSet{ - Identity: &armcontainerregistry.IdentityProperties{ - Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssigned), - }, - Properties: &armcontainerregistry.CredentialSetProperties{ - AuthCredentials: []*armcontainerregistry.AuthCredential{ - { - Name: to.Ptr(armcontainerregistry.CredentialNameCredential1), - PasswordSecretIdentifier: to.Ptr("https://myvault.vault.azure.net/secrets/password"), - UsernameSecretIdentifier: to.Ptr("https://myvault.vault.azure.net/secrets/username"), - }}, - LoginServer: to.Ptr("docker.io"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CredentialSet = armcontainerregistry.CredentialSet{ - // Name: to.Ptr("myCredentialSet"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/credentialSets"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet"), - // Identity: &armcontainerregistry.IdentityProperties{ - // Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // Properties: &armcontainerregistry.CredentialSetProperties{ - // AuthCredentials: []*armcontainerregistry.AuthCredential{ - // { - // Name: to.Ptr(armcontainerregistry.CredentialNameCredential1), - // CredentialHealth: &armcontainerregistry.CredentialHealth{ - // Status: to.Ptr(armcontainerregistry.CredentialHealthStatusHealthy), - // }, - // PasswordSecretIdentifier: to.Ptr("https://myvault.vault.azure.net/secrets/password"), - // UsernameSecretIdentifier: to.Ptr("https://myvault.vault.azure.net/secrets/username"), - // }}, - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-07T18:20:08.012Z"); return t}()), - // LoginServer: to.Ptr("docker.io"), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/CredentialSetDelete.json -func ExampleCredentialSetsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCredentialSetsClient().BeginDelete(ctx, "myResourceGroup", "myRegistry", "myCredentialSet", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/CredentialSetUpdate.json -func ExampleCredentialSetsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCredentialSetsClient().BeginUpdate(ctx, "myResourceGroup", "myRegistry", "myCredentialSet", armcontainerregistry.CredentialSetUpdateParameters{ - Properties: &armcontainerregistry.CredentialSetUpdateProperties{ - AuthCredentials: []*armcontainerregistry.AuthCredential{ - { - Name: to.Ptr(armcontainerregistry.CredentialNameCredential1), - PasswordSecretIdentifier: to.Ptr("https://myvault.vault.azure.net/secrets/password2"), - UsernameSecretIdentifier: to.Ptr("https://myvault.vault.azure.net/secrets/username2"), - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CredentialSet = armcontainerregistry.CredentialSet{ - // Name: to.Ptr("myCredentialSet"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/credentialSets"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet"), - // Identity: &armcontainerregistry.IdentityProperties{ - // Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // Properties: &armcontainerregistry.CredentialSetProperties{ - // AuthCredentials: []*armcontainerregistry.AuthCredential{ - // { - // Name: to.Ptr(armcontainerregistry.CredentialNameCredential1), - // CredentialHealth: &armcontainerregistry.CredentialHealth{ - // Status: to.Ptr(armcontainerregistry.CredentialHealthStatusHealthy), - // }, - // PasswordSecretIdentifier: to.Ptr("https://myvault.vault.azure.net/secrets/password2"), - // UsernameSecretIdentifier: to.Ptr("https://myvault.vault.azure.net/secrets/username2"), - // }}, - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-07T18:20:08.012Z"); return t}()), - // LoginServer: to.Ptr("docker.io"), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // }, - // } -} diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/exportpipelines_client.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/exportpipelines_client.go index e0287c2b2c77..e6331a5a9682 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/exportpipelines_client.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/exportpipelines_client.go @@ -43,7 +43,7 @@ func NewExportPipelinesClient(subscriptionID string, credential azcore.TokenCred // 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 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -71,7 +71,7 @@ func (client *ExportPipelinesClient) BeginCreate(ctx context.Context, resourceGr // 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 2025-03-01-preview +// Generated from API version 2025-05-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" @@ -117,7 +117,7 @@ func (client *ExportPipelinesClient) createCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, exportPipelineCreateParameters); err != nil { @@ -129,7 +129,7 @@ func (client *ExportPipelinesClient) createCreateRequest(ctx context.Context, re // BeginDelete - Deletes an export pipeline from a container registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -156,7 +156,7 @@ func (client *ExportPipelinesClient) BeginDelete(ctx context.Context, resourceGr // Delete - Deletes an export pipeline from a container registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-03-01-preview +// Generated from API version 2025-05-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" @@ -202,7 +202,7 @@ func (client *ExportPipelinesClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -211,7 +211,7 @@ func (client *ExportPipelinesClient) deleteCreateRequest(ctx context.Context, re // Get - Gets the properties of the export pipeline. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -262,7 +262,7 @@ func (client *ExportPipelinesClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -279,7 +279,7 @@ func (client *ExportPipelinesClient) getHandleResponse(resp *http.Response) (Exp // NewListPager - Lists all export pipelines for the specified container registry. // -// Generated from API version 2025-03-01-preview +// Generated from API version 2025-05-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 @@ -327,7 +327,7 @@ func (client *ExportPipelinesClient) listCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-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/exportpipelines_client_example_test.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/exportpipelines_client_example_test.go deleted file mode 100644 index 15f57d579c3b..000000000000 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/exportpipelines_client_example_test.go +++ /dev/null @@ -1,189 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-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/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-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/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-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/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-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/time_rfc3339.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/time_rfc3339.go deleted file mode 100644 index 7691a451714b..000000000000 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/fake/time_rfc3339.go +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" - "regexp" - "strings" - "time" -) - -// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) - -const ( - utcDateTime = "2006-01-02T15:04:05.999999999" - utcDateTimeJSON = `"` + utcDateTime + `"` - utcDateTimeNoT = "2006-01-02 15:04:05.999999999" - utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` - dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` - dateTimeJSON = `"` + time.RFC3339Nano + `"` - dateTimeJSONNoT = `"` + dateTimeNoT + `"` -) - -type dateTimeRFC3339 time.Time - -func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalJSON() -} - -func (t dateTimeRFC3339) MarshalText() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalText() -} - -func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - tzOffset := tzOffsetRegex.Match(data) - hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") - var layout string - if tzOffset && hasT { - layout = dateTimeJSON - } else if tzOffset { - layout = dateTimeJSONNoT - } else if hasT { - layout = utcDateTimeJSON - } else { - layout = utcDateTimeJSONNoT - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - if len(data) == 0 { - return nil - } - tzOffset := tzOffsetRegex.Match(data) - hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") - var layout string - if tzOffset && hasT { - layout = time.RFC3339Nano - } else if tzOffset { - layout = dateTimeNoT - } else if hasT { - layout = utcDateTime - } else { - layout = utcDateTimeNoT - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) Parse(layout, value string) error { - p, err := time.Parse(layout, strings.ToUpper(value)) - *t = dateTimeRFC3339(p) - return err -} - -func (t dateTimeRFC3339) String() string { - return time.Time(t).Format(time.RFC3339Nano) -} - -func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { - if t == nil { - return - } else if azcore.IsNullValue(t) { - m[k] = nil - return - } else if reflect.ValueOf(t).IsNil() { - return - } - m[k] = (*dateTimeRFC3339)(t) -} - -func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || string(data) == "null" { - return nil - } - var aux dateTimeRFC3339 - if err := json.Unmarshal(data, &aux); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - *t = (*time.Time)(&aux) - return nil -} diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/go.mod b/sdk/resourcemanager/containerregistry/armcontainerregistry/go.mod index ca9c0faca26a..78be8f862f33 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/go.mod +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/go.mod @@ -4,13 +4,13 @@ go 1.23.0 require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.1 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2 github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.1 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3 v3.1.0 github.com/stretchr/testify v1.10.0 ) require ( + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/importpipelines_client.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/importpipelines_client.go index adeaa1f83191..4f6ecfd65c9a 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/importpipelines_client.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/importpipelines_client.go @@ -43,7 +43,7 @@ func NewImportPipelinesClient(subscriptionID string, credential azcore.TokenCred // 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 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -71,7 +71,7 @@ func (client *ImportPipelinesClient) BeginCreate(ctx context.Context, resourceGr // 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 2025-03-01-preview +// Generated from API version 2025-05-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" @@ -117,7 +117,7 @@ func (client *ImportPipelinesClient) createCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, importPipelineCreateParameters); err != nil { @@ -129,7 +129,7 @@ func (client *ImportPipelinesClient) createCreateRequest(ctx context.Context, re // BeginDelete - Deletes an import pipeline from a container registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -156,7 +156,7 @@ func (client *ImportPipelinesClient) BeginDelete(ctx context.Context, resourceGr // Delete - Deletes an import pipeline from a container registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-03-01-preview +// Generated from API version 2025-05-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" @@ -202,7 +202,7 @@ func (client *ImportPipelinesClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -211,7 +211,7 @@ func (client *ImportPipelinesClient) deleteCreateRequest(ctx context.Context, re // Get - Gets the properties of the import pipeline. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -262,7 +262,7 @@ func (client *ImportPipelinesClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -279,7 +279,7 @@ func (client *ImportPipelinesClient) getHandleResponse(resp *http.Response) (Imp // NewListPager - Lists all import pipelines for the specified container registry. // -// Generated from API version 2025-03-01-preview +// Generated from API version 2025-05-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 @@ -327,7 +327,7 @@ func (client *ImportPipelinesClient) listCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-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/importpipelines_client_example_test.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/importpipelines_client_example_test.go deleted file mode 100644 index 214274f860f7..000000000000 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/importpipelines_client_example_test.go +++ /dev/null @@ -1,227 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-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/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-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/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-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/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-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 f4e52d54c537..421c2e3f2f25 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/models.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/models.go @@ -1863,6 +1863,9 @@ type RegistryProperties struct { // Determines whether registry artifacts are indexed for metadata search. MetadataSearch *MetadataSearch + // Whether or not Tasks allowed to bypass the network rules for this container registry. + NetworkRuleBypassAllowedForTasks *bool + // Whether to allow trusted Azure services to access a network restricted registry. NetworkRuleBypassOptions *NetworkRuleBypassOptions @@ -1917,6 +1920,9 @@ type RegistryPropertiesUpdateParameters struct { // Determines whether registry artifacts are indexed for metadata search. MetadataSearch *MetadataSearch + // Whether to allow ACR Tasks service to access a network restricted registry. + NetworkRuleBypassAllowedForTasks *bool + // Whether to allow trusted Azure services to access a network restricted registry. NetworkRuleBypassOptions *NetworkRuleBypassOptions diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/models_serde.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/models_serde.go index 80e75a37d3ac..4bf1f2fd5b14 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/models_serde.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/models_serde.go @@ -4684,6 +4684,7 @@ func (r RegistryProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "encryption", r.Encryption) populate(objectMap, "loginServer", r.LoginServer) populate(objectMap, "metadataSearch", r.MetadataSearch) + populate(objectMap, "networkRuleBypassAllowedForTasks", r.NetworkRuleBypassAllowedForTasks) populate(objectMap, "networkRuleBypassOptions", r.NetworkRuleBypassOptions) populate(objectMap, "networkRuleSet", r.NetworkRuleSet) populate(objectMap, "policies", r.Policies) @@ -4732,6 +4733,9 @@ func (r *RegistryProperties) UnmarshalJSON(data []byte) error { case "metadataSearch": err = unpopulate(val, "MetadataSearch", &r.MetadataSearch) delete(rawMsg, key) + case "networkRuleBypassAllowedForTasks": + err = unpopulate(val, "NetworkRuleBypassAllowedForTasks", &r.NetworkRuleBypassAllowedForTasks) + delete(rawMsg, key) case "networkRuleBypassOptions": err = unpopulate(val, "NetworkRuleBypassOptions", &r.NetworkRuleBypassOptions) delete(rawMsg, key) @@ -4775,6 +4779,7 @@ func (r RegistryPropertiesUpdateParameters) MarshalJSON() ([]byte, error) { populate(objectMap, "dataEndpointEnabled", r.DataEndpointEnabled) populate(objectMap, "encryption", r.Encryption) populate(objectMap, "metadataSearch", r.MetadataSearch) + populate(objectMap, "networkRuleBypassAllowedForTasks", r.NetworkRuleBypassAllowedForTasks) populate(objectMap, "networkRuleBypassOptions", r.NetworkRuleBypassOptions) populate(objectMap, "networkRuleSet", r.NetworkRuleSet) populate(objectMap, "policies", r.Policies) @@ -4807,6 +4812,9 @@ func (r *RegistryPropertiesUpdateParameters) UnmarshalJSON(data []byte) error { case "metadataSearch": err = unpopulate(val, "MetadataSearch", &r.MetadataSearch) delete(rawMsg, key) + case "networkRuleBypassAllowedForTasks": + err = unpopulate(val, "NetworkRuleBypassAllowedForTasks", &r.NetworkRuleBypassAllowedForTasks) + delete(rawMsg, key) case "networkRuleBypassOptions": err = unpopulate(val, "NetworkRuleBypassOptions", &r.NetworkRuleBypassOptions) delete(rawMsg, key) diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/operations_client.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/operations_client.go index 4c52e0a880f6..17aaba72d8c8 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/operations_client.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/operations_client.go @@ -36,7 +36,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 2025-03-01-preview +// Generated from API version 2025-05-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]{ @@ -69,7 +69,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, _ *Operat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-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 deleted file mode 100644 index 616f289af838..000000000000 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/operations_client_example_test.go +++ /dev/null @@ -1,55 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/OperationList.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationListResult = armcontainerregistry.OperationListResult{ - // Value: []*armcontainerregistry.OperationDefinition{ - // { - // Name: to.Ptr("Microsoft.ContainerRegistry/locations/deleteVirtualNetworkOrSubnets/action"), - // Display: &armcontainerregistry.OperationDisplayDefinition{ - // Description: to.Ptr("Notifies Microsoft.ContainerRegistry that virtual network or subnet is being deleted"), - // Operation: to.Ptr("Delete virtual network or subnets notifications"), - // Provider: to.Ptr("Microsoft ContainerRegistry"), - // Resource: to.Ptr(""), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/pipelineruns_client.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/pipelineruns_client.go index 89aaf4cec01e..4304e8b94634 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/pipelineruns_client.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/pipelineruns_client.go @@ -43,7 +43,7 @@ func NewPipelineRunsClient(subscriptionID string, credential azcore.TokenCredent // 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 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -71,7 +71,7 @@ func (client *PipelineRunsClient) BeginCreate(ctx context.Context, resourceGroup // 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 2025-03-01-preview +// Generated from API version 2025-05-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" @@ -117,7 +117,7 @@ func (client *PipelineRunsClient) createCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, pipelineRunCreateParameters); err != nil { @@ -129,7 +129,7 @@ func (client *PipelineRunsClient) createCreateRequest(ctx context.Context, resou // BeginDelete - Deletes a pipeline run from a container registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -156,7 +156,7 @@ func (client *PipelineRunsClient) BeginDelete(ctx context.Context, resourceGroup // Delete - Deletes a pipeline run from a container registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-03-01-preview +// Generated from API version 2025-05-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" @@ -202,7 +202,7 @@ func (client *PipelineRunsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -211,7 +211,7 @@ func (client *PipelineRunsClient) deleteCreateRequest(ctx context.Context, resou // Get - Gets the detailed information for a given pipeline run. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -262,7 +262,7 @@ func (client *PipelineRunsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -279,7 +279,7 @@ func (client *PipelineRunsClient) getHandleResponse(resp *http.Response) (Pipeli // NewListPager - Lists all the pipeline runs for the specified container registry. // -// Generated from API version 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -326,7 +326,7 @@ func (client *PipelineRunsClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-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/pipelineruns_client_example_test.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/pipelineruns_client_example_test.go deleted file mode 100644 index d4b0caf31f89..000000000000 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/pipelineruns_client_example_test.go +++ /dev/null @@ -1,296 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-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/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-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/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-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/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-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/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-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 868e3a828883..8a9326728f7d 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/privateendpointconnections_client.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/privateendpointconnections_client.go @@ -43,7 +43,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 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -71,7 +71,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 2025-03-01-preview +// Generated from API version 2025-05-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" @@ -117,7 +117,7 @@ func (client *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, privateEndpointConnection); err != nil { @@ -129,7 +129,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 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -156,7 +156,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 2025-03-01-preview +// Generated from API version 2025-05-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" @@ -202,7 +202,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -210,7 +210,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 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -262,7 +262,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -279,7 +279,7 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res // NewListPager - List all private endpoint connections in a container registry. // -// Generated from API version 2025-03-01-preview +// Generated from API version 2025-05-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 @@ -327,7 +327,7 @@ func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-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 deleted file mode 100644 index f8adfc52a930..000000000000 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/privateendpointconnections_client_example_test.go +++ /dev/null @@ -1,167 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/PrivateEndpointConnectionList.json -func ExamplePrivateEndpointConnectionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateEndpointConnectionsClient().NewListPager("myResourceGroup", "myRegistry", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PrivateEndpointConnectionListResult = armcontainerregistry.PrivateEndpointConnectionListResult{ - // Value: []*armcontainerregistry.PrivateEndpointConnection{ - // { - // Name: to.Ptr("myConnection"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/privateEndpointConnections/myConnection"), - // Properties: &armcontainerregistry.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armcontainerregistry.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/peexample01"), - // }, - // PrivateLinkServiceConnectionState: &armcontainerregistry.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // ActionsRequired: to.Ptr(armcontainerregistry.ActionsRequiredNone), - // Status: to.Ptr(armcontainerregistry.ConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/PrivateEndpointConnectionGet.json -func ExamplePrivateEndpointConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateEndpointConnectionsClient().Get(ctx, "myResourceGroup", "myRegistry", "myConnection", 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.PrivateEndpointConnection = armcontainerregistry.PrivateEndpointConnection{ - // Name: to.Ptr("myConnection"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/privateEndpointConnections/myConnection"), - // Properties: &armcontainerregistry.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armcontainerregistry.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/peexample01"), - // }, - // PrivateLinkServiceConnectionState: &armcontainerregistry.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // ActionsRequired: to.Ptr(armcontainerregistry.ActionsRequiredNone), - // Status: to.Ptr(armcontainerregistry.ConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/PrivateEndpointConnectionCreateOrUpdate.json -func ExamplePrivateEndpointConnectionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myRegistry", "myConnection", armcontainerregistry.PrivateEndpointConnection{ - Properties: &armcontainerregistry.PrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armcontainerregistry.PrivateLinkServiceConnectionState{ - Description: to.Ptr("Auto-Approved"), - Status: to.Ptr(armcontainerregistry.ConnectionStatusApproved), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpointConnection = armcontainerregistry.PrivateEndpointConnection{ - // Name: to.Ptr("myConnection"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/privateEndpointConnections/myConnection"), - // Properties: &armcontainerregistry.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armcontainerregistry.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/peexample01"), - // }, - // PrivateLinkServiceConnectionState: &armcontainerregistry.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // ActionsRequired: to.Ptr(armcontainerregistry.ActionsRequiredNone), - // Status: to.Ptr(armcontainerregistry.ConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/PrivateEndpointConnectionDelete.json -func ExamplePrivateEndpointConnectionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginDelete(ctx, "myResourceGroup", "myRegistry", "myConnection", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/registries_client.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/registries_client.go index e6d30cbd2d29..c9deff09d749 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/registries_client.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/registries_client.go @@ -44,7 +44,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 2025-03-01-preview +// Generated from API version 2025-05-01-preview // - registryNameCheckRequest - The object containing information for the availability request. // - options - RegistriesClientCheckNameAvailabilityOptions contains the optional parameters for the RegistriesClient.CheckNameAvailability // method. @@ -82,7 +82,7 @@ func (client *RegistriesClient) checkNameAvailabilityCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, registryNameCheckRequest); err != nil { @@ -103,7 +103,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 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -129,7 +129,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 2025-03-01-preview +// Generated from API version 2025-05-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" @@ -171,7 +171,7 @@ func (client *RegistriesClient) createCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, registry); err != nil { @@ -183,7 +183,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 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -208,7 +208,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 2025-03-01-preview +// Generated from API version 2025-05-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" @@ -250,7 +250,7 @@ func (client *RegistriesClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -258,7 +258,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 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -285,7 +285,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 2025-03-01-preview +// Generated from API version 2025-05-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" @@ -327,7 +327,7 @@ func (client *RegistriesClient) generateCredentialsCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, generateCredentialsParameters); err != nil { @@ -339,7 +339,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 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -385,7 +385,7 @@ func (client *RegistriesClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -468,7 +468,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 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -520,7 +520,7 @@ func (client *RegistriesClient) getPrivateLinkResourceCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -538,7 +538,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 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -565,7 +565,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 2025-03-01-preview +// Generated from API version 2025-05-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" @@ -607,7 +607,7 @@ func (client *RegistriesClient) importImageCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err @@ -617,7 +617,7 @@ func (client *RegistriesClient) importImageCreateRequest(ctx context.Context, re // NewListPager - Lists all the container registries under the specified subscription. // -// Generated from API version 2025-03-01-preview +// Generated from API version 2025-05-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]{ @@ -654,7 +654,7 @@ func (client *RegistriesClient) listCreateRequest(ctx context.Context, _ *Regist return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -671,7 +671,7 @@ func (client *RegistriesClient) listHandleResponse(resp *http.Response) (Registr // NewListByResourceGroupPager - Lists all the container registries under the specified resource group. // -// Generated from API version 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -714,7 +714,7 @@ func (client *RegistriesClient) listByResourceGroupCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -732,7 +732,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 2025-03-01-preview +// Generated from API version 2025-05-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 @@ -779,7 +779,7 @@ func (client *RegistriesClient) listCredentialsCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -796,7 +796,7 @@ func (client *RegistriesClient) listCredentialsHandleResponse(resp *http.Respons // NewListPrivateLinkResourcesPager - Lists the private link resources for a container registry. // -// Generated from API version 2025-03-01-preview +// Generated from API version 2025-05-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 @@ -844,7 +844,7 @@ func (client *RegistriesClient) listPrivateLinkResourcesCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -862,7 +862,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 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -908,7 +908,7 @@ func (client *RegistriesClient) listUsagesCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -926,7 +926,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 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -974,7 +974,7 @@ func (client *RegistriesClient) regenerateCredentialCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, regenerateCredentialParameters); err != nil { @@ -1063,7 +1063,7 @@ func (client *RegistriesClient) scheduleRunHandleResponse(resp *http.Response) ( // BeginUpdate - Updates a container registry with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -1089,7 +1089,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 2025-03-01-preview +// Generated from API version 2025-05-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" @@ -1131,7 +1131,7 @@ func (client *RegistriesClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-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 deleted file mode 100644 index 44aab74e13ea..000000000000 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/registries_client_example_test.go +++ /dev/null @@ -1,1567 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armcontainerregistry_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/ImportImageByManifestDigest.json -func ExampleRegistriesClient_BeginImportImage_importImageByManifestDigest() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRegistriesClient().BeginImportImage(ctx, "myResourceGroup", "myRegistry", armcontainerregistry.ImportImageParameters{ - Mode: to.Ptr(armcontainerregistry.ImportModeForce), - Source: &armcontainerregistry.ImportSource{ - ResourceID: to.Ptr("/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/sourceResourceGroup/providers/Microsoft.ContainerRegistry/registries/sourceRegistry"), - SourceImage: to.Ptr("sourceRepository@sha256:0000000000000000000000000000000000000000000000000000000000000000"), - }, - TargetTags: []*string{ - to.Ptr("targetRepository:targetTag")}, - UntaggedTargetRepositories: []*string{ - to.Ptr("targetRepository1")}, - }, 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/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/ImportImageByTag.json -func ExampleRegistriesClient_BeginImportImage_importImageByTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRegistriesClient().BeginImportImage(ctx, "myResourceGroup", "myRegistry", armcontainerregistry.ImportImageParameters{ - Mode: to.Ptr(armcontainerregistry.ImportModeForce), - Source: &armcontainerregistry.ImportSource{ - ResourceID: to.Ptr("/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/sourceResourceGroup/providers/Microsoft.ContainerRegistry/registries/sourceRegistry"), - SourceImage: to.Ptr("sourceRepository:sourceTag"), - }, - TargetTags: []*string{ - to.Ptr("targetRepository:targetTag")}, - UntaggedTargetRepositories: []*string{ - to.Ptr("targetRepository1")}, - }, 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/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/ImportImageFromPublicRegistry.json -func ExampleRegistriesClient_BeginImportImage_importImageFromPublicRegistry() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRegistriesClient().BeginImportImage(ctx, "myResourceGroup", "myRegistry", armcontainerregistry.ImportImageParameters{ - Mode: to.Ptr(armcontainerregistry.ImportModeForce), - Source: &armcontainerregistry.ImportSource{ - RegistryURI: to.Ptr("registry.hub.docker.com"), - SourceImage: to.Ptr("library/hello-world"), - }, - TargetTags: []*string{ - to.Ptr("targetRepository:targetTag")}, - UntaggedTargetRepositories: []*string{ - to.Ptr("targetRepository1")}, - }, 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/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/RegistryCheckNameAvailable.json -func ExampleRegistriesClient_CheckNameAvailability_registryCheckNameAvailable() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRegistriesClient().CheckNameAvailability(ctx, armcontainerregistry.RegistryNameCheckRequest{ - Name: to.Ptr("myRegistry"), - Type: to.Ptr("Microsoft.ContainerRegistry/registries"), - AutoGeneratedDomainNameLabelScope: to.Ptr(armcontainerregistry.AutoGeneratedDomainNameLabelScopeResourceGroupReuse), - ResourceGroupName: to.Ptr("myResourceGroup"), - }, 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.RegistryNameStatus = armcontainerregistry.RegistryNameStatus{ - // AvailableLoginServerName: to.Ptr("myregistry-a1b2c3d4e5f6.azurecr.io"), - // NameAvailable: to.Ptr(true), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/RegistryCheckNameNotAvailable.json -func ExampleRegistriesClient_CheckNameAvailability_registryCheckNameNotAvailable() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRegistriesClient().CheckNameAvailability(ctx, armcontainerregistry.RegistryNameCheckRequest{ - Name: to.Ptr("myRegistry"), - Type: to.Ptr("Microsoft.ContainerRegistry/registries"), - AutoGeneratedDomainNameLabelScope: to.Ptr(armcontainerregistry.AutoGeneratedDomainNameLabelScopeResourceGroupReuse), - ResourceGroupName: to.Ptr("myResourceGroup"), - }, 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.RegistryNameStatus = armcontainerregistry.RegistryNameStatus{ - // Message: to.Ptr("The registry myRegistry is already in use."), - // NameAvailable: to.Ptr(false), - // Reason: to.Ptr("AlreadyExists"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/RegistryList.json -func ExampleRegistriesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRegistriesClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.RegistryListResult = armcontainerregistry.RegistryListResult{ - // Value: []*armcontainerregistry.Registry{ - // { - // Name: to.Ptr("myRegistry"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Properties: &armcontainerregistry.RegistryProperties{ - // AdminUserEnabled: to.Ptr(false), - // AnonymousPullEnabled: to.Ptr(false), - // AutoGeneratedDomainNameLabelScope: to.Ptr(armcontainerregistry.AutoGeneratedDomainNameLabelScopeUnsecure), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:38:26.153Z"); return t}()), - // DataEndpointEnabled: to.Ptr(false), - // DataEndpointHostNames: []*string{ - // }, - // Encryption: &armcontainerregistry.EncryptionProperty{ - // Status: to.Ptr(armcontainerregistry.EncryptionStatusDisabled), - // }, - // LoginServer: to.Ptr("myRegistry.azurecr-test.io"), - // MetadataSearch: to.Ptr(armcontainerregistry.MetadataSearchDisabled), - // NetworkRuleBypassOptions: to.Ptr(armcontainerregistry.NetworkRuleBypassOptionsAzureServices), - // NetworkRuleSet: &armcontainerregistry.NetworkRuleSet{ - // DefaultAction: to.Ptr(armcontainerregistry.DefaultActionAllow), - // IPRules: []*armcontainerregistry.IPRule{ - // }, - // }, - // Policies: &armcontainerregistry.Policies{ - // ExportPolicy: &armcontainerregistry.ExportPolicy{ - // Status: to.Ptr(armcontainerregistry.ExportPolicyStatusEnabled), - // }, - // QuarantinePolicy: &armcontainerregistry.QuarantinePolicy{ - // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), - // }, - // RetentionPolicy: &armcontainerregistry.RetentionPolicy{ - // Days: to.Ptr[int32](7), - // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:40:12.850Z"); return t}()), - // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), - // }, - // TrustPolicy: &armcontainerregistry.TrustPolicy{ - // Type: to.Ptr(armcontainerregistry.TrustPolicyTypeNotary), - // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), - // }, - // }, - // PrivateEndpointConnections: []*armcontainerregistry.PrivateEndpointConnection{ - // }, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armcontainerregistry.PublicNetworkAccessEnabled), - // RoleAssignmentMode: to.Ptr(armcontainerregistry.RoleAssignmentModeLegacyRegistryPermissions), - // ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyDisabled), - // }, - // SKU: &armcontainerregistry.SKU{ - // Name: to.Ptr(armcontainerregistry.SKUNameStandard), - // Tier: to.Ptr(armcontainerregistry.SKUTierStandard), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/RegistryListByResourceGroup.json -func ExampleRegistriesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRegistriesClient().NewListByResourceGroupPager("myResourceGroup", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.RegistryListResult = armcontainerregistry.RegistryListResult{ - // Value: []*armcontainerregistry.Registry{ - // { - // Name: to.Ptr("myRegistry"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Properties: &armcontainerregistry.RegistryProperties{ - // AdminUserEnabled: to.Ptr(false), - // AnonymousPullEnabled: to.Ptr(false), - // AutoGeneratedDomainNameLabelScope: to.Ptr(armcontainerregistry.AutoGeneratedDomainNameLabelScopeUnsecure), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:38:26.153Z"); return t}()), - // DataEndpointEnabled: to.Ptr(false), - // DataEndpointHostNames: []*string{ - // }, - // Encryption: &armcontainerregistry.EncryptionProperty{ - // Status: to.Ptr(armcontainerregistry.EncryptionStatusDisabled), - // }, - // LoginServer: to.Ptr("myRegistry.azurecr-test.io"), - // MetadataSearch: to.Ptr(armcontainerregistry.MetadataSearchDisabled), - // NetworkRuleBypassOptions: to.Ptr(armcontainerregistry.NetworkRuleBypassOptionsAzureServices), - // NetworkRuleSet: &armcontainerregistry.NetworkRuleSet{ - // DefaultAction: to.Ptr(armcontainerregistry.DefaultActionAllow), - // IPRules: []*armcontainerregistry.IPRule{ - // }, - // }, - // Policies: &armcontainerregistry.Policies{ - // ExportPolicy: &armcontainerregistry.ExportPolicy{ - // Status: to.Ptr(armcontainerregistry.ExportPolicyStatusEnabled), - // }, - // QuarantinePolicy: &armcontainerregistry.QuarantinePolicy{ - // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), - // }, - // RetentionPolicy: &armcontainerregistry.RetentionPolicy{ - // Days: to.Ptr[int32](7), - // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:40:12.850Z"); return t}()), - // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), - // }, - // TrustPolicy: &armcontainerregistry.TrustPolicy{ - // Type: to.Ptr(armcontainerregistry.TrustPolicyTypeNotary), - // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), - // }, - // }, - // PrivateEndpointConnections: []*armcontainerregistry.PrivateEndpointConnection{ - // }, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armcontainerregistry.PublicNetworkAccessEnabled), - // RoleAssignmentMode: to.Ptr(armcontainerregistry.RoleAssignmentModeLegacyRegistryPermissions), - // ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyDisabled), - // }, - // SKU: &armcontainerregistry.SKU{ - // Name: to.Ptr(armcontainerregistry.SKUNameStandard), - // Tier: to.Ptr(armcontainerregistry.SKUTierStandard), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/RegistryGet.json -func ExampleRegistriesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRegistriesClient().Get(ctx, "myResourceGroup", "myRegistry", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Registry = armcontainerregistry.Registry{ - // Name: to.Ptr("myRegistry"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Properties: &armcontainerregistry.RegistryProperties{ - // AdminUserEnabled: to.Ptr(false), - // AnonymousPullEnabled: to.Ptr(false), - // AutoGeneratedDomainNameLabelScope: to.Ptr(armcontainerregistry.AutoGeneratedDomainNameLabelScopeUnsecure), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:38:26.153Z"); return t}()), - // DataEndpointEnabled: to.Ptr(false), - // DataEndpointHostNames: []*string{ - // }, - // Encryption: &armcontainerregistry.EncryptionProperty{ - // Status: to.Ptr(armcontainerregistry.EncryptionStatusDisabled), - // }, - // LoginServer: to.Ptr("myRegistry.azurecr-test.io"), - // MetadataSearch: to.Ptr(armcontainerregistry.MetadataSearchDisabled), - // NetworkRuleBypassOptions: to.Ptr(armcontainerregistry.NetworkRuleBypassOptionsAzureServices), - // NetworkRuleSet: &armcontainerregistry.NetworkRuleSet{ - // DefaultAction: to.Ptr(armcontainerregistry.DefaultActionAllow), - // IPRules: []*armcontainerregistry.IPRule{ - // }, - // }, - // Policies: &armcontainerregistry.Policies{ - // ExportPolicy: &armcontainerregistry.ExportPolicy{ - // Status: to.Ptr(armcontainerregistry.ExportPolicyStatusEnabled), - // }, - // QuarantinePolicy: &armcontainerregistry.QuarantinePolicy{ - // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), - // }, - // RetentionPolicy: &armcontainerregistry.RetentionPolicy{ - // Days: to.Ptr[int32](7), - // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:40:12.850Z"); return t}()), - // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), - // }, - // TrustPolicy: &armcontainerregistry.TrustPolicy{ - // Type: to.Ptr(armcontainerregistry.TrustPolicyTypeNotary), - // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), - // }, - // }, - // PrivateEndpointConnections: []*armcontainerregistry.PrivateEndpointConnection{ - // }, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armcontainerregistry.PublicNetworkAccessEnabled), - // RoleAssignmentMode: to.Ptr(armcontainerregistry.RoleAssignmentModeLegacyRegistryPermissions), - // ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyDisabled), - // }, - // SKU: &armcontainerregistry.SKU{ - // Name: to.Ptr(armcontainerregistry.SKUNameStandard), - // Tier: to.Ptr(armcontainerregistry.SKUTierStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/RegistryCreate.json -func ExampleRegistriesClient_BeginCreate_registryCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRegistriesClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", armcontainerregistry.Registry{ - Location: to.Ptr("westus"), - Tags: map[string]*string{ - "key": to.Ptr("value"), - }, - Properties: &armcontainerregistry.RegistryProperties{ - AdminUserEnabled: to.Ptr(true), - }, - SKU: &armcontainerregistry.SKU{ - Name: to.Ptr(armcontainerregistry.SKUNameStandard), - }, - }, 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.Registry = armcontainerregistry.Registry{ - // Name: to.Ptr("myRegistry"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Properties: &armcontainerregistry.RegistryProperties{ - // AdminUserEnabled: to.Ptr(true), - // AnonymousPullEnabled: to.Ptr(false), - // AutoGeneratedDomainNameLabelScope: to.Ptr(armcontainerregistry.AutoGeneratedDomainNameLabelScopeUnsecure), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:38:26.153Z"); return t}()), - // DataEndpointEnabled: to.Ptr(false), - // DataEndpointHostNames: []*string{ - // }, - // Encryption: &armcontainerregistry.EncryptionProperty{ - // Status: to.Ptr(armcontainerregistry.EncryptionStatusDisabled), - // }, - // LoginServer: to.Ptr("myRegistry.azurecr-test.io"), - // MetadataSearch: to.Ptr(armcontainerregistry.MetadataSearchDisabled), - // NetworkRuleBypassOptions: to.Ptr(armcontainerregistry.NetworkRuleBypassOptionsAzureServices), - // NetworkRuleSet: &armcontainerregistry.NetworkRuleSet{ - // DefaultAction: to.Ptr(armcontainerregistry.DefaultActionAllow), - // IPRules: []*armcontainerregistry.IPRule{ - // }, - // }, - // Policies: &armcontainerregistry.Policies{ - // ExportPolicy: &armcontainerregistry.ExportPolicy{ - // Status: to.Ptr(armcontainerregistry.ExportPolicyStatusEnabled), - // }, - // QuarantinePolicy: &armcontainerregistry.QuarantinePolicy{ - // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), - // }, - // RetentionPolicy: &armcontainerregistry.RetentionPolicy{ - // Days: to.Ptr[int32](7), - // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:40:12.850Z"); return t}()), - // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), - // }, - // TrustPolicy: &armcontainerregistry.TrustPolicy{ - // Type: to.Ptr(armcontainerregistry.TrustPolicyTypeNotary), - // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), - // }, - // }, - // PrivateEndpointConnections: []*armcontainerregistry.PrivateEndpointConnection{ - // }, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armcontainerregistry.PublicNetworkAccessEnabled), - // RoleAssignmentMode: to.Ptr(armcontainerregistry.RoleAssignmentModeLegacyRegistryPermissions), - // ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyDisabled), - // }, - // SKU: &armcontainerregistry.SKU{ - // Name: to.Ptr(armcontainerregistry.SKUNameStandard), - // Tier: to.Ptr(armcontainerregistry.SKUTierStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/RegistryCreateAbac.json -func ExampleRegistriesClient_BeginCreate_registryCreateAbac() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRegistriesClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", armcontainerregistry.Registry{ - Location: to.Ptr("westus"), - Tags: map[string]*string{ - "key": to.Ptr("value"), - }, - Properties: &armcontainerregistry.RegistryProperties{ - RoleAssignmentMode: to.Ptr(armcontainerregistry.RoleAssignmentModeAbacRepositoryPermissions), - }, - SKU: &armcontainerregistry.SKU{ - Name: to.Ptr(armcontainerregistry.SKUNameStandard), - }, - }, 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.Registry = armcontainerregistry.Registry{ - // Name: to.Ptr("myRegistry"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Properties: &armcontainerregistry.RegistryProperties{ - // AdminUserEnabled: to.Ptr(true), - // AnonymousPullEnabled: to.Ptr(false), - // AutoGeneratedDomainNameLabelScope: to.Ptr(armcontainerregistry.AutoGeneratedDomainNameLabelScopeUnsecure), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:38:26.153Z"); return t}()), - // DataEndpointEnabled: to.Ptr(false), - // DataEndpointHostNames: []*string{ - // }, - // Encryption: &armcontainerregistry.EncryptionProperty{ - // Status: to.Ptr(armcontainerregistry.EncryptionStatusDisabled), - // }, - // LoginServer: to.Ptr("myRegistry.azurecr-test.io"), - // MetadataSearch: to.Ptr(armcontainerregistry.MetadataSearchDisabled), - // NetworkRuleBypassOptions: to.Ptr(armcontainerregistry.NetworkRuleBypassOptionsAzureServices), - // NetworkRuleSet: &armcontainerregistry.NetworkRuleSet{ - // DefaultAction: to.Ptr(armcontainerregistry.DefaultActionAllow), - // IPRules: []*armcontainerregistry.IPRule{ - // }, - // }, - // Policies: &armcontainerregistry.Policies{ - // ExportPolicy: &armcontainerregistry.ExportPolicy{ - // Status: to.Ptr(armcontainerregistry.ExportPolicyStatusEnabled), - // }, - // QuarantinePolicy: &armcontainerregistry.QuarantinePolicy{ - // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), - // }, - // RetentionPolicy: &armcontainerregistry.RetentionPolicy{ - // Days: to.Ptr[int32](7), - // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:40:12.850Z"); return t}()), - // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), - // }, - // TrustPolicy: &armcontainerregistry.TrustPolicy{ - // Type: to.Ptr(armcontainerregistry.TrustPolicyTypeNotary), - // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), - // }, - // }, - // PrivateEndpointConnections: []*armcontainerregistry.PrivateEndpointConnection{ - // }, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armcontainerregistry.PublicNetworkAccessEnabled), - // RoleAssignmentMode: to.Ptr(armcontainerregistry.RoleAssignmentModeAbacRepositoryPermissions), - // ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyDisabled), - // }, - // SKU: &armcontainerregistry.SKU{ - // Name: to.Ptr(armcontainerregistry.SKUNameStandard), - // Tier: to.Ptr(armcontainerregistry.SKUTierStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/RegistryCreateDomainNameLabelScope.json -func ExampleRegistriesClient_BeginCreate_registryCreateDomainNameLabelScope() { - 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.NewRegistriesClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", armcontainerregistry.Registry{ - Location: to.Ptr("westus"), - Tags: map[string]*string{ - "key": to.Ptr("value"), - }, - Properties: &armcontainerregistry.RegistryProperties{ - AutoGeneratedDomainNameLabelScope: to.Ptr(armcontainerregistry.AutoGeneratedDomainNameLabelScopeTenantReuse), - }, - SKU: &armcontainerregistry.SKU{ - Name: to.Ptr(armcontainerregistry.SKUNameStandard), - }, - }, 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.Registry = armcontainerregistry.Registry{ - // Name: to.Ptr("myRegistry"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Properties: &armcontainerregistry.RegistryProperties{ - // AdminUserEnabled: to.Ptr(false), - // AnonymousPullEnabled: to.Ptr(false), - // AutoGeneratedDomainNameLabelScope: to.Ptr(armcontainerregistry.AutoGeneratedDomainNameLabelScopeTenantReuse), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:38:26.153Z"); return t}()), - // DataEndpointEnabled: to.Ptr(false), - // DataEndpointHostNames: []*string{ - // }, - // Encryption: &armcontainerregistry.EncryptionProperty{ - // Status: to.Ptr(armcontainerregistry.EncryptionStatusDisabled), - // }, - // LoginServer: to.Ptr("myRegistry-a1b2c3d4e5f6.azurecr-test.io"), - // MetadataSearch: to.Ptr(armcontainerregistry.MetadataSearchDisabled), - // NetworkRuleBypassOptions: to.Ptr(armcontainerregistry.NetworkRuleBypassOptionsAzureServices), - // NetworkRuleSet: &armcontainerregistry.NetworkRuleSet{ - // DefaultAction: to.Ptr(armcontainerregistry.DefaultActionAllow), - // IPRules: []*armcontainerregistry.IPRule{ - // }, - // }, - // Policies: &armcontainerregistry.Policies{ - // ExportPolicy: &armcontainerregistry.ExportPolicy{ - // Status: to.Ptr(armcontainerregistry.ExportPolicyStatusEnabled), - // }, - // QuarantinePolicy: &armcontainerregistry.QuarantinePolicy{ - // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), - // }, - // RetentionPolicy: &armcontainerregistry.RetentionPolicy{ - // Days: to.Ptr[int32](7), - // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:40:12.850Z"); return t}()), - // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), - // }, - // TrustPolicy: &armcontainerregistry.TrustPolicy{ - // Type: to.Ptr(armcontainerregistry.TrustPolicyTypeNotary), - // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), - // }, - // }, - // PrivateEndpointConnections: []*armcontainerregistry.PrivateEndpointConnection{ - // }, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armcontainerregistry.PublicNetworkAccessEnabled), - // RoleAssignmentMode: to.Ptr(armcontainerregistry.RoleAssignmentModeLegacyRegistryPermissions), - // ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyDisabled), - // }, - // SKU: &armcontainerregistry.SKU{ - // Name: to.Ptr(armcontainerregistry.SKUNameStandard), - // Tier: to.Ptr(armcontainerregistry.SKUTierStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/RegistryCreateZoneRedundant.json -func ExampleRegistriesClient_BeginCreate_registryCreateZoneRedundant() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRegistriesClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", armcontainerregistry.Registry{ - Location: to.Ptr("westus"), - Tags: map[string]*string{ - "key": to.Ptr("value"), - }, - Properties: &armcontainerregistry.RegistryProperties{ - ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyEnabled), - }, - SKU: &armcontainerregistry.SKU{ - Name: to.Ptr(armcontainerregistry.SKUNameStandard), - }, - }, nil) - 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.Registry = armcontainerregistry.Registry{ - // Name: to.Ptr("myRegistry"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Properties: &armcontainerregistry.RegistryProperties{ - // AdminUserEnabled: to.Ptr(false), - // AnonymousPullEnabled: to.Ptr(false), - // AutoGeneratedDomainNameLabelScope: to.Ptr(armcontainerregistry.AutoGeneratedDomainNameLabelScopeUnsecure), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:38:26.153Z"); return t}()), - // DataEndpointEnabled: to.Ptr(false), - // DataEndpointHostNames: []*string{ - // }, - // Encryption: &armcontainerregistry.EncryptionProperty{ - // Status: to.Ptr(armcontainerregistry.EncryptionStatusDisabled), - // }, - // LoginServer: to.Ptr("myRegistry.azurecr-test.io"), - // MetadataSearch: to.Ptr(armcontainerregistry.MetadataSearchDisabled), - // NetworkRuleBypassOptions: to.Ptr(armcontainerregistry.NetworkRuleBypassOptionsAzureServices), - // NetworkRuleSet: &armcontainerregistry.NetworkRuleSet{ - // DefaultAction: to.Ptr(armcontainerregistry.DefaultActionAllow), - // IPRules: []*armcontainerregistry.IPRule{ - // }, - // }, - // Policies: &armcontainerregistry.Policies{ - // ExportPolicy: &armcontainerregistry.ExportPolicy{ - // Status: to.Ptr(armcontainerregistry.ExportPolicyStatusEnabled), - // }, - // QuarantinePolicy: &armcontainerregistry.QuarantinePolicy{ - // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), - // }, - // RetentionPolicy: &armcontainerregistry.RetentionPolicy{ - // Days: to.Ptr[int32](7), - // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:40:12.850Z"); return t}()), - // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), - // }, - // TrustPolicy: &armcontainerregistry.TrustPolicy{ - // Type: to.Ptr(armcontainerregistry.TrustPolicyTypeNotary), - // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), - // }, - // }, - // PrivateEndpointConnections: []*armcontainerregistry.PrivateEndpointConnection{ - // }, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armcontainerregistry.PublicNetworkAccessEnabled), - // RoleAssignmentMode: to.Ptr(armcontainerregistry.RoleAssignmentModeLegacyRegistryPermissions), - // ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyEnabled), - // }, - // SKU: &armcontainerregistry.SKU{ - // Name: to.Ptr(armcontainerregistry.SKUNameStandard), - // Tier: to.Ptr(armcontainerregistry.SKUTierStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/RegistryDelete.json -func ExampleRegistriesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRegistriesClient().BeginDelete(ctx, "myResourceGroup", "myRegistry", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/RegistryUpdate.json -func ExampleRegistriesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRegistriesClient().BeginUpdate(ctx, "myResourceGroup", "myRegistry", armcontainerregistry.RegistryUpdateParameters{ - Properties: &armcontainerregistry.RegistryPropertiesUpdateParameters{ - AdminUserEnabled: to.Ptr(true), - RoleAssignmentMode: to.Ptr(armcontainerregistry.RoleAssignmentModeAbacRepositoryPermissions), - }, - SKU: &armcontainerregistry.SKU{ - Name: to.Ptr(armcontainerregistry.SKUNameStandard), - }, - Tags: map[string]*string{ - "key": to.Ptr("value"), - }, - }, 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.Registry = armcontainerregistry.Registry{ - // Name: to.Ptr("myRegistry"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Properties: &armcontainerregistry.RegistryProperties{ - // AdminUserEnabled: to.Ptr(true), - // AnonymousPullEnabled: to.Ptr(false), - // AutoGeneratedDomainNameLabelScope: to.Ptr(armcontainerregistry.AutoGeneratedDomainNameLabelScopeUnsecure), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:38:26.153Z"); return t}()), - // DataEndpointEnabled: to.Ptr(false), - // DataEndpointHostNames: []*string{ - // }, - // Encryption: &armcontainerregistry.EncryptionProperty{ - // Status: to.Ptr(armcontainerregistry.EncryptionStatusDisabled), - // }, - // LoginServer: to.Ptr("myRegistry.azurecr-test.io"), - // MetadataSearch: to.Ptr(armcontainerregistry.MetadataSearchDisabled), - // NetworkRuleBypassOptions: to.Ptr(armcontainerregistry.NetworkRuleBypassOptionsAzureServices), - // NetworkRuleSet: &armcontainerregistry.NetworkRuleSet{ - // DefaultAction: to.Ptr(armcontainerregistry.DefaultActionAllow), - // IPRules: []*armcontainerregistry.IPRule{ - // }, - // }, - // Policies: &armcontainerregistry.Policies{ - // ExportPolicy: &armcontainerregistry.ExportPolicy{ - // Status: to.Ptr(armcontainerregistry.ExportPolicyStatusEnabled), - // }, - // QuarantinePolicy: &armcontainerregistry.QuarantinePolicy{ - // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), - // }, - // RetentionPolicy: &armcontainerregistry.RetentionPolicy{ - // Days: to.Ptr[int32](7), - // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:40:12.850Z"); return t}()), - // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), - // }, - // TrustPolicy: &armcontainerregistry.TrustPolicy{ - // Type: to.Ptr(armcontainerregistry.TrustPolicyTypeNotary), - // Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled), - // }, - // }, - // PrivateEndpointConnections: []*armcontainerregistry.PrivateEndpointConnection{ - // }, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armcontainerregistry.PublicNetworkAccessEnabled), - // RoleAssignmentMode: to.Ptr(armcontainerregistry.RoleAssignmentModeAbacRepositoryPermissions), - // ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyDisabled), - // }, - // SKU: &armcontainerregistry.SKU{ - // Name: to.Ptr(armcontainerregistry.SKUNameStandard), - // Tier: to.Ptr(armcontainerregistry.SKUTierStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/RegistryListUsages.json -func ExampleRegistriesClient_ListUsages() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRegistriesClient().ListUsages(ctx, "myResourceGroup", "myRegistry", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RegistryUsageListResult = armcontainerregistry.RegistryUsageListResult{ - // Value: []*armcontainerregistry.RegistryUsage{ - // { - // Name: to.Ptr("Size"), - // CurrentValue: to.Ptr[int64](12345678), - // Limit: to.Ptr[int64](107374182400), - // Unit: to.Ptr(armcontainerregistry.RegistryUsageUnitBytes), - // }, - // { - // Name: to.Ptr("Webhooks"), - // CurrentValue: to.Ptr[int64](2), - // Limit: to.Ptr[int64](10), - // Unit: to.Ptr(armcontainerregistry.RegistryUsageUnitCount), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/RegistryListPrivateLinkResources.json -func ExampleRegistriesClient_NewListPrivateLinkResourcesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRegistriesClient().NewListPrivateLinkResourcesPager("myResourceGroup", "myRegistry", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PrivateLinkResourceListResult = armcontainerregistry.PrivateLinkResourceListResult{ - // Value: []*armcontainerregistry.PrivateLinkResource{ - // { - // Name: to.Ptr("registry"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/privateLinkResources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/privateLinkResources/registry"), - // Properties: &armcontainerregistry.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("registry"), - // RequiredMembers: []*string{ - // to.Ptr("registry"), - // to.Ptr("registry_data_myregion")}, - // RequiredZoneNames: []*string{ - // to.Ptr("privatelink.azurecr.io")}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/RegistryGetPrivateLinkResource.json -func ExampleRegistriesClient_GetPrivateLinkResource() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRegistriesClient().GetPrivateLinkResource(ctx, "myResourceGroup", "myRegistry", "registry", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateLinkResource = armcontainerregistry.PrivateLinkResource{ - // Name: to.Ptr("registry"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/privateLinkResources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/privateLinkResources/registry"), - // Properties: &armcontainerregistry.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("registry"), - // RequiredMembers: []*string{ - // to.Ptr("registry"), - // to.Ptr("registry_data_myregion")}, - // RequiredZoneNames: []*string{ - // to.Ptr("privatelink.azurecr.io")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/RegistryListCredentials.json -func ExampleRegistriesClient_ListCredentials() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRegistriesClient().ListCredentials(ctx, "myResourceGroup", "myRegistry", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RegistryListCredentialsResult = armcontainerregistry.RegistryListCredentialsResult{ - // Passwords: []*armcontainerregistry.RegistryPassword{ - // { - // Name: to.Ptr(armcontainerregistry.PasswordNamePassword), - // Value: to.Ptr("00000000000000000000000000000000"), - // }, - // { - // Name: to.Ptr(armcontainerregistry.PasswordNamePassword2), - // Value: to.Ptr("00000000000000000000000000000000"), - // }}, - // Username: to.Ptr("myRegistry"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/RegistryRegenerateCredential.json -func ExampleRegistriesClient_RegenerateCredential() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRegistriesClient().RegenerateCredential(ctx, "myResourceGroup", "myRegistry", armcontainerregistry.RegenerateCredentialParameters{ - Name: to.Ptr(armcontainerregistry.PasswordNamePassword), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RegistryListCredentialsResult = armcontainerregistry.RegistryListCredentialsResult{ - // Passwords: []*armcontainerregistry.RegistryPassword{ - // { - // Name: to.Ptr(armcontainerregistry.PasswordNamePassword), - // Value: to.Ptr("00000000000000000000000000000000"), - // }, - // { - // Name: to.Ptr(armcontainerregistry.PasswordNamePassword2), - // Value: to.Ptr("00000000000000000000000000000000"), - // }}, - // Username: to.Ptr("myRegistry"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/RegistryGenerateCredentials.json -func ExampleRegistriesClient_BeginGenerateCredentials() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRegistriesClient().BeginGenerateCredentials(ctx, "myResourceGroup", "myRegistry", armcontainerregistry.GenerateCredentialsParameters{ - Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-31T15:59:59.070Z"); return t }()), - TokenID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/myToken"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GenerateCredentialsResult = armcontainerregistry.GenerateCredentialsResult{ - // Passwords: []*armcontainerregistry.TokenPassword{ - // { - // Name: to.Ptr(armcontainerregistry.TokenPasswordNamePassword1), - // Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-31T15:59:59.070Z"); return t}()), - // Value: to.Ptr("00000000000000000000000000000000"), - // }, - // { - // Name: to.Ptr(armcontainerregistry.TokenPasswordNamePassword2), - // Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-31T15:59:59.070Z"); return t}()), - // Value: to.Ptr("00000000000000000000000000000000"), - // }}, - // Username: to.Ptr("myToken"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/RegistriesScheduleRun.json -func ExampleRegistriesClient_ScheduleRun_registriesScheduleRun() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRegistriesClient().ScheduleRun(ctx, "myResourceGroup", "myRegistry", &armcontainerregistry.DockerBuildRequest{ - Type: to.Ptr("DockerBuildRequest"), - IsArchiveEnabled: to.Ptr(true), - AgentConfiguration: &armcontainerregistry.AgentProperties{ - CPU: to.Ptr[int32](2), - }, - Arguments: []*armcontainerregistry.Argument{ - { - Name: to.Ptr("mytestargument"), - IsSecret: to.Ptr(false), - Value: to.Ptr("mytestvalue"), - }, - { - Name: to.Ptr("mysecrettestargument"), - IsSecret: to.Ptr(true), - Value: to.Ptr("mysecrettestvalue"), - }}, - DockerFilePath: to.Ptr("DockerFile"), - ImageNames: []*string{ - to.Ptr("azurerest:testtag")}, - IsPushEnabled: to.Ptr(true), - NoCache: to.Ptr(true), - Platform: &armcontainerregistry.PlatformProperties{ - Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64), - OS: to.Ptr(armcontainerregistry.OSLinux), - }, - SourceLocation: to.Ptr("https://myaccount.blob.core.windows.net/sascontainer/source.zip?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Run = armcontainerregistry.Run{ - // Name: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/run"), - // ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/runs/0accec26-d6de-4757-8e74-d080f38eaaab"), - // Properties: &armcontainerregistry.RunProperties{ - // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T05:13:51.617Z"); return t}()), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // RunID: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"), - // Status: to.Ptr(armcontainerregistry.RunStatusSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/RegistriesScheduleRun_EncodedTaskRun.json -func ExampleRegistriesClient_ScheduleRun_registriesScheduleRunEncodedTaskRun() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRegistriesClient().ScheduleRun(ctx, "myResourceGroup", "myRegistry", &armcontainerregistry.EncodedTaskRunRequest{ - Type: to.Ptr("EncodedTaskRunRequest"), - AgentConfiguration: &armcontainerregistry.AgentProperties{ - CPU: to.Ptr[int32](2), - }, - EncodedTaskContent: to.Ptr("c3RlcHM6Cnt7IGlmIFZhbHVlcy5lbnZpcm9ubWVudCA9PSAncHJvZCcgfX0KICAtIHJ1bjogcHJvZCBzZXR1cAp7eyBlbHNlIGlmIFZhbHVlcy5lbnZpcm9ubWVudCA9PSAnc3RhZ2luZycgfX0KICAtIHJ1bjogc3RhZ2luZyBzZXR1cAp7eyBlbHNlIH19CiAgLSBydW46IGRlZmF1bHQgc2V0dXAKe3sgZW5kIH19CgogIC0gcnVuOiBidWlsZCAtdCBGYW5jeVRoaW5nOnt7LlZhbHVlcy5lbnZpcm9ubWVudH19LXt7LlZhbHVlcy52ZXJzaW9ufX0gLgoKcHVzaDogWydGYW5jeVRoaW5nOnt7LlZhbHVlcy5lbnZpcm9ubWVudH19LXt7LlZhbHVlcy52ZXJzaW9ufX0nXQ=="), - EncodedValuesContent: to.Ptr("ZW52aXJvbm1lbnQ6IHByb2QKdmVyc2lvbjogMQ=="), - Platform: &armcontainerregistry.PlatformProperties{ - OS: to.Ptr(armcontainerregistry.OSLinux), - }, - Values: []*armcontainerregistry.SetValue{ - { - Name: to.Ptr("mytestargument"), - IsSecret: to.Ptr(false), - Value: to.Ptr("mytestvalue"), - }, - { - Name: to.Ptr("mysecrettestargument"), - IsSecret: to.Ptr(true), - Value: to.Ptr("mysecrettestvalue"), - }}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Run = armcontainerregistry.Run{ - // Name: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/run"), - // ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/runs/0accec26-d6de-4757-8e74-d080f38eaaab"), - // Properties: &armcontainerregistry.RunProperties{ - // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T05:13:51.617Z"); return t}()), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // RunID: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"), - // Status: to.Ptr(armcontainerregistry.RunStatusSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/RegistriesScheduleRun_FileTaskRun.json -func ExampleRegistriesClient_ScheduleRun_registriesScheduleRunFileTaskRun() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRegistriesClient().ScheduleRun(ctx, "myResourceGroup", "myRegistry", &armcontainerregistry.FileTaskRunRequest{ - Type: to.Ptr("FileTaskRunRequest"), - AgentConfiguration: &armcontainerregistry.AgentProperties{ - CPU: to.Ptr[int32](2), - }, - Platform: &armcontainerregistry.PlatformProperties{ - OS: to.Ptr(armcontainerregistry.OSLinux), - }, - SourceLocation: to.Ptr("https://myaccount.blob.core.windows.net/sascontainer/source.zip?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D"), - TaskFilePath: to.Ptr("acb.yaml"), - Values: []*armcontainerregistry.SetValue{ - { - Name: to.Ptr("mytestargument"), - IsSecret: to.Ptr(false), - Value: to.Ptr("mytestvalue"), - }, - { - Name: to.Ptr("mysecrettestargument"), - IsSecret: to.Ptr(true), - Value: to.Ptr("mysecrettestvalue"), - }}, - ValuesFilePath: to.Ptr("prod-values.yaml"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Run = armcontainerregistry.Run{ - // Name: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/run"), - // ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/runs/0accec26-d6de-4757-8e74-d080f38eaaab"), - // Properties: &armcontainerregistry.RunProperties{ - // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T05:13:51.617Z"); return t}()), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // RunID: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"), - // Status: to.Ptr(armcontainerregistry.RunStatusSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/RegistriesScheduleRun_Task.json -func ExampleRegistriesClient_ScheduleRun_registriesScheduleRunTask() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRegistriesClient().ScheduleRun(ctx, "myResourceGroup", "myRegistry", &armcontainerregistry.TaskRunRequest{ - Type: to.Ptr("TaskRunRequest"), - OverrideTaskStepProperties: &armcontainerregistry.OverrideTaskStepProperties{ - Arguments: []*armcontainerregistry.Argument{ - { - Name: to.Ptr("mytestargument"), - IsSecret: to.Ptr(false), - Value: to.Ptr("mytestvalue"), - }, - { - Name: to.Ptr("mysecrettestargument"), - IsSecret: to.Ptr(true), - Value: to.Ptr("mysecrettestvalue"), - }}, - File: to.Ptr("overriddenDockerfile"), - Target: to.Ptr("build"), - UpdateTriggerToken: to.Ptr("aGVsbG8gd29ybGQ="), - Values: []*armcontainerregistry.SetValue{ - { - Name: to.Ptr("mytestname"), - IsSecret: to.Ptr(false), - Value: to.Ptr("mytestvalue"), - }, - { - Name: to.Ptr("mysecrettestname"), - IsSecret: to.Ptr(true), - Value: to.Ptr("mysecrettestvalue"), - }}, - }, - TaskID: to.Ptr("myTask"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Run = armcontainerregistry.Run{ - // Name: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/run"), - // ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/runs/0accec26-d6de-4757-8e74-d080f38eaaab"), - // Properties: &armcontainerregistry.RunProperties{ - // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T05:13:51.617Z"); return t}()), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // RunID: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"), - // Status: to.Ptr(armcontainerregistry.RunStatusSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/RegistriesScheduleRun_FileTask_WithCustomCredentials.json -func ExampleRegistriesClient_ScheduleRun_registriesScheduleRunTaskWithCustomCredentials() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRegistriesClient().ScheduleRun(ctx, "myResourceGroup", "myRegistry", &armcontainerregistry.FileTaskRunRequest{ - Type: to.Ptr("FileTaskRunRequest"), - Credentials: &armcontainerregistry.Credentials{ - CustomRegistries: map[string]*armcontainerregistry.CustomRegistryCredentials{ - "myregistry.azurecr.io": { - Password: &armcontainerregistry.SecretObject{ - Type: to.Ptr(armcontainerregistry.SecretObjectTypeOpaque), - Value: to.Ptr("***"), - }, - UserName: &armcontainerregistry.SecretObject{ - Type: to.Ptr(armcontainerregistry.SecretObjectTypeOpaque), - Value: to.Ptr("reg1"), - }, - }, - }, - SourceRegistry: &armcontainerregistry.SourceRegistryCredentials{ - LoginMode: to.Ptr(armcontainerregistry.SourceRegistryLoginModeDefault), - }, - }, - Platform: &armcontainerregistry.PlatformProperties{ - OS: to.Ptr(armcontainerregistry.OSLinux), - }, - TaskFilePath: to.Ptr("acb.yaml"), - Values: []*armcontainerregistry.SetValue{ - { - Name: to.Ptr("mytestargument"), - IsSecret: to.Ptr(false), - Value: to.Ptr("mytestvalue"), - }, - { - Name: to.Ptr("mysecrettestargument"), - IsSecret: to.Ptr(true), - Value: to.Ptr("mysecrettestvalue"), - }}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Run = armcontainerregistry.Run{ - // Name: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/run"), - // ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/runs/0accec26-d6de-4757-8e74-d080f38eaaab"), - // Properties: &armcontainerregistry.RunProperties{ - // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T05:13:51.617Z"); return t}()), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // RunID: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"), - // Status: to.Ptr(armcontainerregistry.RunStatusSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/RegistriesScheduleRun_WithCustomCredentials.json -func ExampleRegistriesClient_ScheduleRun_registriesScheduleRunWithCustomCredentials() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRegistriesClient().ScheduleRun(ctx, "myResourceGroup", "myRegistry", &armcontainerregistry.DockerBuildRequest{ - Type: to.Ptr("DockerBuildRequest"), - IsArchiveEnabled: to.Ptr(true), - AgentConfiguration: &armcontainerregistry.AgentProperties{ - CPU: to.Ptr[int32](2), - }, - Arguments: []*armcontainerregistry.Argument{ - { - Name: to.Ptr("mytestargument"), - IsSecret: to.Ptr(false), - Value: to.Ptr("mytestvalue"), - }, - { - Name: to.Ptr("mysecrettestargument"), - IsSecret: to.Ptr(true), - Value: to.Ptr("mysecrettestvalue"), - }}, - Credentials: &armcontainerregistry.Credentials{ - CustomRegistries: map[string]*armcontainerregistry.CustomRegistryCredentials{ - "myregistry.azurecr.io": { - Password: &armcontainerregistry.SecretObject{ - Type: to.Ptr(armcontainerregistry.SecretObjectTypeOpaque), - Value: to.Ptr("***"), - }, - UserName: &armcontainerregistry.SecretObject{ - Type: to.Ptr(armcontainerregistry.SecretObjectTypeOpaque), - Value: to.Ptr("reg1"), - }, - }, - "myregistry2.azurecr.io": { - Password: &armcontainerregistry.SecretObject{ - Type: to.Ptr(armcontainerregistry.SecretObjectTypeOpaque), - Value: to.Ptr("***"), - }, - UserName: &armcontainerregistry.SecretObject{ - Type: to.Ptr(armcontainerregistry.SecretObjectTypeOpaque), - Value: to.Ptr("reg2"), - }, - }, - }, - SourceRegistry: &armcontainerregistry.SourceRegistryCredentials{ - LoginMode: to.Ptr(armcontainerregistry.SourceRegistryLoginModeDefault), - }, - }, - DockerFilePath: to.Ptr("DockerFile"), - ImageNames: []*string{ - to.Ptr("azurerest:testtag")}, - IsPushEnabled: to.Ptr(true), - NoCache: to.Ptr(true), - Platform: &armcontainerregistry.PlatformProperties{ - Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64), - OS: to.Ptr(armcontainerregistry.OSLinux), - }, - SourceLocation: to.Ptr("https://myaccount.blob.core.windows.net/sascontainer/source.zip?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D"), - Target: to.Ptr("stage1"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Run = armcontainerregistry.Run{ - // Name: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/run"), - // ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/runs/0accec26-d6de-4757-8e74-d080f38eaaab"), - // Properties: &armcontainerregistry.RunProperties{ - // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T05:13:51.617Z"); return t}()), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // RunID: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"), - // Status: to.Ptr(armcontainerregistry.RunStatusSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/RegistriesScheduleRun_WithLogTemplate.json -func ExampleRegistriesClient_ScheduleRun_registriesScheduleRunWithLogTemplate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRegistriesClient().ScheduleRun(ctx, "myResourceGroup", "myRegistry", &armcontainerregistry.DockerBuildRequest{ - Type: to.Ptr("DockerBuildRequest"), - IsArchiveEnabled: to.Ptr(true), - LogTemplate: to.Ptr("acr/tasks:{{.Run.OS}}"), - AgentConfiguration: &armcontainerregistry.AgentProperties{ - CPU: to.Ptr[int32](2), - }, - Arguments: []*armcontainerregistry.Argument{ - { - Name: to.Ptr("mytestargument"), - IsSecret: to.Ptr(false), - Value: to.Ptr("mytestvalue"), - }, - { - Name: to.Ptr("mysecrettestargument"), - IsSecret: to.Ptr(true), - Value: to.Ptr("mysecrettestvalue"), - }}, - DockerFilePath: to.Ptr("DockerFile"), - ImageNames: []*string{ - to.Ptr("azurerest:testtag")}, - IsPushEnabled: to.Ptr(true), - NoCache: to.Ptr(true), - Platform: &armcontainerregistry.PlatformProperties{ - Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64), - OS: to.Ptr(armcontainerregistry.OSLinux), - }, - SourceLocation: to.Ptr("https://myaccount.blob.core.windows.net/sascontainer/source.zip?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Run = armcontainerregistry.Run{ - // Name: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/run"), - // ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/runs/0accec26-d6de-4757-8e74-d080f38eaaab"), - // Properties: &armcontainerregistry.RunProperties{ - // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T05:13:51.617Z"); return t}()), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // RunID: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"), - // Status: to.Ptr(armcontainerregistry.RunStatusSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/RegistriesGetBuildSourceUploadUrl.json -func ExampleRegistriesClient_GetBuildSourceUploadURL() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRegistriesClient().GetBuildSourceUploadURL(ctx, "myResourceGroup", "myRegistry", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SourceUploadDefinition = armcontainerregistry.SourceUploadDefinition{ - // RelativePath: to.Ptr("source/201802130000/b52f12d8-c3d6-4d75-9107-220f0bfc681d.tar.gz"), - // UploadURL: to.Ptr("https://registrystorageaccount.blob.core.windows.net/registrycontainer/source/201802130000/b52f12d8-c3d6-4d75-9107-220f0bfc681d.tar.gz?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D"), - // } -} diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/replications_client.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/replications_client.go index f14c920dad40..23c85002142c 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/replications_client.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/replications_client.go @@ -43,7 +43,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 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -71,7 +71,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 2025-03-01-preview +// Generated from API version 2025-05-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" @@ -117,7 +117,7 @@ func (client *ReplicationsClient) createCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, replication); err != nil { @@ -129,7 +129,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 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -156,7 +156,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 2025-03-01-preview +// Generated from API version 2025-05-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" @@ -202,7 +202,7 @@ func (client *ReplicationsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -210,7 +210,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 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -261,7 +261,7 @@ func (client *ReplicationsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -278,7 +278,7 @@ func (client *ReplicationsClient) getHandleResponse(resp *http.Response) (Replic // NewListPager - Lists all the replications for the specified container registry. // -// Generated from API version 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -325,7 +325,7 @@ func (client *ReplicationsClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -343,7 +343,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 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -371,7 +371,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 2025-03-01-preview +// Generated from API version 2025-05-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" @@ -417,7 +417,7 @@ func (client *ReplicationsClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-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 deleted file mode 100644 index 9f99a2a59530..000000000000 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/replications_client_example_test.go +++ /dev/null @@ -1,273 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/ReplicationList.json -func ExampleReplicationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewReplicationsClient().NewListPager("myResourceGroup", "myRegistry", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ReplicationListResult = armcontainerregistry.ReplicationListResult{ - // Value: []*armcontainerregistry.Replication{ - // { - // Name: to.Ptr("myReplication"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/replications"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/replications/myReplication"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Properties: &armcontainerregistry.ReplicationProperties{ - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // RegionEndpointEnabled: to.Ptr(true), - // Status: &armcontainerregistry.Status{ - // DisplayStatus: to.Ptr("Ready"), - // Message: to.Ptr("The replication is ready."), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:15:37.070Z"); return t}()), - // }, - // ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyDisabled), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/ReplicationGet.json -func ExampleReplicationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewReplicationsClient().Get(ctx, "myResourceGroup", "myRegistry", "myReplication", 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.Replication = armcontainerregistry.Replication{ - // Name: to.Ptr("myReplication"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/replications"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/replications/myReplication"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Properties: &armcontainerregistry.ReplicationProperties{ - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // RegionEndpointEnabled: to.Ptr(true), - // Status: &armcontainerregistry.Status{ - // DisplayStatus: to.Ptr("Ready"), - // Message: to.Ptr("The replication is ready."), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:15:37.070Z"); return t}()), - // }, - // ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyDisabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/ReplicationCreate.json -func ExampleReplicationsClient_BeginCreate_replicationCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationsClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", "myReplication", armcontainerregistry.Replication{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "key": to.Ptr("value"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Replication = armcontainerregistry.Replication{ - // Name: to.Ptr("myReplication"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/replications"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/replications/myReplication"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Properties: &armcontainerregistry.ReplicationProperties{ - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // RegionEndpointEnabled: to.Ptr(true), - // Status: &armcontainerregistry.Status{ - // DisplayStatus: to.Ptr("Ready"), - // Message: to.Ptr("The replication is ready."), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:15:37.070Z"); return t}()), - // }, - // ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyDisabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/ReplicationCreateZoneRedundant.json -func ExampleReplicationsClient_BeginCreate_replicationCreateZoneRedundant() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationsClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", "myReplication", armcontainerregistry.Replication{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "key": to.Ptr("value"), - }, - Properties: &armcontainerregistry.ReplicationProperties{ - RegionEndpointEnabled: to.Ptr(true), - ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyEnabled), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Replication = armcontainerregistry.Replication{ - // Name: to.Ptr("myReplication"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/replications"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/replications/myReplication"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Properties: &armcontainerregistry.ReplicationProperties{ - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // RegionEndpointEnabled: to.Ptr(true), - // Status: &armcontainerregistry.Status{ - // DisplayStatus: to.Ptr("Ready"), - // Message: to.Ptr("The replication is ready."), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:15:37.070Z"); return t}()), - // }, - // ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyEnabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/ReplicationDelete.json -func ExampleReplicationsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationsClient().BeginDelete(ctx, "myResourceGroup", "myRegistry", "myReplication", 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/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/ReplicationUpdate.json -func ExampleReplicationsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReplicationsClient().BeginUpdate(ctx, "myResourceGroup", "myRegistry", "myReplication", armcontainerregistry.ReplicationUpdateParameters{ - Tags: map[string]*string{ - "key": to.Ptr("value"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Replication = armcontainerregistry.Replication{ - // Name: to.Ptr("myReplication"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/replications"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/replications/myReplication"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Properties: &armcontainerregistry.ReplicationProperties{ - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // RegionEndpointEnabled: to.Ptr(true), - // Status: &armcontainerregistry.Status{ - // DisplayStatus: to.Ptr("Ready"), - // Message: to.Ptr("The replication is ready."), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:15:37.070Z"); return t}()), - // }, - // ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyDisabled), - // }, - // } -} diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/runs_client_example_test.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/runs_client_example_test.go deleted file mode 100644 index b64a5fc09af8..000000000000 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/runs_client_example_test.go +++ /dev/null @@ -1,275 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/RunsList.json -func ExampleRunsClient_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.NewRunsClient().NewListPager("myResourceGroup", "myRegistry", &armcontainerregistry.RunsClientListOptions{Filter: to.Ptr(""), - Top: to.Ptr[int32](10), - }) - 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.RunListResult = armcontainerregistry.RunListResult{ - // Value: []*armcontainerregistry.Run{ - // { - // Name: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/runs"), - // ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/runs/0accec26-d6de-4757-8e74-d080f38eaaab"), - // Properties: &armcontainerregistry.RunProperties{ - // AgentConfiguration: &armcontainerregistry.AgentProperties{ - // CPU: to.Ptr[int32](2), - // }, - // CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T05:13:51.618Z"); return t}()), - // FinishTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T06:13:51.618Z"); return t}()), - // ImageUpdateTrigger: &armcontainerregistry.ImageUpdateTrigger{ - // ID: to.Ptr("c0c43143-da5d-41ef-b9e1-e7d749272e88"), - // Images: []*armcontainerregistry.ImageDescriptor{ - // { - // Digest: to.Ptr("sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0"), - // Registry: to.Ptr("registry.hub.docker.com"), - // Repository: to.Ptr("mybaseimage"), - // Tag: to.Ptr("latest"), - // }}, - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T05:13:51.618Z"); return t}()), - // }, - // IsArchiveEnabled: to.Ptr(true), - // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T05:13:51.617Z"); return t}()), - // LogArtifact: &armcontainerregistry.ImageDescriptor{ - // Digest: to.Ptr("sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0"), - // Registry: to.Ptr("myregistry"), - // Repository: to.Ptr("acr/tasks"), - // Tag: to.Ptr("mytask-0accec26-d6de-4757-8e74-d080f38eaaab-log"), - // }, - // OutputImages: []*armcontainerregistry.ImageDescriptor{ - // { - // Digest: to.Ptr("sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0"), - // Registry: to.Ptr("myregistry.azurecr.io"), - // Repository: to.Ptr("myimage"), - // Tag: to.Ptr("latest"), - // }}, - // Platform: &armcontainerregistry.PlatformProperties{ - // Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64), - // OS: to.Ptr(armcontainerregistry.OSLinux), - // }, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // RunID: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"), - // RunType: to.Ptr(armcontainerregistry.RunTypeAutoBuild), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T05:50:51.618Z"); return t}()), - // Status: to.Ptr(armcontainerregistry.RunStatusSucceeded), - // Task: to.Ptr("myTask"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/RunsGet.json -func ExampleRunsClient_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.NewRunsClient().Get(ctx, "myResourceGroup", "myRegistry", "0accec26-d6de-4757-8e74-d080f38eaaab", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Run = armcontainerregistry.Run{ - // Name: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/runs"), - // ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/runs/0accec26-d6de-4757-8e74-d080f38eaaab"), - // Properties: &armcontainerregistry.RunProperties{ - // AgentConfiguration: &armcontainerregistry.AgentProperties{ - // CPU: to.Ptr[int32](2), - // }, - // CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T05:13:51.618Z"); return t}()), - // FinishTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T06:13:51.618Z"); return t}()), - // ImageUpdateTrigger: &armcontainerregistry.ImageUpdateTrigger{ - // ID: to.Ptr("c0c43143-da5d-41ef-b9e1-e7d749272e88"), - // Images: []*armcontainerregistry.ImageDescriptor{ - // { - // Digest: to.Ptr("sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0"), - // Registry: to.Ptr("registry.hub.docker.com"), - // Repository: to.Ptr("mybaseimage"), - // Tag: to.Ptr("latest"), - // }}, - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T05:13:51.618Z"); return t}()), - // }, - // IsArchiveEnabled: to.Ptr(true), - // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T05:13:51.617Z"); return t}()), - // LogArtifact: &armcontainerregistry.ImageDescriptor{ - // Digest: to.Ptr("sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0"), - // Registry: to.Ptr("myregistry"), - // Repository: to.Ptr("acr/tasks"), - // Tag: to.Ptr("mytask-0accec26-d6de-4757-8e74-d080f38eaaab-log"), - // }, - // OutputImages: []*armcontainerregistry.ImageDescriptor{ - // { - // Digest: to.Ptr("sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0"), - // Registry: to.Ptr("myregistry.azurecr.io"), - // Repository: to.Ptr("myimage"), - // Tag: to.Ptr("latest"), - // }}, - // Platform: &armcontainerregistry.PlatformProperties{ - // Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64), - // OS: to.Ptr(armcontainerregistry.OSLinux), - // }, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // RunID: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"), - // RunType: to.Ptr(armcontainerregistry.RunTypeAutoBuild), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T05:50:51.618Z"); return t}()), - // Status: to.Ptr(armcontainerregistry.RunStatusSucceeded), - // Task: to.Ptr("myTask"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/RunsUpdate.json -func ExampleRunsClient_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.NewRunsClient().Update(ctx, "myResourceGroup", "myRegistry", "0accec26-d6de-4757-8e74-d080f38eaaab", armcontainerregistry.RunUpdateParameters{ - IsArchiveEnabled: to.Ptr(true), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Run = armcontainerregistry.Run{ - // Name: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/runs"), - // ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/runs/0accec26-d6de-4757-8e74-d080f38eaaab"), - // Properties: &armcontainerregistry.RunProperties{ - // AgentConfiguration: &armcontainerregistry.AgentProperties{ - // CPU: to.Ptr[int32](2), - // }, - // CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T05:13:51.618Z"); return t}()), - // FinishTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T06:13:51.618Z"); return t}()), - // ImageUpdateTrigger: &armcontainerregistry.ImageUpdateTrigger{ - // ID: to.Ptr("c0c43143-da5d-41ef-b9e1-e7d749272e88"), - // Images: []*armcontainerregistry.ImageDescriptor{ - // { - // Digest: to.Ptr("sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0"), - // Registry: to.Ptr("registry.hub.docker.com"), - // Repository: to.Ptr("mybaseimage"), - // Tag: to.Ptr("latest"), - // }}, - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T05:13:51.618Z"); return t}()), - // }, - // IsArchiveEnabled: to.Ptr(true), - // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T05:13:51.617Z"); return t}()), - // LogArtifact: &armcontainerregistry.ImageDescriptor{ - // Digest: to.Ptr("sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0"), - // Registry: to.Ptr("myregistry"), - // Repository: to.Ptr("acr/tasks"), - // Tag: to.Ptr("mytask-0accec26-d6de-4757-8e74-d080f38eaaab-log"), - // }, - // OutputImages: []*armcontainerregistry.ImageDescriptor{ - // { - // Digest: to.Ptr("sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0"), - // Registry: to.Ptr("myregistry.azurecr.io"), - // Repository: to.Ptr("myimage"), - // Tag: to.Ptr("latest"), - // }}, - // Platform: &armcontainerregistry.PlatformProperties{ - // Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64), - // OS: to.Ptr(armcontainerregistry.OSLinux), - // }, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // RunID: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"), - // RunType: to.Ptr(armcontainerregistry.RunTypeAutoBuild), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T05:50:51.618Z"); return t}()), - // Status: to.Ptr(armcontainerregistry.RunStatusSucceeded), - // Task: to.Ptr("myTask"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/RunsGetLogSasUrl.json -func ExampleRunsClient_GetLogSasURL() { - 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.NewRunsClient().GetLogSasURL(ctx, "myResourceGroup", "myRegistry", "0accec26-d6de-4757-8e74-d080f38eaaab", 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.RunGetLogResult = armcontainerregistry.RunGetLogResult{ - // LogLink: to.Ptr("https://registrystorageaccount.blob.core.windows.net/sascontainer/logs/0accec26-d6de-4757-8e74-d080f38eaaab/rawtext.log?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/RunsCancel.json -func ExampleRunsClient_Cancel() { - 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) - } - _, err = clientFactory.NewRunsClient().Cancel(ctx, "myResourceGroup", "myRegistry", "0accec26-d6de-4757-8e74-d080f38eaaab", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/scopemaps_client.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/scopemaps_client.go index 0d78600658c7..119bb87d75f4 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/scopemaps_client.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/scopemaps_client.go @@ -43,7 +43,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 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -70,7 +70,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 2025-03-01-preview +// Generated from API version 2025-05-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" @@ -116,7 +116,7 @@ func (client *ScopeMapsClient) createCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, scopeMapCreateParameters); err != nil { @@ -128,7 +128,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 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -154,7 +154,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 2025-03-01-preview +// Generated from API version 2025-05-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" @@ -200,7 +200,7 @@ func (client *ScopeMapsClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -209,7 +209,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 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -260,7 +260,7 @@ func (client *ScopeMapsClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -277,7 +277,7 @@ func (client *ScopeMapsClient) getHandleResponse(resp *http.Response) (ScopeMaps // NewListPager - Lists all the scope maps for the specified container registry. // -// Generated from API version 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -324,7 +324,7 @@ func (client *ScopeMapsClient) listCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -342,7 +342,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 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -369,7 +369,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 2025-03-01-preview +// Generated from API version 2025-05-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" @@ -415,7 +415,7 @@ func (client *ScopeMapsClient) updateCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-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 deleted file mode 100644 index b0044118caab..000000000000 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/scopemaps_client_example_test.go +++ /dev/null @@ -1,202 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/ScopeMapList.json -func ExampleScopeMapsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewScopeMapsClient().NewListPager("myResourceGroup", "myRegistry", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ScopeMapListResult = armcontainerregistry.ScopeMapListResult{ - // Value: []*armcontainerregistry.ScopeMap{ - // { - // Name: to.Ptr("myScopeMap"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/scopeMaps"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myScopeMap"), - // Properties: &armcontainerregistry.ScopeMapProperties{ - // Type: to.Ptr("IsUserDefined"), - // Actions: []*string{ - // to.Ptr("repositories/myrepository/contentWrite"), - // to.Ptr("repositories/myrepository/delete")}, - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:14:37.070Z"); return t}()), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/ScopeMapGet.json -func ExampleScopeMapsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScopeMapsClient().Get(ctx, "myResourceGroup", "myRegistry", "myScopeMap", 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.ScopeMap = armcontainerregistry.ScopeMap{ - // Name: to.Ptr("myScopeMap"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/scopeMaps"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myScopeMap"), - // Properties: &armcontainerregistry.ScopeMapProperties{ - // Type: to.Ptr("IsUserDefined"), - // Actions: []*string{ - // to.Ptr("repositories/myrepository/contentWrite"), - // to.Ptr("repositories/myrepository/delete")}, - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:14:37.070Z"); return t}()), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/ScopeMapCreate.json -func ExampleScopeMapsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewScopeMapsClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", "myScopeMap", armcontainerregistry.ScopeMap{ - Properties: &armcontainerregistry.ScopeMapProperties{ - Description: to.Ptr("Developer Scopes"), - Actions: []*string{ - to.Ptr("repositories/myrepository/contentWrite"), - to.Ptr("repositories/myrepository/delete")}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ScopeMap = armcontainerregistry.ScopeMap{ - // Name: to.Ptr("myScopeMap"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/scopeMaps"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myScopeMap"), - // Properties: &armcontainerregistry.ScopeMapProperties{ - // Type: to.Ptr("IsUserDefined"), - // Actions: []*string{ - // to.Ptr("repositories/myrepository/contentWrite"), - // to.Ptr("repositories/myrepository/delete")}, - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:14:37.070Z"); return t}()), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/ScopeMapDelete.json -func ExampleScopeMapsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewScopeMapsClient().BeginDelete(ctx, "myResourceGroup", "myRegistry", "myScopeMap", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/ScopeMapUpdate.json -func ExampleScopeMapsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewScopeMapsClient().BeginUpdate(ctx, "myResourceGroup", "myRegistry", "myScopeMap", armcontainerregistry.ScopeMapUpdateParameters{ - Properties: &armcontainerregistry.ScopeMapPropertiesUpdateParameters{ - Description: to.Ptr("Developer Scopes"), - Actions: []*string{ - to.Ptr("repositories/myrepository/contentWrite"), - to.Ptr("repositories/myrepository/contentRead")}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ScopeMap = armcontainerregistry.ScopeMap{ - // Name: to.Ptr("myScopeMap"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/scopeMaps"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myScopeMap"), - // Properties: &armcontainerregistry.ScopeMapProperties{ - // Type: to.Ptr("IsUserDefined"), - // Actions: []*string{ - // to.Ptr("repositories/myrepository/contentWrite"), - // to.Ptr("repositories/myrepository/contentRead")}, - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:14:37.070Z"); return t}()), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // }, - // } -} diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/taskruns_client_example_test.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/taskruns_client_example_test.go deleted file mode 100644 index 4dd83d335692..000000000000 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/taskruns_client_example_test.go +++ /dev/null @@ -1,404 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/TaskRunsGet.json -func ExampleTaskRunsClient_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.NewTaskRunsClient().Get(ctx, "myResourceGroup", "myRegistry", "myRun", 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.TaskRun = armcontainerregistry.TaskRun{ - // Name: to.Ptr("myRun"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/TaskRuns"), - // ID: to.Ptr("/subscriptions/3647315e-0c5b-4ce4-8739-b071e144b2c9/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/taskRuns/myRun"), - // Properties: &armcontainerregistry.TaskRunProperties{ - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // RunRequest: &armcontainerregistry.EncodedTaskRunRequest{ - // Type: to.Ptr("EncodedTaskRunRequest"), - // IsArchiveEnabled: to.Ptr(true), - // Credentials: &armcontainerregistry.Credentials{ - // }, - // EncodedTaskContent: to.Ptr("c3RlcHM6IAogIC0gY21kOiB7eyAuVmFsdWVzLmNvbW1hbmQgfX0K"), - // EncodedValuesContent: to.Ptr("Y29tbWFuZDogYmFzaCBlY2hvIHt7LlJ1bi5SZWdpc3RyeX19Cg=="), - // Platform: &armcontainerregistry.PlatformProperties{ - // Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64), - // OS: to.Ptr(armcontainerregistry.OSLinux), - // }, - // Values: []*armcontainerregistry.SetValue{ - // }, - // }, - // RunResult: &armcontainerregistry.Run{ - // Name: to.Ptr("yd5"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/runs"), - // ID: to.Ptr("/subscriptions/3647315e-0c5b-4ce4-8739-b071e144b2c9/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/runs/yd5"), - // Properties: &armcontainerregistry.RunProperties{ - // AgentConfiguration: &armcontainerregistry.AgentProperties{ - // CPU: to.Ptr[int32](2), - // }, - // CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-06T17:23:21.926Z"); return t}()), - // FinishTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-06T17:23:29.879Z"); return t}()), - // IsArchiveEnabled: to.Ptr(true), - // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-06T17:23:29.000Z"); return t}()), - // Platform: &armcontainerregistry.PlatformProperties{ - // Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64), - // OS: to.Ptr(armcontainerregistry.OSLinux), - // }, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // RunID: to.Ptr("yd5"), - // RunType: to.Ptr(armcontainerregistry.RunTypeQuickRun), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-06T17:23:22.134Z"); return t}()), - // Status: to.Ptr(armcontainerregistry.RunStatusSucceeded), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/TaskRunsCreate.json -func ExampleTaskRunsClient_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.NewTaskRunsClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", "myRun", armcontainerregistry.TaskRun{ - Properties: &armcontainerregistry.TaskRunProperties{ - ForceUpdateTag: to.Ptr("test"), - RunRequest: &armcontainerregistry.EncodedTaskRunRequest{ - Type: to.Ptr("EncodedTaskRunRequest"), - Credentials: &armcontainerregistry.Credentials{}, - EncodedTaskContent: to.Ptr("c3RlcHM6IAogIC0gY21kOiB7eyAuVmFsdWVzLmNvbW1hbmQgfX0K"), - EncodedValuesContent: to.Ptr("Y29tbWFuZDogYmFzaCBlY2hvIHt7LlJ1bi5SZWdpc3RyeX19Cg=="), - Platform: &armcontainerregistry.PlatformProperties{ - Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64), - OS: to.Ptr(armcontainerregistry.OSLinux), - }, - Values: []*armcontainerregistry.SetValue{}, - }, - }, - }, 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.TaskRun = armcontainerregistry.TaskRun{ - // Name: to.Ptr("myrun"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/TaskRuns"), - // ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/taskRuns/myRun"), - // Properties: &armcontainerregistry.TaskRunProperties{ - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // RunRequest: &armcontainerregistry.EncodedTaskRunRequest{ - // Type: to.Ptr("EncodedTaskRunRequest"), - // IsArchiveEnabled: to.Ptr(true), - // Credentials: &armcontainerregistry.Credentials{ - // }, - // EncodedTaskContent: to.Ptr("c3RlcHM6IAogIC0gY21kOiB7eyAuVmFsdWVzLmNvbW1hbmQgfX0K"), - // EncodedValuesContent: to.Ptr("Y29tbWFuZDogYmFzaCBlY2hvIHt7LlJ1bi5SZWdpc3RyeX19Cg=="), - // Platform: &armcontainerregistry.PlatformProperties{ - // Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64), - // OS: to.Ptr(armcontainerregistry.OSLinux), - // }, - // Values: []*armcontainerregistry.SetValue{ - // }, - // }, - // RunResult: &armcontainerregistry.Run{ - // Name: to.Ptr("yd5"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/runs"), - // ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/runs/yd5"), - // Properties: &armcontainerregistry.RunProperties{ - // AgentConfiguration: &armcontainerregistry.AgentProperties{ - // CPU: to.Ptr[int32](2), - // }, - // CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-06T17:23:21.926Z"); return t}()), - // IsArchiveEnabled: to.Ptr(true), - // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-06T17:23:21.000Z"); return t}()), - // Platform: &armcontainerregistry.PlatformProperties{ - // Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64), - // OS: to.Ptr(armcontainerregistry.OSLinux), - // }, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // RunID: to.Ptr("yd5"), - // RunType: to.Ptr(armcontainerregistry.RunTypeQuickRun), - // Status: to.Ptr(armcontainerregistry.RunStatusQueued), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/TaskRunsDelete.json -func ExampleTaskRunsClient_Delete() { - 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) - } - _, err = clientFactory.NewTaskRunsClient().Delete(ctx, "myResourceGroup", "myRegistry", "myRun", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/TaskRunsUpdate.json -func ExampleTaskRunsClient_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.NewTaskRunsClient().BeginUpdate(ctx, "myResourceGroup", "myRegistry", "myRun", armcontainerregistry.TaskRunUpdateParameters{ - Properties: &armcontainerregistry.TaskRunPropertiesUpdateParameters{ - ForceUpdateTag: to.Ptr("test"), - RunRequest: &armcontainerregistry.EncodedTaskRunRequest{ - Type: to.Ptr("EncodedTaskRunRequest"), - IsArchiveEnabled: to.Ptr(true), - Credentials: &armcontainerregistry.Credentials{}, - EncodedTaskContent: to.Ptr("c3RlcHM6IAogIC0gY21kOiB7eyAuVmFsdWVzLmNvbW1hbmQgfX0K"), - EncodedValuesContent: to.Ptr("Y29tbWFuZDogYmFzaCBlY2hvIHt7LlJ1bi5SZWdpc3RyeX19Cg=="), - Platform: &armcontainerregistry.PlatformProperties{ - Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64), - OS: to.Ptr(armcontainerregistry.OSLinux), - }, - Values: []*armcontainerregistry.SetValue{}, - }, - }, - }, 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.TaskRun = armcontainerregistry.TaskRun{ - // Name: to.Ptr("mytestrun"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/TaskRuns"), - // ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/taskRuns/myRun"), - // Properties: &armcontainerregistry.TaskRunProperties{ - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // RunRequest: &armcontainerregistry.EncodedTaskRunRequest{ - // Type: to.Ptr("EncodedTaskRunRequest"), - // IsArchiveEnabled: to.Ptr(true), - // Credentials: &armcontainerregistry.Credentials{ - // }, - // EncodedTaskContent: to.Ptr("c3RlcHM6IAogIC0gY21kOiB7eyAuVmFsdWVzLmNvbW1hbmQgfX0K"), - // EncodedValuesContent: to.Ptr("Y29tbWFuZDogYmFzaCBlY2hvIHt7LlJ1bi5SZWdpc3RyeX19Cg=="), - // Platform: &armcontainerregistry.PlatformProperties{ - // Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64), - // OS: to.Ptr(armcontainerregistry.OSLinux), - // }, - // Values: []*armcontainerregistry.SetValue{ - // }, - // }, - // RunResult: &armcontainerregistry.Run{ - // Name: to.Ptr("yd6"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/runs"), - // ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/runs/yd6"), - // Properties: &armcontainerregistry.RunProperties{ - // AgentConfiguration: &armcontainerregistry.AgentProperties{ - // CPU: to.Ptr[int32](2), - // }, - // CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-06T17:31:34.118Z"); return t}()), - // IsArchiveEnabled: to.Ptr(true), - // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-06T17:31:34.000Z"); return t}()), - // Platform: &armcontainerregistry.PlatformProperties{ - // Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64), - // OS: to.Ptr(armcontainerregistry.OSLinux), - // }, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // RunID: to.Ptr("yd6"), - // RunType: to.Ptr(armcontainerregistry.RunTypeQuickRun), - // Status: to.Ptr(armcontainerregistry.RunStatusQueued), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/TaskRunsGetDetails.json -func ExampleTaskRunsClient_GetDetails() { - 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.NewTaskRunsClient().GetDetails(ctx, "myResourceGroup", "myRegistry", "myRun", 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.TaskRun = armcontainerregistry.TaskRun{ - // Name: to.Ptr("myRun"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/TaskRuns"), - // ID: to.Ptr("/subscriptions/3647315e-0c5b-4ce4-8739-b071e144b2c9/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/taskRuns/myRun"), - // Properties: &armcontainerregistry.TaskRunProperties{ - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // RunRequest: &armcontainerregistry.EncodedTaskRunRequest{ - // Type: to.Ptr("EncodedTaskRunRequest"), - // IsArchiveEnabled: to.Ptr(true), - // Credentials: &armcontainerregistry.Credentials{ - // }, - // EncodedTaskContent: to.Ptr("c3RlcHM6IAogIC0gY21kOiB7eyAuVmFsdWVzLmNvbW1hbmQgfX0K"), - // EncodedValuesContent: to.Ptr("Y29tbWFuZDogYmFzaCBlY2hvIHt7LlJ1bi5SZWdpc3RyeX19Cg=="), - // Platform: &armcontainerregistry.PlatformProperties{ - // Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64), - // OS: to.Ptr(armcontainerregistry.OSLinux), - // }, - // Values: []*armcontainerregistry.SetValue{ - // }, - // }, - // RunResult: &armcontainerregistry.Run{ - // Name: to.Ptr("yd5"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/runs"), - // ID: to.Ptr("/subscriptions/3647315e-0c5b-4ce4-8739-b071e144b2c9/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/runs/yd5"), - // Properties: &armcontainerregistry.RunProperties{ - // AgentConfiguration: &armcontainerregistry.AgentProperties{ - // CPU: to.Ptr[int32](2), - // }, - // CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-06T17:23:21.926Z"); return t}()), - // FinishTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-06T17:23:29.879Z"); return t}()), - // IsArchiveEnabled: to.Ptr(true), - // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-06T17:23:29.000Z"); return t}()), - // Platform: &armcontainerregistry.PlatformProperties{ - // Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64), - // OS: to.Ptr(armcontainerregistry.OSLinux), - // }, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // RunID: to.Ptr("yd5"), - // RunType: to.Ptr(armcontainerregistry.RunTypeQuickRun), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-06T17:23:22.134Z"); return t}()), - // Status: to.Ptr(armcontainerregistry.RunStatusSucceeded), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/TaskRunsList.json -func ExampleTaskRunsClient_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.NewTaskRunsClient().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.TaskRunListResult = armcontainerregistry.TaskRunListResult{ - // Value: []*armcontainerregistry.TaskRun{ - // { - // Name: to.Ptr("mytestrun"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/TaskRuns"), - // ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/taskRuns/myRun"), - // Properties: &armcontainerregistry.TaskRunProperties{ - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // RunRequest: &armcontainerregistry.EncodedTaskRunRequest{ - // Type: to.Ptr("EncodedTaskRunRequest"), - // IsArchiveEnabled: to.Ptr(true), - // Credentials: &armcontainerregistry.Credentials{ - // }, - // EncodedTaskContent: to.Ptr("c3RlcHM6IAogIC0gY21kOiB7eyAuVmFsdWVzLmNvbW1hbmQgfX0K"), - // EncodedValuesContent: to.Ptr("Y29tbWFuZDogYmFzaCBlY2hvIHt7LlJ1bi5SZWdpc3RyeX19Cg=="), - // Platform: &armcontainerregistry.PlatformProperties{ - // Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64), - // OS: to.Ptr(armcontainerregistry.OSLinux), - // }, - // Values: []*armcontainerregistry.SetValue{ - // }, - // }, - // RunResult: &armcontainerregistry.Run{ - // Name: to.Ptr("yd4"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/runs"), - // ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/runs/yd4"), - // Properties: &armcontainerregistry.RunProperties{ - // AgentConfiguration: &armcontainerregistry.AgentProperties{ - // CPU: to.Ptr[int32](2), - // }, - // CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-04T17:15:29.227Z"); return t}()), - // FinishTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-04T17:15:37.034Z"); return t}()), - // IsArchiveEnabled: to.Ptr(true), - // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-04T17:15:37.000Z"); return t}()), - // Platform: &armcontainerregistry.PlatformProperties{ - // Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64), - // OS: to.Ptr(armcontainerregistry.OSLinux), - // }, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // RunID: to.Ptr("yd4"), - // RunType: to.Ptr(armcontainerregistry.RunTypeQuickRun), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-04T17:15:29.458Z"); return t}()), - // Status: to.Ptr(armcontainerregistry.RunStatusSucceeded), - // }, - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/tasks_client_example_test.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/tasks_client_example_test.go deleted file mode 100644 index 7104c155eb7e..000000000000 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/tasks_client_example_test.go +++ /dev/null @@ -1,1895 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/TasksList.json -func ExampleTasksClient_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.NewTasksClient().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.TaskListResult = armcontainerregistry.TaskListResult{ - // Value: []*armcontainerregistry.Task{ - // { - // Name: to.Ptr("myTask"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/tasks"), - // ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tasks/myTask"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "testkey": to.Ptr("value"), - // }, - // Identity: &armcontainerregistry.IdentityProperties{ - // Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("fa153151-b9fd-46f4-9088-5e6600f2689v"), - // TenantID: to.Ptr("f686d426-8d16-42db-81b7-abu4gm510ccd"), - // }, - // Properties: &armcontainerregistry.TaskProperties{ - // AgentConfiguration: &armcontainerregistry.AgentProperties{ - // CPU: to.Ptr[int32](2), - // }, - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T06:54:23.536Z"); return t}()), - // Credentials: &armcontainerregistry.Credentials{ - // CustomRegistries: map[string]*armcontainerregistry.CustomRegistryCredentials{ - // "myRegistry.azure.io": nil, - // }, - // }, - // IsSystemTask: to.Ptr(false), - // Platform: &armcontainerregistry.PlatformProperties{ - // Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64), - // OS: to.Ptr(armcontainerregistry.OSLinux), - // }, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // Status: to.Ptr(armcontainerregistry.TaskStatusEnabled), - // Step: &armcontainerregistry.DockerBuildStep{ - // Type: to.Ptr(armcontainerregistry.StepTypeDocker), - // ContextPath: to.Ptr("src"), - // Arguments: []*armcontainerregistry.Argument{ - // { - // Name: to.Ptr("mytestargument"), - // IsSecret: to.Ptr(false), - // Value: to.Ptr("mytestvalue"), - // }}, - // DockerFilePath: to.Ptr("src/DockerFile"), - // ImageNames: []*string{ - // to.Ptr("azurerest:testtag")}, - // IsPushEnabled: to.Ptr(true), - // NoCache: to.Ptr(false), - // }, - // Trigger: &armcontainerregistry.TriggerProperties{ - // BaseImageTrigger: &armcontainerregistry.BaseImageTrigger{ - // Name: to.Ptr("myBaseImageTrigger"), - // BaseImageTriggerType: to.Ptr(armcontainerregistry.BaseImageTriggerTypeRuntime), - // Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled), - // UpdateTriggerPayloadType: to.Ptr(armcontainerregistry.UpdateTriggerPayloadTypeDefault), - // }, - // SourceTriggers: []*armcontainerregistry.SourceTrigger{ - // { - // Name: to.Ptr("mySourceTrigger"), - // SourceRepository: &armcontainerregistry.SourceProperties{ - // Branch: to.Ptr("master"), - // RepositoryURL: to.Ptr("https://github.com/Azure/azure-rest-api-specs"), - // SourceControlType: to.Ptr(armcontainerregistry.SourceControlTypeGithub), - // }, - // SourceTriggerEvents: []*armcontainerregistry.SourceTriggerEvent{ - // to.Ptr(armcontainerregistry.SourceTriggerEventCommit)}, - // Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled), - // }}, - // TimerTriggers: []*armcontainerregistry.TimerTrigger{ - // { - // Name: to.Ptr("myTimerTrigger"), - // Schedule: to.Ptr("30 9 * * 1-5"), - // Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled), - // }}, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/TasksGet.json -func ExampleTasksClient_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.NewTasksClient().Get(ctx, "myResourceGroup", "myRegistry", "myTask", 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.Task = armcontainerregistry.Task{ - // Name: to.Ptr("myTask"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/tasks"), - // ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tasks/myTask"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "testkey": to.Ptr("value"), - // }, - // Identity: &armcontainerregistry.IdentityProperties{ - // Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("fa153151-b9fd-46f4-9088-5e6600f2689v"), - // TenantID: to.Ptr("f686d426-8d16-42db-81b7-abu4gm510ccd"), - // }, - // Properties: &armcontainerregistry.TaskProperties{ - // AgentConfiguration: &armcontainerregistry.AgentProperties{ - // CPU: to.Ptr[int32](2), - // }, - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T06:54:23.536Z"); return t}()), - // Credentials: &armcontainerregistry.Credentials{ - // CustomRegistries: map[string]*armcontainerregistry.CustomRegistryCredentials{ - // "myregistry.azure.io": nil, - // }, - // }, - // IsSystemTask: to.Ptr(false), - // Platform: &armcontainerregistry.PlatformProperties{ - // Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64), - // OS: to.Ptr(armcontainerregistry.OSLinux), - // }, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // Status: to.Ptr(armcontainerregistry.TaskStatusEnabled), - // Step: &armcontainerregistry.DockerBuildStep{ - // Type: to.Ptr(armcontainerregistry.StepTypeDocker), - // ContextPath: to.Ptr("src"), - // Arguments: []*armcontainerregistry.Argument{ - // { - // Name: to.Ptr("mytestargument"), - // IsSecret: to.Ptr(false), - // Value: to.Ptr("mytestvalue"), - // }}, - // DockerFilePath: to.Ptr("src/DockerFile"), - // ImageNames: []*string{ - // to.Ptr("azurerest:testtag")}, - // IsPushEnabled: to.Ptr(true), - // NoCache: to.Ptr(false), - // }, - // Trigger: &armcontainerregistry.TriggerProperties{ - // BaseImageTrigger: &armcontainerregistry.BaseImageTrigger{ - // Name: to.Ptr("myBaseImageTrigger"), - // BaseImageTriggerType: to.Ptr(armcontainerregistry.BaseImageTriggerTypeRuntime), - // Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled), - // UpdateTriggerPayloadType: to.Ptr(armcontainerregistry.UpdateTriggerPayloadTypeToken), - // }, - // SourceTriggers: []*armcontainerregistry.SourceTrigger{ - // { - // Name: to.Ptr("mySourceTrigger"), - // SourceRepository: &armcontainerregistry.SourceProperties{ - // Branch: to.Ptr("master"), - // RepositoryURL: to.Ptr("https://github.com/Azure/azure-rest-api-specs"), - // SourceControlType: to.Ptr(armcontainerregistry.SourceControlTypeGithub), - // }, - // SourceTriggerEvents: []*armcontainerregistry.SourceTriggerEvent{ - // to.Ptr(armcontainerregistry.SourceTriggerEventCommit)}, - // Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled), - // }}, - // TimerTriggers: []*armcontainerregistry.TimerTrigger{ - // { - // Name: to.Ptr("myTimerTrigger"), - // Schedule: to.Ptr("30 9 * * 1-5"), - // Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled), - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/TasksCreate.json -func ExampleTasksClient_Create_tasksCreate() { - 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.NewTasksClient().Create(ctx, "myResourceGroup", "myRegistry", "mytTask", armcontainerregistry.Task{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "testkey": to.Ptr("value"), - }, - Identity: &armcontainerregistry.IdentityProperties{ - Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssigned), - }, - Properties: &armcontainerregistry.TaskProperties{ - AgentConfiguration: &armcontainerregistry.AgentProperties{ - CPU: to.Ptr[int32](2), - }, - IsSystemTask: to.Ptr(false), - LogTemplate: to.Ptr("acr/tasks:{{.Run.OS}}"), - Platform: &armcontainerregistry.PlatformProperties{ - Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64), - OS: to.Ptr(armcontainerregistry.OSLinux), - }, - Status: to.Ptr(armcontainerregistry.TaskStatusEnabled), - Step: &armcontainerregistry.DockerBuildStep{ - Type: to.Ptr(armcontainerregistry.StepTypeDocker), - ContextPath: to.Ptr("src"), - Arguments: []*armcontainerregistry.Argument{ - { - Name: to.Ptr("mytestargument"), - IsSecret: to.Ptr(false), - Value: to.Ptr("mytestvalue"), - }, - { - Name: to.Ptr("mysecrettestargument"), - IsSecret: to.Ptr(true), - Value: to.Ptr("mysecrettestvalue"), - }}, - DockerFilePath: to.Ptr("src/DockerFile"), - ImageNames: []*string{ - to.Ptr("azurerest:testtag")}, - IsPushEnabled: to.Ptr(true), - NoCache: to.Ptr(false), - }, - Trigger: &armcontainerregistry.TriggerProperties{ - BaseImageTrigger: &armcontainerregistry.BaseImageTrigger{ - Name: to.Ptr("myBaseImageTrigger"), - BaseImageTriggerType: to.Ptr(armcontainerregistry.BaseImageTriggerTypeRuntime), - UpdateTriggerEndpoint: to.Ptr("https://user:pass@mycicd.webhook.com?token=foo"), - UpdateTriggerPayloadType: to.Ptr(armcontainerregistry.UpdateTriggerPayloadTypeToken), - }, - SourceTriggers: []*armcontainerregistry.SourceTrigger{ - { - Name: to.Ptr("mySourceTrigger"), - SourceRepository: &armcontainerregistry.SourceProperties{ - Branch: to.Ptr("master"), - RepositoryURL: to.Ptr("https://github.com/Azure/azure-rest-api-specs"), - SourceControlAuthProperties: &armcontainerregistry.AuthInfo{ - Token: to.Ptr("xxxxx"), - TokenType: to.Ptr(armcontainerregistry.TokenTypePAT), - }, - SourceControlType: to.Ptr(armcontainerregistry.SourceControlTypeGithub), - }, - SourceTriggerEvents: []*armcontainerregistry.SourceTriggerEvent{ - to.Ptr(armcontainerregistry.SourceTriggerEventCommit)}, - }}, - TimerTriggers: []*armcontainerregistry.TimerTrigger{ - { - Name: to.Ptr("myTimerTrigger"), - Schedule: to.Ptr("30 9 * * 1-5"), - }}, - }, - }, - }, 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.Task = armcontainerregistry.Task{ - // Name: to.Ptr("myTask"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/tasks"), - // ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tasks/myTask"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "testkey": to.Ptr("value"), - // }, - // Identity: &armcontainerregistry.IdentityProperties{ - // Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("fa153151-b9fd-46f4-9088-5e6600f2689v"), - // TenantID: to.Ptr("f686d426-8d16-42db-81b7-abu4gm510ccd"), - // }, - // Properties: &armcontainerregistry.TaskProperties{ - // AgentConfiguration: &armcontainerregistry.AgentProperties{ - // CPU: to.Ptr[int32](2), - // }, - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T06:54:23.536Z"); return t}()), - // IsSystemTask: to.Ptr(false), - // LogTemplate: to.Ptr("acr/tasks:{{.Run.OS}}"), - // Platform: &armcontainerregistry.PlatformProperties{ - // Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64), - // OS: to.Ptr(armcontainerregistry.OSLinux), - // }, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // Status: to.Ptr(armcontainerregistry.TaskStatusEnabled), - // Step: &armcontainerregistry.DockerBuildStep{ - // Type: to.Ptr(armcontainerregistry.StepTypeDocker), - // ContextPath: to.Ptr("src"), - // Arguments: []*armcontainerregistry.Argument{ - // { - // Name: to.Ptr("mytestargument"), - // IsSecret: to.Ptr(false), - // Value: to.Ptr("mytestvalue"), - // }}, - // DockerFilePath: to.Ptr("src/DockerFile"), - // ImageNames: []*string{ - // to.Ptr("azurerest:testtag")}, - // IsPushEnabled: to.Ptr(true), - // NoCache: to.Ptr(false), - // }, - // Trigger: &armcontainerregistry.TriggerProperties{ - // BaseImageTrigger: &armcontainerregistry.BaseImageTrigger{ - // Name: to.Ptr("myBaseImageTrigger"), - // BaseImageTriggerType: to.Ptr(armcontainerregistry.BaseImageTriggerTypeRuntime), - // Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled), - // UpdateTriggerPayloadType: to.Ptr(armcontainerregistry.UpdateTriggerPayloadTypeToken), - // }, - // SourceTriggers: []*armcontainerregistry.SourceTrigger{ - // { - // Name: to.Ptr("mySourceTrigger"), - // SourceRepository: &armcontainerregistry.SourceProperties{ - // Branch: to.Ptr("master"), - // RepositoryURL: to.Ptr("https://github.com/Azure/azure-rest-api-specs"), - // SourceControlType: to.Ptr(armcontainerregistry.SourceControlTypeGithub), - // }, - // SourceTriggerEvents: []*armcontainerregistry.SourceTriggerEvent{ - // to.Ptr(armcontainerregistry.SourceTriggerEventCommit)}, - // Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled), - // }}, - // TimerTriggers: []*armcontainerregistry.TimerTrigger{ - // { - // Name: to.Ptr("myTimerTrigger"), - // Schedule: to.Ptr("30 9 * * 1-5"), - // Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled), - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/TasksCreate_QuickTask.json -func ExampleTasksClient_Create_tasksCreateQuickTask() { - 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.NewTasksClient().Create(ctx, "myResourceGroup", "myRegistry", "quicktask", armcontainerregistry.Task{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "testkey": to.Ptr("value"), - }, - Properties: &armcontainerregistry.TaskProperties{ - IsSystemTask: to.Ptr(true), - LogTemplate: to.Ptr("acr/tasks:{{.Run.OS}}"), - Status: to.Ptr(armcontainerregistry.TaskStatusEnabled), - }, - }, 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.Task = armcontainerregistry.Task{ - // Name: to.Ptr("quicktask"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/tasks"), - // ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tasks/myTask"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "testkey": to.Ptr("value"), - // }, - // Properties: &armcontainerregistry.TaskProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T06:54:23.536Z"); return t}()), - // IsSystemTask: to.Ptr(true), - // LogTemplate: to.Ptr("acr/tasks:{{.Run.OS}}"), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // Status: to.Ptr(armcontainerregistry.TaskStatusEnabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/ManagedIdentity/TasksCreate_WithLoginIdentity.json -func ExampleTasksClient_Create_tasksCreateWithLoginIdentity() { - 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.NewTasksClient().Create(ctx, "myResourceGroup", "myRegistry", "mytTask", armcontainerregistry.Task{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "testkey": to.Ptr("value"), - }, - Identity: &armcontainerregistry.IdentityProperties{ - Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssigned), - }, - Properties: &armcontainerregistry.TaskProperties{ - AgentConfiguration: &armcontainerregistry.AgentProperties{ - CPU: to.Ptr[int32](2), - }, - Credentials: &armcontainerregistry.Credentials{ - SourceRegistry: &armcontainerregistry.SourceRegistryCredentials{ - Identity: to.Ptr("[system]"), - }, - }, - IsSystemTask: to.Ptr(false), - Platform: &armcontainerregistry.PlatformProperties{ - Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64), - OS: to.Ptr(armcontainerregistry.OSLinux), - }, - Status: to.Ptr(armcontainerregistry.TaskStatusEnabled), - Step: &armcontainerregistry.DockerBuildStep{ - Type: to.Ptr(armcontainerregistry.StepTypeDocker), - ContextPath: to.Ptr("src"), - Arguments: []*armcontainerregistry.Argument{ - { - Name: to.Ptr("mytestargument"), - IsSecret: to.Ptr(false), - Value: to.Ptr("mytestvalue"), - }, - { - Name: to.Ptr("mysecrettestargument"), - IsSecret: to.Ptr(true), - Value: to.Ptr("mysecrettestvalue"), - }}, - DockerFilePath: to.Ptr("src/DockerFile"), - ImageNames: []*string{ - to.Ptr("azurerest:testtag")}, - IsPushEnabled: to.Ptr(true), - NoCache: to.Ptr(false), - }, - Trigger: &armcontainerregistry.TriggerProperties{ - BaseImageTrigger: &armcontainerregistry.BaseImageTrigger{ - Name: to.Ptr("myBaseImageTrigger"), - BaseImageTriggerType: to.Ptr(armcontainerregistry.BaseImageTriggerTypeRuntime), - }, - SourceTriggers: []*armcontainerregistry.SourceTrigger{ - { - Name: to.Ptr("mySourceTrigger"), - SourceRepository: &armcontainerregistry.SourceProperties{ - Branch: to.Ptr("master"), - RepositoryURL: to.Ptr("https://github.com/Azure/azure-rest-api-specs"), - SourceControlAuthProperties: &armcontainerregistry.AuthInfo{ - Token: to.Ptr("xxxxx"), - TokenType: to.Ptr(armcontainerregistry.TokenTypePAT), - }, - SourceControlType: to.Ptr(armcontainerregistry.SourceControlTypeGithub), - }, - SourceTriggerEvents: []*armcontainerregistry.SourceTriggerEvent{ - to.Ptr(armcontainerregistry.SourceTriggerEventCommit)}, - }}, - TimerTriggers: []*armcontainerregistry.TimerTrigger{ - { - Name: to.Ptr("myTimerTrigger"), - Schedule: to.Ptr("30 9 * * 1-5"), - }}, - }, - }, - }, 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.Task = armcontainerregistry.Task{ - // Name: to.Ptr("myTask"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/tasks"), - // ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tasks/myTask"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "testkey": to.Ptr("value"), - // }, - // Identity: &armcontainerregistry.IdentityProperties{ - // Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("fa153151-b9fd-46f4-9088-5e6600f2689v"), - // TenantID: to.Ptr("f686d426-8d16-42db-81b7-abu4gm510ccd"), - // }, - // Properties: &armcontainerregistry.TaskProperties{ - // AgentConfiguration: &armcontainerregistry.AgentProperties{ - // CPU: to.Ptr[int32](2), - // }, - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T06:54:23.536Z"); return t}()), - // Credentials: &armcontainerregistry.Credentials{ - // SourceRegistry: &armcontainerregistry.SourceRegistryCredentials{ - // Identity: to.Ptr("[system]"), - // }, - // }, - // IsSystemTask: to.Ptr(false), - // Platform: &armcontainerregistry.PlatformProperties{ - // Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64), - // OS: to.Ptr(armcontainerregistry.OSLinux), - // }, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // Status: to.Ptr(armcontainerregistry.TaskStatusEnabled), - // Step: &armcontainerregistry.DockerBuildStep{ - // Type: to.Ptr(armcontainerregistry.StepTypeDocker), - // ContextPath: to.Ptr("src"), - // Arguments: []*armcontainerregistry.Argument{ - // { - // Name: to.Ptr("mytestargument"), - // IsSecret: to.Ptr(false), - // Value: to.Ptr("mytestvalue"), - // }}, - // DockerFilePath: to.Ptr("src/DockerFile"), - // ImageNames: []*string{ - // to.Ptr("azurerest:testtag")}, - // IsPushEnabled: to.Ptr(true), - // NoCache: to.Ptr(false), - // }, - // Trigger: &armcontainerregistry.TriggerProperties{ - // BaseImageTrigger: &armcontainerregistry.BaseImageTrigger{ - // Name: to.Ptr("myBaseImageTrigger"), - // BaseImageTriggerType: to.Ptr(armcontainerregistry.BaseImageTriggerTypeRuntime), - // Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled), - // }, - // SourceTriggers: []*armcontainerregistry.SourceTrigger{ - // { - // Name: to.Ptr("mySourceTrigger"), - // SourceRepository: &armcontainerregistry.SourceProperties{ - // Branch: to.Ptr("master"), - // RepositoryURL: to.Ptr("https://github.com/Azure/azure-rest-api-specs"), - // SourceControlType: to.Ptr(armcontainerregistry.SourceControlTypeGithub), - // }, - // SourceTriggerEvents: []*armcontainerregistry.SourceTriggerEvent{ - // to.Ptr(armcontainerregistry.SourceTriggerEventCommit)}, - // Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled), - // }}, - // TimerTriggers: []*armcontainerregistry.TimerTrigger{ - // { - // Name: to.Ptr("myTimerTrigger"), - // Schedule: to.Ptr("30 9 * * 1-5"), - // Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled), - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/ManagedIdentity/TasksCreate_WithSystemAndUserIdentities.json -func ExampleTasksClient_Create_tasksCreateWithSystemAndUserIdentities() { - 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.NewTasksClient().Create(ctx, "myResourceGroup", "myRegistry", "mytTask", armcontainerregistry.Task{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "testkey": to.Ptr("value"), - }, - Identity: &armcontainerregistry.IdentityProperties{ - Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssignedUserAssigned), - UserAssignedIdentities: map[string]*armcontainerregistry.UserIdentityProperties{ - "/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourcegroups/myResourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2": {}, - }, - }, - Properties: &armcontainerregistry.TaskProperties{ - AgentConfiguration: &armcontainerregistry.AgentProperties{ - CPU: to.Ptr[int32](2), - }, - IsSystemTask: to.Ptr(false), - Platform: &armcontainerregistry.PlatformProperties{ - Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64), - OS: to.Ptr(armcontainerregistry.OSLinux), - }, - Status: to.Ptr(armcontainerregistry.TaskStatusEnabled), - Step: &armcontainerregistry.DockerBuildStep{ - Type: to.Ptr(armcontainerregistry.StepTypeDocker), - ContextPath: to.Ptr("src"), - Arguments: []*armcontainerregistry.Argument{ - { - Name: to.Ptr("mytestargument"), - IsSecret: to.Ptr(false), - Value: to.Ptr("mytestvalue"), - }, - { - Name: to.Ptr("mysecrettestargument"), - IsSecret: to.Ptr(true), - Value: to.Ptr("mysecrettestvalue"), - }}, - DockerFilePath: to.Ptr("src/DockerFile"), - ImageNames: []*string{ - to.Ptr("azurerest:testtag")}, - IsPushEnabled: to.Ptr(true), - NoCache: to.Ptr(false), - }, - Trigger: &armcontainerregistry.TriggerProperties{ - BaseImageTrigger: &armcontainerregistry.BaseImageTrigger{ - Name: to.Ptr("myBaseImageTrigger"), - BaseImageTriggerType: to.Ptr(armcontainerregistry.BaseImageTriggerTypeRuntime), - UpdateTriggerEndpoint: to.Ptr("https://user:pass@mycicd.webhook.com?token=foo"), - UpdateTriggerPayloadType: to.Ptr(armcontainerregistry.UpdateTriggerPayloadTypeDefault), - }, - SourceTriggers: []*armcontainerregistry.SourceTrigger{ - { - Name: to.Ptr("mySourceTrigger"), - SourceRepository: &armcontainerregistry.SourceProperties{ - Branch: to.Ptr("master"), - RepositoryURL: to.Ptr("https://github.com/Azure/azure-rest-api-specs"), - SourceControlAuthProperties: &armcontainerregistry.AuthInfo{ - Token: to.Ptr("xxxxx"), - TokenType: to.Ptr(armcontainerregistry.TokenTypePAT), - }, - SourceControlType: to.Ptr(armcontainerregistry.SourceControlTypeGithub), - }, - SourceTriggerEvents: []*armcontainerregistry.SourceTriggerEvent{ - to.Ptr(armcontainerregistry.SourceTriggerEventCommit)}, - }}, - TimerTriggers: []*armcontainerregistry.TimerTrigger{ - { - Name: to.Ptr("myTimerTrigger"), - Schedule: to.Ptr("30 9 * * 1-5"), - }}, - }, - }, - }, 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.Task = armcontainerregistry.Task{ - // Name: to.Ptr("myTask"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/tasks"), - // ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tasks/myTask"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "testkey": to.Ptr("value"), - // }, - // Identity: &armcontainerregistry.IdentityProperties{ - // Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssignedUserAssigned), - // PrincipalID: to.Ptr("fc99dc67-1ad9-45c8-9ebc-e438081c8e30"), - // TenantID: to.Ptr("f686d426-8d16-42db-81b7-ab578e110ccd"), - // UserAssignedIdentities: map[string]*armcontainerregistry.UserIdentityProperties{ - // "/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourcegroups/myResourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2": &armcontainerregistry.UserIdentityProperties{ - // ClientID: to.Ptr("e35621a5-f615-4a20-940e-de8a84b15abc"), - // PrincipalID: to.Ptr("e45e3m7c-176e-416a-b466-0c5ec8298f8a"), - // }, - // }, - // }, - // Properties: &armcontainerregistry.TaskProperties{ - // AgentConfiguration: &armcontainerregistry.AgentProperties{ - // CPU: to.Ptr[int32](2), - // }, - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T06:54:23.536Z"); return t}()), - // IsSystemTask: to.Ptr(false), - // Platform: &armcontainerregistry.PlatformProperties{ - // Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64), - // OS: to.Ptr(armcontainerregistry.OSLinux), - // }, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // Status: to.Ptr(armcontainerregistry.TaskStatusEnabled), - // Step: &armcontainerregistry.DockerBuildStep{ - // Type: to.Ptr(armcontainerregistry.StepTypeDocker), - // ContextPath: to.Ptr("src"), - // Arguments: []*armcontainerregistry.Argument{ - // { - // Name: to.Ptr("mytestargument"), - // IsSecret: to.Ptr(false), - // Value: to.Ptr("mytestvalue"), - // }}, - // DockerFilePath: to.Ptr("src/DockerFile"), - // ImageNames: []*string{ - // to.Ptr("azurerest:testtag")}, - // IsPushEnabled: to.Ptr(true), - // NoCache: to.Ptr(false), - // }, - // Trigger: &armcontainerregistry.TriggerProperties{ - // BaseImageTrigger: &armcontainerregistry.BaseImageTrigger{ - // Name: to.Ptr("myBaseImageTrigger"), - // BaseImageTriggerType: to.Ptr(armcontainerregistry.BaseImageTriggerTypeRuntime), - // Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled), - // UpdateTriggerPayloadType: to.Ptr(armcontainerregistry.UpdateTriggerPayloadTypeDefault), - // }, - // SourceTriggers: []*armcontainerregistry.SourceTrigger{ - // { - // Name: to.Ptr("mySourceTrigger"), - // SourceRepository: &armcontainerregistry.SourceProperties{ - // Branch: to.Ptr("master"), - // RepositoryURL: to.Ptr("https://github.com/Azure/azure-rest-api-specs"), - // SourceControlType: to.Ptr(armcontainerregistry.SourceControlTypeGithub), - // }, - // SourceTriggerEvents: []*armcontainerregistry.SourceTriggerEvent{ - // to.Ptr(armcontainerregistry.SourceTriggerEventCommit)}, - // Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled), - // }}, - // TimerTriggers: []*armcontainerregistry.TimerTrigger{ - // { - // Name: to.Ptr("myTimerTrigger"), - // Schedule: to.Ptr("30 9 * * 1-5"), - // Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled), - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/ManagedIdentity/TasksCreate_WithUserIdentities.json -func ExampleTasksClient_Create_tasksCreateWithUserIdentities() { - 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.NewTasksClient().Create(ctx, "myResourceGroup", "myRegistry", "mytTask", armcontainerregistry.Task{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "testkey": to.Ptr("value"), - }, - 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/identity1": {}, - "/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourcegroups/myResourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2": {}, - }, - }, - Properties: &armcontainerregistry.TaskProperties{ - AgentConfiguration: &armcontainerregistry.AgentProperties{ - CPU: to.Ptr[int32](2), - }, - IsSystemTask: to.Ptr(false), - Platform: &armcontainerregistry.PlatformProperties{ - Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64), - OS: to.Ptr(armcontainerregistry.OSLinux), - }, - Status: to.Ptr(armcontainerregistry.TaskStatusEnabled), - Step: &armcontainerregistry.DockerBuildStep{ - Type: to.Ptr(armcontainerregistry.StepTypeDocker), - ContextPath: to.Ptr("src"), - Arguments: []*armcontainerregistry.Argument{ - { - Name: to.Ptr("mytestargument"), - IsSecret: to.Ptr(false), - Value: to.Ptr("mytestvalue"), - }, - { - Name: to.Ptr("mysecrettestargument"), - IsSecret: to.Ptr(true), - Value: to.Ptr("mysecrettestvalue"), - }}, - DockerFilePath: to.Ptr("src/DockerFile"), - ImageNames: []*string{ - to.Ptr("azurerest:testtag")}, - IsPushEnabled: to.Ptr(true), - NoCache: to.Ptr(false), - }, - Trigger: &armcontainerregistry.TriggerProperties{ - BaseImageTrigger: &armcontainerregistry.BaseImageTrigger{ - Name: to.Ptr("myBaseImageTrigger"), - BaseImageTriggerType: to.Ptr(armcontainerregistry.BaseImageTriggerTypeRuntime), - UpdateTriggerEndpoint: to.Ptr("https://user:pass@mycicd.webhook.com?token=foo"), - UpdateTriggerPayloadType: to.Ptr(armcontainerregistry.UpdateTriggerPayloadTypeDefault), - }, - SourceTriggers: []*armcontainerregistry.SourceTrigger{ - { - Name: to.Ptr("mySourceTrigger"), - SourceRepository: &armcontainerregistry.SourceProperties{ - Branch: to.Ptr("master"), - RepositoryURL: to.Ptr("https://github.com/Azure/azure-rest-api-specs"), - SourceControlAuthProperties: &armcontainerregistry.AuthInfo{ - Token: to.Ptr("xxxxx"), - TokenType: to.Ptr(armcontainerregistry.TokenTypePAT), - }, - SourceControlType: to.Ptr(armcontainerregistry.SourceControlTypeGithub), - }, - SourceTriggerEvents: []*armcontainerregistry.SourceTriggerEvent{ - to.Ptr(armcontainerregistry.SourceTriggerEventCommit)}, - }}, - TimerTriggers: []*armcontainerregistry.TimerTrigger{ - { - Name: to.Ptr("myTimerTrigger"), - Schedule: to.Ptr("30 9 * * 1-5"), - }}, - }, - }, - }, 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.Task = armcontainerregistry.Task{ - // Name: to.Ptr("myTask"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/tasks"), - // ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tasks/myTask"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "testkey": to.Ptr("value"), - // }, - // 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/identity1": &armcontainerregistry.UserIdentityProperties{ - // ClientID: to.Ptr("d3ce1bc2-f7d7-4a5b-9979-950f4e57680e"), - // PrincipalID: to.Ptr("b6p9f58b-6fbf-4efd-a7e0-fvd46911a466"), - // }, - // "/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourcegroups/myResourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2": &armcontainerregistry.UserIdentityProperties{ - // ClientID: to.Ptr("e35621a5-f615-4a20-940e-de8a84b15abc"), - // PrincipalID: to.Ptr("e45e3m7c-176e-416a-b466-0c5ec8298f8a"), - // }, - // }, - // }, - // Properties: &armcontainerregistry.TaskProperties{ - // AgentConfiguration: &armcontainerregistry.AgentProperties{ - // CPU: to.Ptr[int32](2), - // }, - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T06:54:23.536Z"); return t}()), - // IsSystemTask: to.Ptr(false), - // Platform: &armcontainerregistry.PlatformProperties{ - // Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64), - // OS: to.Ptr(armcontainerregistry.OSLinux), - // }, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // Status: to.Ptr(armcontainerregistry.TaskStatusEnabled), - // Step: &armcontainerregistry.DockerBuildStep{ - // Type: to.Ptr(armcontainerregistry.StepTypeDocker), - // ContextPath: to.Ptr("src"), - // Arguments: []*armcontainerregistry.Argument{ - // { - // Name: to.Ptr("mytestargument"), - // IsSecret: to.Ptr(false), - // Value: to.Ptr("mytestvalue"), - // }}, - // DockerFilePath: to.Ptr("src/DockerFile"), - // ImageNames: []*string{ - // to.Ptr("azurerest:testtag")}, - // IsPushEnabled: to.Ptr(true), - // NoCache: to.Ptr(false), - // }, - // Trigger: &armcontainerregistry.TriggerProperties{ - // BaseImageTrigger: &armcontainerregistry.BaseImageTrigger{ - // Name: to.Ptr("myBaseImageTrigger"), - // BaseImageTriggerType: to.Ptr(armcontainerregistry.BaseImageTriggerTypeRuntime), - // Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled), - // UpdateTriggerPayloadType: to.Ptr(armcontainerregistry.UpdateTriggerPayloadTypeDefault), - // }, - // SourceTriggers: []*armcontainerregistry.SourceTrigger{ - // { - // Name: to.Ptr("mySourceTrigger"), - // SourceRepository: &armcontainerregistry.SourceProperties{ - // Branch: to.Ptr("master"), - // RepositoryURL: to.Ptr("https://github.com/Azure/azure-rest-api-specs"), - // SourceControlType: to.Ptr(armcontainerregistry.SourceControlTypeGithub), - // }, - // SourceTriggerEvents: []*armcontainerregistry.SourceTriggerEvent{ - // to.Ptr(armcontainerregistry.SourceTriggerEventCommit)}, - // Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled), - // }}, - // TimerTriggers: []*armcontainerregistry.TimerTrigger{ - // { - // Name: to.Ptr("myTimerTrigger"), - // Schedule: to.Ptr("30 9 * * 1-5"), - // Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled), - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/ManagedIdentity/TasksCreate_WithSystemIdentity.json -func ExampleTasksClient_Create_tasksCreateWithUserIdentitiesWithSystemIdentity() { - 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.NewTasksClient().Create(ctx, "myResourceGroup", "myRegistry", "mytTask", armcontainerregistry.Task{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "testkey": to.Ptr("value"), - }, - Identity: &armcontainerregistry.IdentityProperties{ - Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssigned), - }, - Properties: &armcontainerregistry.TaskProperties{ - AgentConfiguration: &armcontainerregistry.AgentProperties{ - CPU: to.Ptr[int32](2), - }, - IsSystemTask: to.Ptr(false), - Platform: &armcontainerregistry.PlatformProperties{ - Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64), - OS: to.Ptr(armcontainerregistry.OSLinux), - }, - Status: to.Ptr(armcontainerregistry.TaskStatusEnabled), - Step: &armcontainerregistry.DockerBuildStep{ - Type: to.Ptr(armcontainerregistry.StepTypeDocker), - ContextPath: to.Ptr("src"), - Arguments: []*armcontainerregistry.Argument{ - { - Name: to.Ptr("mytestargument"), - IsSecret: to.Ptr(false), - Value: to.Ptr("mytestvalue"), - }, - { - Name: to.Ptr("mysecrettestargument"), - IsSecret: to.Ptr(true), - Value: to.Ptr("mysecrettestvalue"), - }}, - DockerFilePath: to.Ptr("src/DockerFile"), - ImageNames: []*string{ - to.Ptr("azurerest:testtag")}, - IsPushEnabled: to.Ptr(true), - NoCache: to.Ptr(false), - }, - Trigger: &armcontainerregistry.TriggerProperties{ - BaseImageTrigger: &armcontainerregistry.BaseImageTrigger{ - Name: to.Ptr("myBaseImageTrigger"), - BaseImageTriggerType: to.Ptr(armcontainerregistry.BaseImageTriggerTypeRuntime), - }, - SourceTriggers: []*armcontainerregistry.SourceTrigger{ - { - Name: to.Ptr("mySourceTrigger"), - SourceRepository: &armcontainerregistry.SourceProperties{ - Branch: to.Ptr("master"), - RepositoryURL: to.Ptr("https://github.com/Azure/azure-rest-api-specs"), - SourceControlAuthProperties: &armcontainerregistry.AuthInfo{ - Token: to.Ptr("xxxxx"), - TokenType: to.Ptr(armcontainerregistry.TokenTypePAT), - }, - SourceControlType: to.Ptr(armcontainerregistry.SourceControlTypeGithub), - }, - SourceTriggerEvents: []*armcontainerregistry.SourceTriggerEvent{ - to.Ptr(armcontainerregistry.SourceTriggerEventCommit)}, - }}, - TimerTriggers: []*armcontainerregistry.TimerTrigger{ - { - Name: to.Ptr("myTimerTrigger"), - Schedule: to.Ptr("30 9 * * 1-5"), - }}, - }, - }, - }, 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.Task = armcontainerregistry.Task{ - // Name: to.Ptr("myTask"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/tasks"), - // ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tasks/myTask"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "testkey": to.Ptr("value"), - // }, - // Identity: &armcontainerregistry.IdentityProperties{ - // Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("fa153151-b9fd-46f4-9088-5e6600f2689v"), - // TenantID: to.Ptr("f686d426-8d16-42db-81b7-abu4gm510ccd"), - // }, - // Properties: &armcontainerregistry.TaskProperties{ - // AgentConfiguration: &armcontainerregistry.AgentProperties{ - // CPU: to.Ptr[int32](2), - // }, - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T06:54:23.536Z"); return t}()), - // IsSystemTask: to.Ptr(false), - // Platform: &armcontainerregistry.PlatformProperties{ - // Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64), - // OS: to.Ptr(armcontainerregistry.OSLinux), - // }, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // Status: to.Ptr(armcontainerregistry.TaskStatusEnabled), - // Step: &armcontainerregistry.DockerBuildStep{ - // Type: to.Ptr(armcontainerregistry.StepTypeDocker), - // ContextPath: to.Ptr("src"), - // Arguments: []*armcontainerregistry.Argument{ - // { - // Name: to.Ptr("mytestargument"), - // IsSecret: to.Ptr(false), - // Value: to.Ptr("mytestvalue"), - // }}, - // DockerFilePath: to.Ptr("src/DockerFile"), - // ImageNames: []*string{ - // to.Ptr("azurerest:testtag")}, - // IsPushEnabled: to.Ptr(true), - // NoCache: to.Ptr(false), - // }, - // Trigger: &armcontainerregistry.TriggerProperties{ - // BaseImageTrigger: &armcontainerregistry.BaseImageTrigger{ - // Name: to.Ptr("myBaseImageTrigger"), - // BaseImageTriggerType: to.Ptr(armcontainerregistry.BaseImageTriggerTypeRuntime), - // Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled), - // }, - // SourceTriggers: []*armcontainerregistry.SourceTrigger{ - // { - // Name: to.Ptr("mySourceTrigger"), - // SourceRepository: &armcontainerregistry.SourceProperties{ - // Branch: to.Ptr("master"), - // RepositoryURL: to.Ptr("https://github.com/Azure/azure-rest-api-specs"), - // SourceControlType: to.Ptr(armcontainerregistry.SourceControlTypeGithub), - // }, - // SourceTriggerEvents: []*armcontainerregistry.SourceTriggerEvent{ - // to.Ptr(armcontainerregistry.SourceTriggerEventCommit)}, - // Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled), - // }}, - // TimerTriggers: []*armcontainerregistry.TimerTrigger{ - // { - // Name: to.Ptr("myTimerTrigger"), - // Schedule: to.Ptr("30 9 * * 1-5"), - // Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled), - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/TasksDelete.json -func ExampleTasksClient_Delete() { - 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) - } - _, err = clientFactory.NewTasksClient().Delete(ctx, "myResourceGroup", "myRegistry", "myTask", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/TasksUpdate.json -func ExampleTasksClient_Update_tasksUpdate() { - 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.NewTasksClient().Update(ctx, "myResourceGroup", "myRegistry", "myTask", armcontainerregistry.TaskUpdateParameters{ - Properties: &armcontainerregistry.TaskPropertiesUpdateParameters{ - AgentConfiguration: &armcontainerregistry.AgentProperties{ - CPU: to.Ptr[int32](3), - }, - Credentials: &armcontainerregistry.Credentials{ - CustomRegistries: map[string]*armcontainerregistry.CustomRegistryCredentials{ - "myregistry.azurecr.io": { - Identity: to.Ptr("[system]"), - Password: &armcontainerregistry.SecretObject{ - Type: to.Ptr(armcontainerregistry.SecretObjectTypeVaultsecret), - Value: to.Ptr("https://myacbvault.vault.azure.net/secrets/password"), - }, - UserName: &armcontainerregistry.SecretObject{ - Type: to.Ptr(armcontainerregistry.SecretObjectTypeOpaque), - Value: to.Ptr("username"), - }, - }, - }, - }, - LogTemplate: to.Ptr("acr/tasks:{{.Run.OS}}"), - Status: to.Ptr(armcontainerregistry.TaskStatusEnabled), - Step: &armcontainerregistry.DockerBuildStepUpdateParameters{ - Type: to.Ptr(armcontainerregistry.StepTypeDocker), - DockerFilePath: to.Ptr("src/DockerFile"), - ImageNames: []*string{ - to.Ptr("azurerest:testtag1")}, - }, - Trigger: &armcontainerregistry.TriggerUpdateParameters{ - SourceTriggers: []*armcontainerregistry.SourceTriggerUpdateParameters{ - { - Name: to.Ptr("mySourceTrigger"), - SourceRepository: &armcontainerregistry.SourceUpdateParameters{ - SourceControlAuthProperties: &armcontainerregistry.AuthInfoUpdateParameters{ - Token: to.Ptr("xxxxx"), - TokenType: to.Ptr(armcontainerregistry.TokenTypePAT), - }, - }, - SourceTriggerEvents: []*armcontainerregistry.SourceTriggerEvent{ - to.Ptr(armcontainerregistry.SourceTriggerEventCommit)}, - }}, - }, - }, - Tags: map[string]*string{ - "testkey": to.Ptr("value"), - }, - }, 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.Task = armcontainerregistry.Task{ - // Name: to.Ptr("myTask"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/tasks"), - // ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tasks/myTask"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "testkey": to.Ptr("value"), - // }, - // Identity: &armcontainerregistry.IdentityProperties{ - // Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("fa153151-b9fd-46f4-9088-5e6600f2689v"), - // TenantID: to.Ptr("f686d426-8d16-42db-81b7-abu4gm510ccd"), - // }, - // Properties: &armcontainerregistry.TaskProperties{ - // AgentConfiguration: &armcontainerregistry.AgentProperties{ - // CPU: to.Ptr[int32](3), - // }, - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T06:54:23.536Z"); return t}()), - // Credentials: &armcontainerregistry.Credentials{ - // CustomRegistries: map[string]*armcontainerregistry.CustomRegistryCredentials{ - // "myregistry.azurecr.io": nil, - // }, - // }, - // LogTemplate: to.Ptr("acr/tasks:{{.Run.OS}}"), - // Platform: &armcontainerregistry.PlatformProperties{ - // Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64), - // OS: to.Ptr(armcontainerregistry.OSLinux), - // }, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // Status: to.Ptr(armcontainerregistry.TaskStatusEnabled), - // Step: &armcontainerregistry.DockerBuildStep{ - // Type: to.Ptr(armcontainerregistry.StepTypeDocker), - // ContextPath: to.Ptr("src"), - // Arguments: []*armcontainerregistry.Argument{ - // { - // Name: to.Ptr("mytestargument"), - // IsSecret: to.Ptr(false), - // Value: to.Ptr("mytestvalue"), - // }}, - // DockerFilePath: to.Ptr("src/DockerFile"), - // ImageNames: []*string{ - // to.Ptr("azurerest:testtag1")}, - // IsPushEnabled: to.Ptr(true), - // NoCache: to.Ptr(false), - // }, - // Trigger: &armcontainerregistry.TriggerProperties{ - // BaseImageTrigger: &armcontainerregistry.BaseImageTrigger{ - // Name: to.Ptr("myBaseImageTrigger"), - // BaseImageTriggerType: to.Ptr(armcontainerregistry.BaseImageTriggerTypeRuntime), - // Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled), - // UpdateTriggerPayloadType: to.Ptr(armcontainerregistry.UpdateTriggerPayloadTypeDefault), - // }, - // SourceTriggers: []*armcontainerregistry.SourceTrigger{ - // { - // Name: to.Ptr("mySourceTrigger"), - // SourceRepository: &armcontainerregistry.SourceProperties{ - // Branch: to.Ptr("master"), - // RepositoryURL: to.Ptr("https://github.com/Azure/azure-rest-api-specs"), - // SourceControlType: to.Ptr(armcontainerregistry.SourceControlTypeGithub), - // }, - // SourceTriggerEvents: []*armcontainerregistry.SourceTriggerEvent{ - // to.Ptr(armcontainerregistry.SourceTriggerEventCommit)}, - // Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled), - // }}, - // TimerTriggers: []*armcontainerregistry.TimerTrigger{ - // { - // Name: to.Ptr("myTimerTrigger"), - // Schedule: to.Ptr("30 9 * * 1-5"), - // Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled), - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/TasksUpdate_QuickTask.json -func ExampleTasksClient_Update_tasksUpdateQuickTask() { - 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.NewTasksClient().Update(ctx, "myResourceGroup", "myRegistry", "quicktask", armcontainerregistry.TaskUpdateParameters{ - Properties: &armcontainerregistry.TaskPropertiesUpdateParameters{ - LogTemplate: to.Ptr("acr/tasks:{{.Run.OS}}"), - Status: to.Ptr(armcontainerregistry.TaskStatusEnabled), - }, - Tags: map[string]*string{ - "testkey": to.Ptr("value"), - }, - }, 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.Task = armcontainerregistry.Task{ - // Name: to.Ptr("myTask"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/tasks"), - // ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tasks/myTask"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "testkey": to.Ptr("value"), - // }, - // Properties: &armcontainerregistry.TaskProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T06:54:23.536Z"); return t}()), - // LogTemplate: to.Ptr("acr/tasks:{{.Run.OS}}"), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // Status: to.Ptr(armcontainerregistry.TaskStatusEnabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/ManagedIdentity/TasksUpdate_WithKeyVaultCustomCredentials.json -func ExampleTasksClient_Update_tasksUpdateWithKeyVaultCustomCredentials() { - 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.NewTasksClient().Update(ctx, "myResourceGroup", "myRegistry", "myTask", armcontainerregistry.TaskUpdateParameters{ - Properties: &armcontainerregistry.TaskPropertiesUpdateParameters{ - AgentConfiguration: &armcontainerregistry.AgentProperties{ - CPU: to.Ptr[int32](3), - }, - Credentials: &armcontainerregistry.Credentials{ - CustomRegistries: map[string]*armcontainerregistry.CustomRegistryCredentials{ - "myregistry.azurecr.io": { - Identity: to.Ptr("[system]"), - Password: &armcontainerregistry.SecretObject{ - Type: to.Ptr(armcontainerregistry.SecretObjectTypeVaultsecret), - Value: to.Ptr("https://myacbvault.vault.azure.net/secrets/password"), - }, - UserName: &armcontainerregistry.SecretObject{ - Type: to.Ptr(armcontainerregistry.SecretObjectTypeVaultsecret), - Value: to.Ptr("https://myacbvault.vault.azure.net/secrets/username"), - }, - }, - }, - }, - Status: to.Ptr(armcontainerregistry.TaskStatusEnabled), - Step: &armcontainerregistry.DockerBuildStepUpdateParameters{ - Type: to.Ptr(armcontainerregistry.StepTypeDocker), - DockerFilePath: to.Ptr("src/DockerFile"), - ImageNames: []*string{ - to.Ptr("azurerest:testtag1")}, - }, - Trigger: &armcontainerregistry.TriggerUpdateParameters{ - SourceTriggers: []*armcontainerregistry.SourceTriggerUpdateParameters{ - { - Name: to.Ptr("mySourceTrigger"), - SourceRepository: &armcontainerregistry.SourceUpdateParameters{ - SourceControlAuthProperties: &armcontainerregistry.AuthInfoUpdateParameters{ - Token: to.Ptr("xxxxx"), - TokenType: to.Ptr(armcontainerregistry.TokenTypePAT), - }, - }, - SourceTriggerEvents: []*armcontainerregistry.SourceTriggerEvent{ - to.Ptr(armcontainerregistry.SourceTriggerEventCommit)}, - }}, - }, - }, - Tags: map[string]*string{ - "testkey": to.Ptr("value"), - }, - }, 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.Task = armcontainerregistry.Task{ - // Name: to.Ptr("myTask"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/tasks"), - // ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tasks/myTask"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "testkey": to.Ptr("value"), - // }, - // Identity: &armcontainerregistry.IdentityProperties{ - // Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("fa153151-b9fd-46f4-9088-5e6600f2689v"), - // TenantID: to.Ptr("f686d426-8d16-42db-81b7-abu4gm510ccd"), - // }, - // Properties: &armcontainerregistry.TaskProperties{ - // AgentConfiguration: &armcontainerregistry.AgentProperties{ - // CPU: to.Ptr[int32](3), - // }, - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T06:54:23.536Z"); return t}()), - // Credentials: &armcontainerregistry.Credentials{ - // CustomRegistries: map[string]*armcontainerregistry.CustomRegistryCredentials{ - // "myregistry.azurecr.io": nil, - // }, - // }, - // Platform: &armcontainerregistry.PlatformProperties{ - // Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64), - // OS: to.Ptr(armcontainerregistry.OSLinux), - // }, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // Status: to.Ptr(armcontainerregistry.TaskStatusEnabled), - // Step: &armcontainerregistry.DockerBuildStep{ - // Type: to.Ptr(armcontainerregistry.StepTypeDocker), - // ContextPath: to.Ptr("src"), - // Arguments: []*armcontainerregistry.Argument{ - // { - // Name: to.Ptr("mytestargument"), - // IsSecret: to.Ptr(false), - // Value: to.Ptr("mytestvalue"), - // }}, - // DockerFilePath: to.Ptr("src/DockerFile"), - // ImageNames: []*string{ - // to.Ptr("azurerest:testtag1")}, - // IsPushEnabled: to.Ptr(true), - // NoCache: to.Ptr(false), - // }, - // Trigger: &armcontainerregistry.TriggerProperties{ - // BaseImageTrigger: &armcontainerregistry.BaseImageTrigger{ - // Name: to.Ptr("myBaseImageTrigger"), - // BaseImageTriggerType: to.Ptr(armcontainerregistry.BaseImageTriggerTypeRuntime), - // Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled), - // UpdateTriggerEndpoint: to.Ptr("https://user:pass@mycicd.webhook.com?token=foo"), - // UpdateTriggerPayloadType: to.Ptr(armcontainerregistry.UpdateTriggerPayloadTypeToken), - // }, - // SourceTriggers: []*armcontainerregistry.SourceTrigger{ - // { - // Name: to.Ptr("mySourceTrigger"), - // SourceRepository: &armcontainerregistry.SourceProperties{ - // Branch: to.Ptr("master"), - // RepositoryURL: to.Ptr("https://github.com/Azure/azure-rest-api-specs"), - // SourceControlType: to.Ptr(armcontainerregistry.SourceControlTypeGithub), - // }, - // SourceTriggerEvents: []*armcontainerregistry.SourceTriggerEvent{ - // to.Ptr(armcontainerregistry.SourceTriggerEventCommit)}, - // Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled), - // }}, - // TimerTriggers: []*armcontainerregistry.TimerTrigger{ - // { - // Name: to.Ptr("myTimerTrigger"), - // Schedule: to.Ptr("30 9 * * 1-5"), - // Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled), - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/ManagedIdentity/TasksUpdate_WithLoginIdentity.json -func ExampleTasksClient_Update_tasksUpdateWithLoginIdentity() { - 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.NewTasksClient().Update(ctx, "myResourceGroup", "myRegistry", "myTask", armcontainerregistry.TaskUpdateParameters{ - Properties: &armcontainerregistry.TaskPropertiesUpdateParameters{ - AgentConfiguration: &armcontainerregistry.AgentProperties{ - CPU: to.Ptr[int32](3), - }, - Credentials: &armcontainerregistry.Credentials{ - SourceRegistry: &armcontainerregistry.SourceRegistryCredentials{ - Identity: to.Ptr("[system]"), - }, - }, - Status: to.Ptr(armcontainerregistry.TaskStatusEnabled), - Step: &armcontainerregistry.DockerBuildStepUpdateParameters{ - Type: to.Ptr(armcontainerregistry.StepTypeDocker), - DockerFilePath: to.Ptr("src/DockerFile"), - ImageNames: []*string{ - to.Ptr("azurerest:testtag1")}, - }, - Trigger: &armcontainerregistry.TriggerUpdateParameters{ - SourceTriggers: []*armcontainerregistry.SourceTriggerUpdateParameters{ - { - Name: to.Ptr("mySourceTrigger"), - SourceRepository: &armcontainerregistry.SourceUpdateParameters{ - SourceControlAuthProperties: &armcontainerregistry.AuthInfoUpdateParameters{ - Token: to.Ptr("xxxxx"), - TokenType: to.Ptr(armcontainerregistry.TokenTypePAT), - }, - }, - SourceTriggerEvents: []*armcontainerregistry.SourceTriggerEvent{ - to.Ptr(armcontainerregistry.SourceTriggerEventCommit)}, - }}, - }, - }, - Tags: map[string]*string{ - "testkey": to.Ptr("value"), - }, - }, 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.Task = armcontainerregistry.Task{ - // Name: to.Ptr("myTask"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/tasks"), - // ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tasks/myTask"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "testkey": to.Ptr("value"), - // }, - // Identity: &armcontainerregistry.IdentityProperties{ - // Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("fa153151-b9fd-46f4-9088-5e6600f2689v"), - // TenantID: to.Ptr("f686d426-8d16-42db-81b7-abu4gm510ccd"), - // }, - // Properties: &armcontainerregistry.TaskProperties{ - // AgentConfiguration: &armcontainerregistry.AgentProperties{ - // CPU: to.Ptr[int32](3), - // }, - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T06:54:23.536Z"); return t}()), - // Credentials: &armcontainerregistry.Credentials{ - // SourceRegistry: &armcontainerregistry.SourceRegistryCredentials{ - // Identity: to.Ptr("[system]"), - // }, - // }, - // Platform: &armcontainerregistry.PlatformProperties{ - // Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64), - // OS: to.Ptr(armcontainerregistry.OSLinux), - // }, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // Status: to.Ptr(armcontainerregistry.TaskStatusEnabled), - // Step: &armcontainerregistry.DockerBuildStep{ - // Type: to.Ptr(armcontainerregistry.StepTypeDocker), - // ContextPath: to.Ptr("src"), - // Arguments: []*armcontainerregistry.Argument{ - // { - // Name: to.Ptr("mytestargument"), - // IsSecret: to.Ptr(false), - // Value: to.Ptr("mytestvalue"), - // }}, - // DockerFilePath: to.Ptr("src/DockerFile"), - // ImageNames: []*string{ - // to.Ptr("azurerest:testtag1")}, - // IsPushEnabled: to.Ptr(true), - // NoCache: to.Ptr(false), - // }, - // Trigger: &armcontainerregistry.TriggerProperties{ - // BaseImageTrigger: &armcontainerregistry.BaseImageTrigger{ - // Name: to.Ptr("myBaseImageTrigger"), - // BaseImageTriggerType: to.Ptr(armcontainerregistry.BaseImageTriggerTypeRuntime), - // Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled), - // }, - // SourceTriggers: []*armcontainerregistry.SourceTrigger{ - // { - // Name: to.Ptr("mySourceTrigger"), - // SourceRepository: &armcontainerregistry.SourceProperties{ - // Branch: to.Ptr("master"), - // RepositoryURL: to.Ptr("https://github.com/Azure/azure-rest-api-specs"), - // SourceControlType: to.Ptr(armcontainerregistry.SourceControlTypeGithub), - // }, - // SourceTriggerEvents: []*armcontainerregistry.SourceTriggerEvent{ - // to.Ptr(armcontainerregistry.SourceTriggerEventCommit)}, - // Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled), - // }}, - // TimerTriggers: []*armcontainerregistry.TimerTrigger{ - // { - // Name: to.Ptr("myTimerTrigger"), - // Schedule: to.Ptr("30 9 * * 1-5"), - // Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled), - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/ManagedIdentity/TasksUpdate_WithMSICustomCredentials.json -func ExampleTasksClient_Update_tasksUpdateWithMsiCustomCredentials() { - 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.NewTasksClient().Update(ctx, "myResourceGroup", "myRegistry", "myTask", armcontainerregistry.TaskUpdateParameters{ - Properties: &armcontainerregistry.TaskPropertiesUpdateParameters{ - AgentConfiguration: &armcontainerregistry.AgentProperties{ - CPU: to.Ptr[int32](3), - }, - Credentials: &armcontainerregistry.Credentials{ - CustomRegistries: map[string]*armcontainerregistry.CustomRegistryCredentials{ - "myregistry.azurecr.io": { - Identity: to.Ptr("[system]"), - }, - }, - }, - Status: to.Ptr(armcontainerregistry.TaskStatusEnabled), - Step: &armcontainerregistry.DockerBuildStepUpdateParameters{ - Type: to.Ptr(armcontainerregistry.StepTypeDocker), - DockerFilePath: to.Ptr("src/DockerFile"), - ImageNames: []*string{ - to.Ptr("azurerest:testtag1")}, - }, - Trigger: &armcontainerregistry.TriggerUpdateParameters{ - SourceTriggers: []*armcontainerregistry.SourceTriggerUpdateParameters{ - { - Name: to.Ptr("mySourceTrigger"), - SourceRepository: &armcontainerregistry.SourceUpdateParameters{ - SourceControlAuthProperties: &armcontainerregistry.AuthInfoUpdateParameters{ - Token: to.Ptr("xxxxx"), - TokenType: to.Ptr(armcontainerregistry.TokenTypePAT), - }, - }, - SourceTriggerEvents: []*armcontainerregistry.SourceTriggerEvent{ - to.Ptr(armcontainerregistry.SourceTriggerEventCommit)}, - }}, - }, - }, - Tags: map[string]*string{ - "testkey": to.Ptr("value"), - }, - }, 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.Task = armcontainerregistry.Task{ - // Name: to.Ptr("myTask"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/tasks"), - // ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tasks/myTask"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "testkey": to.Ptr("value"), - // }, - // Identity: &armcontainerregistry.IdentityProperties{ - // Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("fa153151-b9fd-46f4-9088-5e6600f2689v"), - // TenantID: to.Ptr("f686d426-8d16-42db-81b7-abu4gm510ccd"), - // }, - // Properties: &armcontainerregistry.TaskProperties{ - // AgentConfiguration: &armcontainerregistry.AgentProperties{ - // CPU: to.Ptr[int32](3), - // }, - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T06:54:23.536Z"); return t}()), - // Credentials: &armcontainerregistry.Credentials{ - // CustomRegistries: map[string]*armcontainerregistry.CustomRegistryCredentials{ - // "myregistry.azure.io": nil, - // }, - // }, - // Platform: &armcontainerregistry.PlatformProperties{ - // Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64), - // OS: to.Ptr(armcontainerregistry.OSLinux), - // }, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // Status: to.Ptr(armcontainerregistry.TaskStatusEnabled), - // Step: &armcontainerregistry.DockerBuildStep{ - // Type: to.Ptr(armcontainerregistry.StepTypeDocker), - // ContextPath: to.Ptr("src"), - // Arguments: []*armcontainerregistry.Argument{ - // { - // Name: to.Ptr("mytestargument"), - // IsSecret: to.Ptr(false), - // Value: to.Ptr("mytestvalue"), - // }}, - // DockerFilePath: to.Ptr("src/DockerFile"), - // ImageNames: []*string{ - // to.Ptr("azurerest:testtag1")}, - // IsPushEnabled: to.Ptr(true), - // NoCache: to.Ptr(false), - // }, - // Trigger: &armcontainerregistry.TriggerProperties{ - // BaseImageTrigger: &armcontainerregistry.BaseImageTrigger{ - // Name: to.Ptr("myBaseImageTrigger"), - // BaseImageTriggerType: to.Ptr(armcontainerregistry.BaseImageTriggerTypeRuntime), - // Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled), - // }, - // SourceTriggers: []*armcontainerregistry.SourceTrigger{ - // { - // Name: to.Ptr("mySourceTrigger"), - // SourceRepository: &armcontainerregistry.SourceProperties{ - // Branch: to.Ptr("master"), - // RepositoryURL: to.Ptr("https://github.com/Azure/azure-rest-api-specs"), - // SourceControlType: to.Ptr(armcontainerregistry.SourceControlTypeGithub), - // }, - // SourceTriggerEvents: []*armcontainerregistry.SourceTriggerEvent{ - // to.Ptr(armcontainerregistry.SourceTriggerEventCommit)}, - // Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled), - // }}, - // TimerTriggers: []*armcontainerregistry.TimerTrigger{ - // { - // Name: to.Ptr("myTimerTrigger"), - // Schedule: to.Ptr("30 9 * * 1-5"), - // Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled), - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/TasksUpdate_WithOpaqueCustomCredentials.json -func ExampleTasksClient_Update_tasksUpdateWithOpaqueCustomCredentials() { - 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.NewTasksClient().Update(ctx, "myResourceGroup", "myRegistry", "myTask", armcontainerregistry.TaskUpdateParameters{ - Properties: &armcontainerregistry.TaskPropertiesUpdateParameters{ - AgentConfiguration: &armcontainerregistry.AgentProperties{ - CPU: to.Ptr[int32](3), - }, - Credentials: &armcontainerregistry.Credentials{ - CustomRegistries: map[string]*armcontainerregistry.CustomRegistryCredentials{ - "myregistry.azurecr.io": { - Password: &armcontainerregistry.SecretObject{ - Type: to.Ptr(armcontainerregistry.SecretObjectTypeOpaque), - Value: to.Ptr("***"), - }, - UserName: &armcontainerregistry.SecretObject{ - Type: to.Ptr(armcontainerregistry.SecretObjectTypeOpaque), - Value: to.Ptr("username"), - }, - }, - }, - }, - Status: to.Ptr(armcontainerregistry.TaskStatusEnabled), - Step: &armcontainerregistry.DockerBuildStepUpdateParameters{ - Type: to.Ptr(armcontainerregistry.StepTypeDocker), - DockerFilePath: to.Ptr("src/DockerFile"), - ImageNames: []*string{ - to.Ptr("azurerest:testtag1")}, - }, - Trigger: &armcontainerregistry.TriggerUpdateParameters{ - SourceTriggers: []*armcontainerregistry.SourceTriggerUpdateParameters{ - { - Name: to.Ptr("mySourceTrigger"), - SourceRepository: &armcontainerregistry.SourceUpdateParameters{ - SourceControlAuthProperties: &armcontainerregistry.AuthInfoUpdateParameters{ - Token: to.Ptr("xxxxx"), - TokenType: to.Ptr(armcontainerregistry.TokenTypePAT), - }, - }, - SourceTriggerEvents: []*armcontainerregistry.SourceTriggerEvent{ - to.Ptr(armcontainerregistry.SourceTriggerEventCommit)}, - }}, - }, - }, - Tags: map[string]*string{ - "testkey": to.Ptr("value"), - }, - }, 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.Task = armcontainerregistry.Task{ - // Name: to.Ptr("myTask"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/tasks"), - // ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tasks/myTask"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "testkey": to.Ptr("value"), - // }, - // Identity: &armcontainerregistry.IdentityProperties{ - // Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("fa153151-b9fd-46f4-9088-5e6600f2689v"), - // TenantID: to.Ptr("f686d426-8d16-42db-81b7-abu4gm510ccd"), - // }, - // Properties: &armcontainerregistry.TaskProperties{ - // AgentConfiguration: &armcontainerregistry.AgentProperties{ - // CPU: to.Ptr[int32](3), - // }, - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T06:54:23.536Z"); return t}()), - // Credentials: &armcontainerregistry.Credentials{ - // CustomRegistries: map[string]*armcontainerregistry.CustomRegistryCredentials{ - // "myregistry.azure.io": nil, - // }, - // }, - // Platform: &armcontainerregistry.PlatformProperties{ - // Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64), - // OS: to.Ptr(armcontainerregistry.OSLinux), - // }, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // Status: to.Ptr(armcontainerregistry.TaskStatusEnabled), - // Step: &armcontainerregistry.DockerBuildStep{ - // Type: to.Ptr(armcontainerregistry.StepTypeDocker), - // ContextPath: to.Ptr("src"), - // Arguments: []*armcontainerregistry.Argument{ - // { - // Name: to.Ptr("mytestargument"), - // IsSecret: to.Ptr(false), - // Value: to.Ptr("mytestvalue"), - // }}, - // DockerFilePath: to.Ptr("src/DockerFile"), - // ImageNames: []*string{ - // to.Ptr("azurerest:testtag1")}, - // IsPushEnabled: to.Ptr(true), - // NoCache: to.Ptr(false), - // }, - // Trigger: &armcontainerregistry.TriggerProperties{ - // BaseImageTrigger: &armcontainerregistry.BaseImageTrigger{ - // Name: to.Ptr("myBaseImageTrigger"), - // BaseImageTriggerType: to.Ptr(armcontainerregistry.BaseImageTriggerTypeRuntime), - // Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled), - // }, - // SourceTriggers: []*armcontainerregistry.SourceTrigger{ - // { - // Name: to.Ptr("mySourceTrigger"), - // SourceRepository: &armcontainerregistry.SourceProperties{ - // Branch: to.Ptr("master"), - // RepositoryURL: to.Ptr("https://github.com/Azure/azure-rest-api-specs"), - // SourceControlType: to.Ptr(armcontainerregistry.SourceControlTypeGithub), - // }, - // SourceTriggerEvents: []*armcontainerregistry.SourceTriggerEvent{ - // to.Ptr(armcontainerregistry.SourceTriggerEventCommit)}, - // Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled), - // }}, - // TimerTriggers: []*armcontainerregistry.TimerTrigger{ - // { - // Name: to.Ptr("myTimerTrigger"), - // Schedule: to.Ptr("30 9 * * 1-5"), - // Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled), - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/TasksGetDetails.json -func ExampleTasksClient_GetDetails() { - 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.NewTasksClient().GetDetails(ctx, "myResourceGroup", "myRegistry", "myTask", 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.Task = armcontainerregistry.Task{ - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "testkey": to.Ptr("value"), - // }, - // Identity: &armcontainerregistry.IdentityProperties{ - // Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("fa153151-b9fd-46f4-9088-5e6600f2689v"), - // TenantID: to.Ptr("f686d426-8d16-42db-81b7-abu4gm510ccd"), - // }, - // Properties: &armcontainerregistry.TaskProperties{ - // AgentConfiguration: &armcontainerregistry.AgentProperties{ - // CPU: to.Ptr[int32](2), - // }, - // Credentials: &armcontainerregistry.Credentials{ - // CustomRegistries: map[string]*armcontainerregistry.CustomRegistryCredentials{ - // "myregistry.azure-test.io": &armcontainerregistry.CustomRegistryCredentials{ - // Identity: to.Ptr("[system]"), - // Password: &armcontainerregistry.SecretObject{ - // Type: to.Ptr(armcontainerregistry.SecretObjectTypeVaultsecret), - // Value: to.Ptr("https://myacbvault.vault.azure.net/secrets/username"), - // }, - // UserName: &armcontainerregistry.SecretObject{ - // Type: to.Ptr(armcontainerregistry.SecretObjectTypeOpaque), - // Value: to.Ptr("username"), - // }, - // }, - // }, - // }, - // IsSystemTask: to.Ptr(false), - // Platform: &armcontainerregistry.PlatformProperties{ - // Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64), - // OS: to.Ptr(armcontainerregistry.OSLinux), - // }, - // Status: to.Ptr(armcontainerregistry.TaskStatusEnabled), - // Step: &armcontainerregistry.DockerBuildStep{ - // Type: to.Ptr(armcontainerregistry.StepTypeDocker), - // ContextPath: to.Ptr("src"), - // Arguments: []*armcontainerregistry.Argument{ - // { - // Name: to.Ptr("mytestargument"), - // IsSecret: to.Ptr(false), - // Value: to.Ptr("mytestvalue"), - // }, - // { - // Name: to.Ptr("mysecrettestargument"), - // IsSecret: to.Ptr(true), - // Value: to.Ptr("mysecrettestvalue"), - // }}, - // DockerFilePath: to.Ptr("src/DockerFile"), - // ImageNames: []*string{ - // to.Ptr("azurerest:testtag")}, - // IsPushEnabled: to.Ptr(true), - // NoCache: to.Ptr(false), - // }, - // Trigger: &armcontainerregistry.TriggerProperties{ - // BaseImageTrigger: &armcontainerregistry.BaseImageTrigger{ - // Name: to.Ptr("myBaseImageTrigger"), - // BaseImageTriggerType: to.Ptr(armcontainerregistry.BaseImageTriggerTypeRuntime), - // Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled), - // UpdateTriggerEndpoint: to.Ptr("https://user:pass@mycicd.webhook.com?token=foo"), - // UpdateTriggerPayloadType: to.Ptr(armcontainerregistry.UpdateTriggerPayloadTypeToken), - // }, - // SourceTriggers: []*armcontainerregistry.SourceTrigger{ - // { - // Name: to.Ptr("mySourceTrigger"), - // SourceRepository: &armcontainerregistry.SourceProperties{ - // Branch: to.Ptr("master"), - // RepositoryURL: to.Ptr("https://github.com/Azure/azure-rest-api-specs"), - // SourceControlAuthProperties: &armcontainerregistry.AuthInfo{ - // Token: to.Ptr("xxxxx"), - // TokenType: to.Ptr(armcontainerregistry.TokenTypePAT), - // }, - // SourceControlType: to.Ptr(armcontainerregistry.SourceControlTypeGithub), - // }, - // SourceTriggerEvents: []*armcontainerregistry.SourceTriggerEvent{ - // to.Ptr(armcontainerregistry.SourceTriggerEventCommit)}, - // Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled), - // }}, - // TimerTriggers: []*armcontainerregistry.TimerTrigger{ - // { - // Name: to.Ptr("myTimerTrigger"), - // Schedule: to.Ptr("30 9 * * 1-5"), - // Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled), - // }}, - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/tokens_client.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/tokens_client.go index d93db6a29e83..e45fabb6a569 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/tokens_client.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/tokens_client.go @@ -43,7 +43,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 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -70,7 +70,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 2025-03-01-preview +// Generated from API version 2025-05-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" @@ -116,7 +116,7 @@ func (client *TokensClient) createCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, tokenCreateParameters); err != nil { @@ -128,7 +128,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 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -154,7 +154,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 2025-03-01-preview +// Generated from API version 2025-05-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" @@ -200,7 +200,7 @@ func (client *TokensClient) deleteCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -209,7 +209,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 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -260,7 +260,7 @@ func (client *TokensClient) getCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -277,7 +277,7 @@ func (client *TokensClient) getHandleResponse(resp *http.Response) (TokensClient // NewListPager - Lists all the tokens for the specified container registry. // -// Generated from API version 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -324,7 +324,7 @@ func (client *TokensClient) listCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -342,7 +342,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 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -369,7 +369,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 2025-03-01-preview +// Generated from API version 2025-05-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" @@ -415,7 +415,7 @@ func (client *TokensClient) updateCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-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 deleted file mode 100644 index 21a04acb2222..000000000000 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/tokens_client_example_test.go +++ /dev/null @@ -1,218 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/TokenList.json -func ExampleTokensClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTokensClient().NewListPager("myResourceGroup", "myRegistry", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.TokenListResult = armcontainerregistry.TokenListResult{ - // Value: []*armcontainerregistry.Token{ - // { - // Name: to.Ptr("myToken"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/tokens"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/myToken"), - // Properties: &armcontainerregistry.TokenProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:14:37.070Z"); return t}()), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // ScopeMapID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myScopeMap"), - // Status: to.Ptr(armcontainerregistry.TokenStatusEnabled), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/TokenGet.json -func ExampleTokensClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTokensClient().Get(ctx, "myResourceGroup", "myRegistry", "myToken", 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.Token = armcontainerregistry.Token{ - // Name: to.Ptr("myToken"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/tokens"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/myToken"), - // Properties: &armcontainerregistry.TokenProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:14:37.070Z"); return t}()), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // ScopeMapID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myScopeMap"), - // Status: to.Ptr(armcontainerregistry.TokenStatusEnabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/TokenCreate.json -func ExampleTokensClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTokensClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", "myToken", armcontainerregistry.Token{ - Properties: &armcontainerregistry.TokenProperties{ - Credentials: &armcontainerregistry.TokenCredentialsProperties{ - Certificates: []*armcontainerregistry.TokenCertificate{ - { - Name: to.Ptr(armcontainerregistry.TokenCertificateNameCertificate1), - EncodedPemCertificate: to.Ptr("LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUc3akNDQk5hZ0F3SUJBZ0lURmdBQlR3UVpyZGdmdmhxdzBnQUFBQUZQQkRBTkJna3Foa2lHOXcwQkFRc0YKQURDQml6RUxNQWtHQTFVRUJoTUNWVk14RXpBUkJnTlZCQWdUQ2xkaGMyaHBibWQwYjI0eEVEQU9CZ05WQkFjVApCMUpsWkcxdmJtUXhIakFjQmdOVkJBb1RGVTFwWTNKdmMyOW1kQ0JEYjNKd2IzSmhkR2x2YmpFVk1CTUdBMVVFCkN4TU1UV2xqY205emIyWjBJRWxVTVI0d0hBWURWUVFERXhWTmFXTnliM052Wm5RZ1NWUWdWRXhUSUVOQklEUXcKSGhjTk1UZ3dOREV5TWpJek1qUTRXaGNOTWpBd05ERXlNakl6TWpRNFdqQTVNVGN3TlFZRFZRUURFeTV6WlhKMgphV05sWTJ4cFpXNTBZMlZ5ZEMxd1lYSjBibVZ5TG0xaGJtRm5aVzFsYm5RdVlYcDFjbVV1WTI5dE1JSUJJakFOCkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQTBSYjdJcHpxMmR4emhhbVpyS1ZDakMzeTQyYlYKUnNIY2pCUTFuSDBHZ1puUDhXeDZDSE1mWThybkVJQzRLeVRRYkJXVzhnNXlmc3NSQ0ZXbFpxYjR6SkRXS0pmTgpGSmNMUm9LNnhwTktZYVZVTkVlT25IdUxHYTM0ZlA0VjBFRjZybzdvbkRLME5zanhjY1dZVzRNVXVzc0xrQS94CkUrM2RwU1REdk1KcjJoWUpsVnFDcVR6blQvbmZaVUZzQUVEQnp5MUpOOHZiZDlIR2czc2Myd0x4dk95cFJOc0gKT1V3V2pmN2xzWWZleEVlcWkzY29EeHc2alpLVWEyVkdsUnBpTkowMjhBQitYSi9TU1FVNVBsd0JBbU9TT3ovRApGY0NKdGpPZlBqU1NKckFIQVV3SHU3RzlSV05JTFBwYU9zQ1J5eitETE5zNGpvNlEvUUg4d1lManJRSURBUUFCCm80SUNtakNDQXBZd0N3WURWUjBQQkFRREFnU3dNQjBHQTFVZEpRUVdNQlFHQ0NzR0FRVUZCd01DQmdnckJnRUYKQlFjREFUQWRCZ05WSFE0RUZnUVVlbEdkVVJrZzJoSFFOWEQ4WUc4L3drdjJVT0F3SHdZRFZSMGpCQmd3Rm9BVQplbnVNd2Mvbm9Nb2MxR3Y2KytFend3OGFvcDB3Z2F3R0ExVWRId1NCcERDQm9UQ0JucUNCbTZDQm1JWkxhSFIwCmNEb3ZMMjF6WTNKc0xtMXBZM0p2YzI5bWRDNWpiMjB2Y0d0cEwyMXpZMjl5Y0M5amNtd3ZUV2xqY205emIyWjAKSlRJd1NWUWxNakJVVEZNbE1qQkRRU1V5TURRdVkzSnNoa2xvZEhSd09pOHZZM0pzTG0xcFkzSnZjMjltZEM1agpiMjB2Y0d0cEwyMXpZMjl5Y0M5amNtd3ZUV2xqY205emIyWjBKVEl3U1ZRbE1qQlVURk1sTWpCRFFTVXlNRFF1ClkzSnNNSUdGQmdnckJnRUZCUWNCQVFSNU1IY3dVUVlJS3dZQkJRVUhNQUtHUldoMGRIQTZMeTkzZDNjdWJXbGoKY205emIyWjBMbU52YlM5d2Eya3ZiWE5qYjNKd0wwMXBZM0p2YzI5bWRDVXlNRWxVSlRJd1ZFeFRKVEl3UTBFbApNakEwTG1OeWREQWlCZ2dyQmdFRkJRY3dBWVlXYUhSMGNEb3ZMMjlqYzNBdWJYTnZZM053TG1OdmJUQStCZ2tyCkJnRUVBWUkzRlFjRU1UQXZCaWNyQmdFRUFZSTNGUWlIMm9aMWcrN1pBWUxKaFJ1QnRaNWhoZlRyWUlGZGhOTGYKUW9Mbmszb0NBV1FDQVIwd1RRWURWUjBnQkVZd1JEQkNCZ2tyQmdFRUFZSTNLZ0V3TlRBekJnZ3JCZ0VGQlFjQwpBUlluYUhSMGNEb3ZMM2QzZHk1dGFXTnliM052Wm5RdVkyOXRMM0JyYVM5dGMyTnZjbkF2WTNCek1DY0dDU3NHCkFRUUJnamNWQ2dRYU1CZ3dDZ1lJS3dZQkJRVUhBd0l3Q2dZSUt3WUJCUVVIQXdFd09RWURWUjBSQkRJd01JSXUKYzJWeWRtbGpaV05zYVdWdWRHTmxjblF0Y0dGeWRHNWxjaTV0WVc1aFoyVnRaVzUwTG1GNmRYSmxMbU52YlRBTgpCZ2txaGtpRzl3MEJBUXNGQUFPQ0FnRUFIVXIzbk1vdUI5WWdDUlRWYndUTllIS2RkWGJkSW1GUXNDYys4T1g1CjE5c0N6dFFSR05iSXEwVW1Ba01MbFVvWTIxckh4ZXdxU2hWczFhL2RwaFh5Tk1pcUdaU2QzU1BtYzZscitqUFQKNXVEREs0MUlWeXN0K2VUNlpyazFvcCtMVmdkeS9EU2lyNzVqcWZFY016bS82bU8rNnFNeWRLTWtVYmM5K3JHVwphUkpUcjRWUUdIRmEwNEIwZVZpNUd4MG9pL2RpZDNSaXg2aXJMMjFJSGEwYjN6c1hzZHpHU0R2K3hqL2Q2S0l4Ckdrd2FhYmZvU1NoQnFqaFNlQ0VyZXFlb1RpYjljdGw0MGRVdUp3THl4bjhHS2N6K3AvMEJUOEIxU3lYK01OQ2wKY0pkMjVtMjhLajY2TGUxOEVyeFlJYXZJVGVGa3Y2eGZjdkEvcHladDdPaU41QTlGQk1IUmpQK1kyZ2tvdjMrcQpISFRUZG4xNnlRajduNit3YlFHNGVleXc0YisyQkRLcUxNVFU2ZmlSQ3ZPM2FPZVBLSFVNN3R4b1FidWl6Z3NzCkNiMzl3QnJOTEZsMkJLQ1RkSCtkSU9oZVJiSkZvbmlwOGRPOUVFZWdSSG9lQW54ZUlYTFBrdXMzTzEvZjRhNkIKWHQ3RG5BUm8xSzJmeEp3VXRaU2MvR3dFSjU5NzlnRXlEa3pDZEVsLzdpWE9QZXVjTXhlM2xVM2pweUtsNERUaApjSkJqQytqNGpLWTFrK1U4b040aGdqYnJISUx6Vnd2eU15OU5KS290U3BMSjQxeHdPOHlGangxalFTT3Bxc0N1ClFhUFUvTjhSZ0hxWjBGTkFzS3dNUmZ6WmdXanRCNzRzYUVEdk5jVmNuNFhCQnFNSG0ydHo2Uzk3d3kxZGt0cTgKSE5BPQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg=="), - }}, - }, - ScopeMapID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myScopeMap"), - Status: to.Ptr(armcontainerregistry.TokenStatusDisabled), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Token = armcontainerregistry.Token{ - // Name: to.Ptr("myToken"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/tokens"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/myToken"), - // Properties: &armcontainerregistry.TokenProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:14:37.070Z"); return t}()), - // Credentials: &armcontainerregistry.TokenCredentialsProperties{ - // Certificates: []*armcontainerregistry.TokenCertificate{ - // { - // Name: to.Ptr(armcontainerregistry.TokenCertificateNameCertificate1), - // Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-04T15:32:48.070Z"); return t}()), - // Thumbprint: to.Ptr("feeb79a888bf1415f8e17c4965a2a5bb5c8a2ff7"), - // }}, - // }, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // ScopeMapID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myScopeMap"), - // Status: to.Ptr(armcontainerregistry.TokenStatusDisabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/TokenDelete.json -func ExampleTokensClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTokensClient().BeginDelete(ctx, "myResourceGroup", "myRegistry", "myToken", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/TokenUpdate.json -func ExampleTokensClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTokensClient().BeginUpdate(ctx, "myResourceGroup", "myRegistry", "myToken", armcontainerregistry.TokenUpdateParameters{ - Properties: &armcontainerregistry.TokenUpdateProperties{ - Credentials: &armcontainerregistry.TokenCredentialsProperties{ - Certificates: []*armcontainerregistry.TokenCertificate{ - { - Name: to.Ptr(armcontainerregistry.TokenCertificateNameCertificate1), - EncodedPemCertificate: to.Ptr("LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUc3akNDQk5hZ0F3SUJBZ0lURmdBQlR3UVpyZGdmdmhxdzBnQUFBQUZQQkRBTkJna3Foa2lHOXcwQkFRc0YKQURDQml6RUxNQWtHQTFVRUJoTUNWVk14RXpBUkJnTlZCQWdUQ2xkaGMyaHBibWQwYjI0eEVEQU9CZ05WQkFjVApCMUpsWkcxdmJtUXhIakFjQmdOVkJBb1RGVTFwWTNKdmMyOW1kQ0JEYjNKd2IzSmhkR2x2YmpFVk1CTUdBMVVFCkN4TU1UV2xqY205emIyWjBJRWxVTVI0d0hBWURWUVFERXhWTmFXTnliM052Wm5RZ1NWUWdWRXhUSUVOQklEUXcKSGhjTk1UZ3dOREV5TWpJek1qUTRXaGNOTWpBd05ERXlNakl6TWpRNFdqQTVNVGN3TlFZRFZRUURFeTV6WlhKMgphV05sWTJ4cFpXNTBZMlZ5ZEMxd1lYSjBibVZ5TG0xaGJtRm5aVzFsYm5RdVlYcDFjbVV1WTI5dE1JSUJJakFOCkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQTBSYjdJcHpxMmR4emhhbVpyS1ZDakMzeTQyYlYKUnNIY2pCUTFuSDBHZ1puUDhXeDZDSE1mWThybkVJQzRLeVRRYkJXVzhnNXlmc3NSQ0ZXbFpxYjR6SkRXS0pmTgpGSmNMUm9LNnhwTktZYVZVTkVlT25IdUxHYTM0ZlA0VjBFRjZybzdvbkRLME5zanhjY1dZVzRNVXVzc0xrQS94CkUrM2RwU1REdk1KcjJoWUpsVnFDcVR6blQvbmZaVUZzQUVEQnp5MUpOOHZiZDlIR2czc2Myd0x4dk95cFJOc0gKT1V3V2pmN2xzWWZleEVlcWkzY29EeHc2alpLVWEyVkdsUnBpTkowMjhBQitYSi9TU1FVNVBsd0JBbU9TT3ovRApGY0NKdGpPZlBqU1NKckFIQVV3SHU3RzlSV05JTFBwYU9zQ1J5eitETE5zNGpvNlEvUUg4d1lManJRSURBUUFCCm80SUNtakNDQXBZd0N3WURWUjBQQkFRREFnU3dNQjBHQTFVZEpRUVdNQlFHQ0NzR0FRVUZCd01DQmdnckJnRUYKQlFjREFUQWRCZ05WSFE0RUZnUVVlbEdkVVJrZzJoSFFOWEQ4WUc4L3drdjJVT0F3SHdZRFZSMGpCQmd3Rm9BVQplbnVNd2Mvbm9Nb2MxR3Y2KytFend3OGFvcDB3Z2F3R0ExVWRId1NCcERDQm9UQ0JucUNCbTZDQm1JWkxhSFIwCmNEb3ZMMjF6WTNKc0xtMXBZM0p2YzI5bWRDNWpiMjB2Y0d0cEwyMXpZMjl5Y0M5amNtd3ZUV2xqY205emIyWjAKSlRJd1NWUWxNakJVVEZNbE1qQkRRU1V5TURRdVkzSnNoa2xvZEhSd09pOHZZM0pzTG0xcFkzSnZjMjltZEM1agpiMjB2Y0d0cEwyMXpZMjl5Y0M5amNtd3ZUV2xqY205emIyWjBKVEl3U1ZRbE1qQlVURk1sTWpCRFFTVXlNRFF1ClkzSnNNSUdGQmdnckJnRUZCUWNCQVFSNU1IY3dVUVlJS3dZQkJRVUhNQUtHUldoMGRIQTZMeTkzZDNjdWJXbGoKY205emIyWjBMbU52YlM5d2Eya3ZiWE5qYjNKd0wwMXBZM0p2YzI5bWRDVXlNRWxVSlRJd1ZFeFRKVEl3UTBFbApNakEwTG1OeWREQWlCZ2dyQmdFRkJRY3dBWVlXYUhSMGNEb3ZMMjlqYzNBdWJYTnZZM053TG1OdmJUQStCZ2tyCkJnRUVBWUkzRlFjRU1UQXZCaWNyQmdFRUFZSTNGUWlIMm9aMWcrN1pBWUxKaFJ1QnRaNWhoZlRyWUlGZGhOTGYKUW9Mbmszb0NBV1FDQVIwd1RRWURWUjBnQkVZd1JEQkNCZ2tyQmdFRUFZSTNLZ0V3TlRBekJnZ3JCZ0VGQlFjQwpBUlluYUhSMGNEb3ZMM2QzZHk1dGFXTnliM052Wm5RdVkyOXRMM0JyYVM5dGMyTnZjbkF2WTNCek1DY0dDU3NHCkFRUUJnamNWQ2dRYU1CZ3dDZ1lJS3dZQkJRVUhBd0l3Q2dZSUt3WUJCUVVIQXdFd09RWURWUjBSQkRJd01JSXUKYzJWeWRtbGpaV05zYVdWdWRHTmxjblF0Y0dGeWRHNWxjaTV0WVc1aFoyVnRaVzUwTG1GNmRYSmxMbU52YlRBTgpCZ2txaGtpRzl3MEJBUXNGQUFPQ0FnRUFIVXIzbk1vdUI5WWdDUlRWYndUTllIS2RkWGJkSW1GUXNDYys4T1g1CjE5c0N6dFFSR05iSXEwVW1Ba01MbFVvWTIxckh4ZXdxU2hWczFhL2RwaFh5Tk1pcUdaU2QzU1BtYzZscitqUFQKNXVEREs0MUlWeXN0K2VUNlpyazFvcCtMVmdkeS9EU2lyNzVqcWZFY016bS82bU8rNnFNeWRLTWtVYmM5K3JHVwphUkpUcjRWUUdIRmEwNEIwZVZpNUd4MG9pL2RpZDNSaXg2aXJMMjFJSGEwYjN6c1hzZHpHU0R2K3hqL2Q2S0l4Ckdrd2FhYmZvU1NoQnFqaFNlQ0VyZXFlb1RpYjljdGw0MGRVdUp3THl4bjhHS2N6K3AvMEJUOEIxU3lYK01OQ2wKY0pkMjVtMjhLajY2TGUxOEVyeFlJYXZJVGVGa3Y2eGZjdkEvcHladDdPaU41QTlGQk1IUmpQK1kyZ2tvdjMrcQpISFRUZG4xNnlRajduNit3YlFHNGVleXc0YisyQkRLcUxNVFU2ZmlSQ3ZPM2FPZVBLSFVNN3R4b1FidWl6Z3NzCkNiMzl3QnJOTEZsMkJLQ1RkSCtkSU9oZVJiSkZvbmlwOGRPOUVFZWdSSG9lQW54ZUlYTFBrdXMzTzEvZjRhNkIKWHQ3RG5BUm8xSzJmeEp3VXRaU2MvR3dFSjU5NzlnRXlEa3pDZEVsLzdpWE9QZXVjTXhlM2xVM2pweUtsNERUaApjSkJqQytqNGpLWTFrK1U4b040aGdqYnJISUx6Vnd2eU15OU5KS290U3BMSjQxeHdPOHlGangxalFTT3Bxc0N1ClFhUFUvTjhSZ0hxWjBGTkFzS3dNUmZ6WmdXanRCNzRzYUVEdk5jVmNuNFhCQnFNSG0ydHo2Uzk3d3kxZGt0cTgKSE5BPQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg=="), - }}, - }, - ScopeMapID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myNewScopeMap"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Token = armcontainerregistry.Token{ - // Name: to.Ptr("myToken"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/tokens"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/myToken"), - // Properties: &armcontainerregistry.TokenProperties{ - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:14:37.070Z"); return t}()), - // Credentials: &armcontainerregistry.TokenCredentialsProperties{ - // Certificates: []*armcontainerregistry.TokenCertificate{ - // { - // Name: to.Ptr(armcontainerregistry.TokenCertificateNameCertificate1), - // EncodedPemCertificate: to.Ptr("LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUc3akNDQk5hZ0F3SUJBZ0lURmdBQlR3UVpyZGdmdmhxdzBnQUFBQUZQQkRBTkJna3Foa2lHOXcwQkFRc0YKQURDQml6RUxNQWtHQTFVRUJoTUNWVk14RXpBUkJnTlZCQWdUQ2xkaGMyaHBibWQwYjI0eEVEQU9CZ05WQkFjVApCMUpsWkcxdmJtUXhIakFjQmdOVkJBb1RGVTFwWTNKdmMyOW1kQ0JEYjNKd2IzSmhkR2x2YmpFVk1CTUdBMVVFCkN4TU1UV2xqY205emIyWjBJRWxVTVI0d0hBWURWUVFERXhWTmFXTnliM052Wm5RZ1NWUWdWRXhUSUVOQklEUXcKSGhjTk1UZ3dOREV5TWpJek1qUTRXaGNOTWpBd05ERXlNakl6TWpRNFdqQTVNVGN3TlFZRFZRUURFeTV6WlhKMgphV05sWTJ4cFpXNTBZMlZ5ZEMxd1lYSjBibVZ5TG0xaGJtRm5aVzFsYm5RdVlYcDFjbVV1WTI5dE1JSUJJakFOCkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQTBSYjdJcHpxMmR4emhhbVpyS1ZDakMzeTQyYlYKUnNIY2pCUTFuSDBHZ1puUDhXeDZDSE1mWThybkVJQzRLeVRRYkJXVzhnNXlmc3NSQ0ZXbFpxYjR6SkRXS0pmTgpGSmNMUm9LNnhwTktZYVZVTkVlT25IdUxHYTM0ZlA0VjBFRjZybzdvbkRLME5zanhjY1dZVzRNVXVzc0xrQS94CkUrM2RwU1REdk1KcjJoWUpsVnFDcVR6blQvbmZaVUZzQUVEQnp5MUpOOHZiZDlIR2czc2Myd0x4dk95cFJOc0gKT1V3V2pmN2xzWWZleEVlcWkzY29EeHc2alpLVWEyVkdsUnBpTkowMjhBQitYSi9TU1FVNVBsd0JBbU9TT3ovRApGY0NKdGpPZlBqU1NKckFIQVV3SHU3RzlSV05JTFBwYU9zQ1J5eitETE5zNGpvNlEvUUg4d1lManJRSURBUUFCCm80SUNtakNDQXBZd0N3WURWUjBQQkFRREFnU3dNQjBHQTFVZEpRUVdNQlFHQ0NzR0FRVUZCd01DQmdnckJnRUYKQlFjREFUQWRCZ05WSFE0RUZnUVVlbEdkVVJrZzJoSFFOWEQ4WUc4L3drdjJVT0F3SHdZRFZSMGpCQmd3Rm9BVQplbnVNd2Mvbm9Nb2MxR3Y2KytFend3OGFvcDB3Z2F3R0ExVWRId1NCcERDQm9UQ0JucUNCbTZDQm1JWkxhSFIwCmNEb3ZMMjF6WTNKc0xtMXBZM0p2YzI5bWRDNWpiMjB2Y0d0cEwyMXpZMjl5Y0M5amNtd3ZUV2xqY205emIyWjAKSlRJd1NWUWxNakJVVEZNbE1qQkRRU1V5TURRdVkzSnNoa2xvZEhSd09pOHZZM0pzTG0xcFkzSnZjMjltZEM1agpiMjB2Y0d0cEwyMXpZMjl5Y0M5amNtd3ZUV2xqY205emIyWjBKVEl3U1ZRbE1qQlVURk1sTWpCRFFTVXlNRFF1ClkzSnNNSUdGQmdnckJnRUZCUWNCQVFSNU1IY3dVUVlJS3dZQkJRVUhNQUtHUldoMGRIQTZMeTkzZDNjdWJXbGoKY205emIyWjBMbU52YlM5d2Eya3ZiWE5qYjNKd0wwMXBZM0p2YzI5bWRDVXlNRWxVSlRJd1ZFeFRKVEl3UTBFbApNakEwTG1OeWREQWlCZ2dyQmdFRkJRY3dBWVlXYUhSMGNEb3ZMMjlqYzNBdWJYTnZZM053TG1OdmJUQStCZ2tyCkJnRUVBWUkzRlFjRU1UQXZCaWNyQmdFRUFZSTNGUWlIMm9aMWcrN1pBWUxKaFJ1QnRaNWhoZlRyWUlGZGhOTGYKUW9Mbmszb0NBV1FDQVIwd1RRWURWUjBnQkVZd1JEQkNCZ2tyQmdFRUFZSTNLZ0V3TlRBekJnZ3JCZ0VGQlFjQwpBUlluYUhSMGNEb3ZMM2QzZHk1dGFXTnliM052Wm5RdVkyOXRMM0JyYVM5dGMyTnZjbkF2WTNCek1DY0dDU3NHCkFRUUJnamNWQ2dRYU1CZ3dDZ1lJS3dZQkJRVUhBd0l3Q2dZSUt3WUJCUVVIQXdFd09RWURWUjBSQkRJd01JSXUKYzJWeWRtbGpaV05zYVdWdWRHTmxjblF0Y0dGeWRHNWxjaTV0WVc1aFoyVnRaVzUwTG1GNmRYSmxMbU52YlRBTgpCZ2txaGtpRzl3MEJBUXNGQUFPQ0FnRUFIVXIzbk1vdUI5WWdDUlRWYndUTllIS2RkWGJkSW1GUXNDYys4T1g1CjE5c0N6dFFSR05iSXEwVW1Ba01MbFVvWTIxckh4ZXdxU2hWczFhL2RwaFh5Tk1pcUdaU2QzU1BtYzZscitqUFQKNXVEREs0MUlWeXN0K2VUNlpyazFvcCtMVmdkeS9EU2lyNzVqcWZFY016bS82bU8rNnFNeWRLTWtVYmM5K3JHVwphUkpUcjRWUUdIRmEwNEIwZVZpNUd4MG9pL2RpZDNSaXg2aXJMMjFJSGEwYjN6c1hzZHpHU0R2K3hqL2Q2S0l4Ckdrd2FhYmZvU1NoQnFqaFNlQ0VyZXFlb1RpYjljdGw0MGRVdUp3THl4bjhHS2N6K3AvMEJUOEIxU3lYK01OQ2wKY0pkMjVtMjhLajY2TGUxOEVyeFlJYXZJVGVGa3Y2eGZjdkEvcHladDdPaU41QTlGQk1IUmpQK1kyZ2tvdjMrcQpISFRUZG4xNnlRajduNit3YlFHNGVleXc0YisyQkRLcUxNVFU2ZmlSQ3ZPM2FPZVBLSFVNN3R4b1FidWl6Z3NzCkNiMzl3QnJOTEZsMkJLQ1RkSCtkSU9oZVJiSkZvbmlwOGRPOUVFZWdSSG9lQW54ZUlYTFBrdXMzTzEvZjRhNkIKWHQ3RG5BUm8xSzJmeEp3VXRaU2MvR3dFSjU5NzlnRXlEa3pDZEVsLzdpWE9QZXVjTXhlM2xVM2pweUtsNERUaApjSkJqQytqNGpLWTFrK1U4b040aGdqYnJISUx6Vnd2eU15OU5KS290U3BMSjQxeHdPOHlGangxalFTT3Bxc0N1ClFhUFUvTjhSZ0hxWjBGTkFzS3dNUmZ6WmdXanRCNzRzYUVEdk5jVmNuNFhCQnFNSG0ydHo2Uzk3d3kxZGt0cTgKSE5BPQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg=="), - // }}, - // }, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // ScopeMapID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myNewScopeMap"), - // Status: to.Ptr(armcontainerregistry.TokenStatusEnabled), - // }, - // } -} diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/webhooks_client.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/webhooks_client.go index 0e87bf1aeebe..7106abe5b1ec 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/webhooks_client.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/webhooks_client.go @@ -43,7 +43,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 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -70,7 +70,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 2025-03-01-preview +// Generated from API version 2025-05-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" @@ -116,7 +116,7 @@ func (client *WebhooksClient) createCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, webhookCreateParameters); err != nil { @@ -128,7 +128,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 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -154,7 +154,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 2025-03-01-preview +// Generated from API version 2025-05-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" @@ -200,7 +200,7 @@ func (client *WebhooksClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -208,7 +208,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 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -259,7 +259,7 @@ func (client *WebhooksClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -277,7 +277,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 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -329,7 +329,7 @@ func (client *WebhooksClient) getCallbackConfigCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -346,7 +346,7 @@ func (client *WebhooksClient) getCallbackConfigHandleResponse(resp *http.Respons // NewListPager - Lists all the webhooks for the specified container registry. // -// Generated from API version 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -393,7 +393,7 @@ func (client *WebhooksClient) listCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -410,7 +410,7 @@ func (client *WebhooksClient) listHandleResponse(resp *http.Response) (WebhooksC // NewListEventsPager - Lists recent events for the specified webhook. // -// Generated from API version 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -462,7 +462,7 @@ func (client *WebhooksClient) listEventsCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -480,7 +480,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 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -531,7 +531,7 @@ func (client *WebhooksClient) pingCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -549,7 +549,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 2025-03-01-preview +// Generated from API version 2025-05-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. @@ -576,7 +576,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 2025-03-01-preview +// Generated from API version 2025-05-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" @@ -622,7 +622,7 @@ func (client *WebhooksClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-03-01-preview") + reqQP.Set("api-version", "2025-05-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 deleted file mode 100644 index 6a5a09137451..000000000000 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/webhooks_client_example_test.go +++ /dev/null @@ -1,353 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/WebhookList.json -func ExampleWebhooksClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewWebhooksClient().NewListPager("myResourceGroup", "myRegistry", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.WebhookListResult = armcontainerregistry.WebhookListResult{ - // Value: []*armcontainerregistry.Webhook{ - // { - // Name: to.Ptr("myWebhook"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/webhooks"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/webhooks/myWebhook"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Properties: &armcontainerregistry.WebhookProperties{ - // Actions: []*armcontainerregistry.WebhookAction{ - // to.Ptr(armcontainerregistry.WebhookActionPush)}, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // Scope: to.Ptr("myRepository"), - // Status: to.Ptr(armcontainerregistry.WebhookStatusEnabled), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/WebhookGet.json -func ExampleWebhooksClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWebhooksClient().Get(ctx, "myResourceGroup", "myRegistry", "myWebhook", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Webhook = armcontainerregistry.Webhook{ - // Name: to.Ptr("myWebhook"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/webhooks"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/webhooks/myWebhook"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Properties: &armcontainerregistry.WebhookProperties{ - // Actions: []*armcontainerregistry.WebhookAction{ - // to.Ptr(armcontainerregistry.WebhookActionPush)}, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // Scope: to.Ptr("myRepository"), - // Status: to.Ptr(armcontainerregistry.WebhookStatusEnabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/WebhookCreate.json -func ExampleWebhooksClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWebhooksClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", "myWebhook", armcontainerregistry.WebhookCreateParameters{ - Location: to.Ptr("westus"), - Properties: &armcontainerregistry.WebhookPropertiesCreateParameters{ - Actions: []*armcontainerregistry.WebhookAction{ - to.Ptr(armcontainerregistry.WebhookActionPush)}, - CustomHeaders: map[string]*string{ - "Authorization": to.Ptr("******"), - }, - Scope: to.Ptr("myRepository"), - ServiceURI: to.Ptr("http://myservice.com"), - Status: to.Ptr(armcontainerregistry.WebhookStatusEnabled), - }, - Tags: map[string]*string{ - "key": to.Ptr("value"), - }, - }, nil) - 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.Webhook = armcontainerregistry.Webhook{ - // Name: to.Ptr("myWebhook"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/webhooks"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/webhooks/myWebhook"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Properties: &armcontainerregistry.WebhookProperties{ - // Actions: []*armcontainerregistry.WebhookAction{ - // to.Ptr(armcontainerregistry.WebhookActionPush)}, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // Scope: to.Ptr("myRepository"), - // Status: to.Ptr(armcontainerregistry.WebhookStatusEnabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/WebhookDelete.json -func ExampleWebhooksClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWebhooksClient().BeginDelete(ctx, "myResourceGroup", "myRegistry", "myWebhook", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/WebhookUpdate.json -func ExampleWebhooksClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWebhooksClient().BeginUpdate(ctx, "myResourceGroup", "myRegistry", "myWebhook", armcontainerregistry.WebhookUpdateParameters{ - Properties: &armcontainerregistry.WebhookPropertiesUpdateParameters{ - Actions: []*armcontainerregistry.WebhookAction{ - to.Ptr(armcontainerregistry.WebhookActionPush)}, - CustomHeaders: map[string]*string{ - "Authorization": to.Ptr("******"), - }, - Scope: to.Ptr("myRepository"), - ServiceURI: to.Ptr("http://myservice.com"), - Status: to.Ptr(armcontainerregistry.WebhookStatusEnabled), - }, - Tags: map[string]*string{ - "key": to.Ptr("value"), - }, - }, nil) - 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.Webhook = armcontainerregistry.Webhook{ - // Name: to.Ptr("myWebhook"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/webhooks"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/webhooks/myWebhook"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Properties: &armcontainerregistry.WebhookProperties{ - // Actions: []*armcontainerregistry.WebhookAction{ - // to.Ptr(armcontainerregistry.WebhookActionPush)}, - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // Scope: to.Ptr("myRepository"), - // Status: to.Ptr(armcontainerregistry.WebhookStatusEnabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/WebhookPing.json -func ExampleWebhooksClient_Ping() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWebhooksClient().Ping(ctx, "myResourceGroup", "myRegistry", "myWebhook", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.EventInfo = armcontainerregistry.EventInfo{ - // ID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/WebhookListEvents.json -func ExampleWebhooksClient_NewListEventsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewWebhooksClient().NewListEventsPager("myResourceGroup", "myRegistry", "myWebhook", 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.EventListResult = armcontainerregistry.EventListResult{ - // Value: []*armcontainerregistry.Event{ - // { - // ID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // EventRequestMessage: &armcontainerregistry.EventRequestMessage{ - // Method: to.Ptr("POST"), - // Content: &armcontainerregistry.EventContent{ - // Action: to.Ptr("push"), - // Actor: &armcontainerregistry.Actor{ - // }, - // ID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Source: &armcontainerregistry.Source{ - // Addr: to.Ptr("xtal.local:5000"), - // InstanceID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // Target: &armcontainerregistry.Target{ - // Digest: to.Ptr("sha256:fea8895f450959fa676bcc1df0611ea93823a735a01205fd8622846041d0c7cf"), - // Length: to.Ptr[int64](708), - // MediaType: to.Ptr("application/vnd.docker.distribution.manifest.v2+json"), - // Repository: to.Ptr("hello-world"), - // Size: to.Ptr[int64](708), - // Tag: to.Ptr("latest"), - // URL: to.Ptr("http://192.168.100.227:5000/v2/hello-world/manifests/sha256:fea8895f450959fa676bcc1df0611ea93823a735a01205fd8622846041d0c7cf"), - // }, - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:14:37.070Z"); return t}()), - // Request: &armcontainerregistry.Request{ - // Method: to.Ptr("GET"), - // Addr: to.Ptr("192.168.64.11:42961"), - // Host: to.Ptr("192.168.100.227:5000"), - // ID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Useragent: to.Ptr("curl/7.38.0"), - // }, - // }, - // Headers: map[string]*string{ - // "Authorization": to.Ptr("******"), - // "Content-Length": to.Ptr("719"), - // "Content-Type": to.Ptr("application/json"), - // }, - // RequestURI: to.Ptr("http://myservice.com"), - // Version: to.Ptr("1.1"), - // }, - // EventResponseMessage: &armcontainerregistry.EventResponseMessage{ - // Headers: map[string]*string{ - // "Content-Length": to.Ptr("0"), - // }, - // StatusCode: to.Ptr("200"), - // Version: to.Ptr("1.1"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2025-03-01-preview/examples/WebhookGetCallbackConfig.json -func ExampleWebhooksClient_GetCallbackConfig() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWebhooksClient().GetCallbackConfig(ctx, "myResourceGroup", "myRegistry", "myWebhook", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CallbackConfig = armcontainerregistry.CallbackConfig{ - // CustomHeaders: map[string]*string{ - // "Authorization": to.Ptr("******"), - // }, - // ServiceURI: to.Ptr("http://myservice.com"), - // } -}