diff --git a/sdk/resourcemanager/containerregistry/armcontainerregistry/CHANGELOG.md b/sdk/resourcemanager/containerregistry/armcontainerregistry/CHANGELOG.md index 1eeacf95a9a9..f2f734a50d3c 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/CHANGELOG.md +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 1.1.0-beta.2 (2023-05-25) +### Other Changes + + ## 1.1.0-beta.1 (2023-03-27) ### Features Added 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 97a427859a0b..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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsGet.json -func ExampleAgentPoolsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - 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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsCreate.json -func ExampleAgentPoolsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - 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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsDelete.json -func ExampleAgentPoolsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - 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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsUpdate.json -func ExampleAgentPoolsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - 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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsList.json -func ExampleAgentPoolsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - 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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsGetQueueStatus.json -func ExampleAgentPoolsClient_GetQueueStatus() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - 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/autorest.md b/sdk/resourcemanager/containerregistry/armcontainerregistry/autorest.md index 8f072ae69bc8..104b2b238081 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/autorest.md +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/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.1.0-beta.1 +module-version: 1.1.0-beta.2 ``` \ No newline at end of file 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 03cfd49e22ca..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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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.8374968+00:00"); 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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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.8374968+00:00"); 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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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.8374968+00:00"); 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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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.8374968+00:00"); 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_example_test.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/connectedregistries_client_example_test.go deleted file mode 100644 index 680d88753137..000000000000 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/connectedregistries_client_example_test.go +++ /dev/null @@ -1,302 +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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-01-preview/examples/ConnectedRegistryList.json -func ExampleConnectedRegistriesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewConnectedRegistriesClient().NewListPager("myResourceGroup", "myRegistry", &armcontainerregistry.ConnectedRegistriesClientListOptions{Filter: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ConnectedRegistryListResult = armcontainerregistry.ConnectedRegistryListResult{ - // Value: []*armcontainerregistry.ConnectedRegistry{ - // { - // Name: to.Ptr("myConnectedRegistry"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/connectedRegistries"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/connectedRegistries/myConnectedRegistry"), - // Properties: &armcontainerregistry.ConnectedRegistryProperties{ - // Activation: &armcontainerregistry.ActivationProperties{ - // Status: to.Ptr(armcontainerregistry.ActivationStatusInactive), - // }, - // ClientTokenIDs: []*string{ - // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/client1Token")}, - // Logging: &armcontainerregistry.LoggingProperties{ - // AuditLogStatus: to.Ptr(armcontainerregistry.AuditLogStatusDisabled), - // LogLevel: to.Ptr(armcontainerregistry.LogLevelInformation), - // }, - // Mode: to.Ptr(armcontainerregistry.ConnectedRegistryModeReadWrite), - // NotificationsList: []*string{ - // to.Ptr("hello-world:*:*"), - // to.Ptr("sample/repo/*:1.0:*")}, - // Parent: &armcontainerregistry.ParentProperties{ - // SyncProperties: &armcontainerregistry.SyncProperties{ - // MessageTTL: to.Ptr("P2D"), - // Schedule: to.Ptr("0 9 * * *"), - // SyncWindow: to.Ptr("PT3H"), - // TokenID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/syncToken"), - // }, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-01-preview/examples/ConnectedRegistryGet.json -func ExampleConnectedRegistriesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewConnectedRegistriesClient().Get(ctx, "myResourceGroup", "myRegistry", "myConnectedRegistry", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ConnectedRegistry = armcontainerregistry.ConnectedRegistry{ - // Name: to.Ptr("myConnectedRegistry"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/connectedRegistries"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/connectedRegistries/myConnectedRegistry"), - // Properties: &armcontainerregistry.ConnectedRegistryProperties{ - // Activation: &armcontainerregistry.ActivationProperties{ - // Status: to.Ptr(armcontainerregistry.ActivationStatusInactive), - // }, - // ClientTokenIDs: []*string{ - // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/client1Token")}, - // Logging: &armcontainerregistry.LoggingProperties{ - // AuditLogStatus: to.Ptr(armcontainerregistry.AuditLogStatusDisabled), - // LogLevel: to.Ptr(armcontainerregistry.LogLevelInformation), - // }, - // Mode: to.Ptr(armcontainerregistry.ConnectedRegistryModeReadWrite), - // NotificationsList: []*string{ - // to.Ptr("hello-world:*:*"), - // to.Ptr("sample/repo/*:1.0:*")}, - // Parent: &armcontainerregistry.ParentProperties{ - // SyncProperties: &armcontainerregistry.SyncProperties{ - // MessageTTL: to.Ptr("P2D"), - // Schedule: to.Ptr("0 9 * * *"), - // SyncWindow: to.Ptr("PT3H"), - // TokenID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/syncToken"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-01-preview/examples/ConnectedRegistryCreate.json -func ExampleConnectedRegistriesClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConnectedRegistriesClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", "myConnectedRegistry", armcontainerregistry.ConnectedRegistry{ - Properties: &armcontainerregistry.ConnectedRegistryProperties{ - ClientTokenIDs: []*string{ - to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/client1Token")}, - Mode: to.Ptr(armcontainerregistry.ConnectedRegistryModeReadWrite), - NotificationsList: []*string{ - to.Ptr("hello-world:*:*"), - to.Ptr("sample/repo/*:1.0:*")}, - Parent: &armcontainerregistry.ParentProperties{ - SyncProperties: &armcontainerregistry.SyncProperties{ - MessageTTL: to.Ptr("P2D"), - Schedule: to.Ptr("0 9 * * *"), - SyncWindow: to.Ptr("PT3H"), - TokenID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/syncToken"), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ConnectedRegistry = armcontainerregistry.ConnectedRegistry{ - // Name: to.Ptr("myConnectedRegistry"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/connectedRegistries"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/connectedRegistries/myConnectedRegistry"), - // Properties: &armcontainerregistry.ConnectedRegistryProperties{ - // Activation: &armcontainerregistry.ActivationProperties{ - // Status: to.Ptr(armcontainerregistry.ActivationStatusInactive), - // }, - // ClientTokenIDs: []*string{ - // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/client1Token")}, - // Logging: &armcontainerregistry.LoggingProperties{ - // AuditLogStatus: to.Ptr(armcontainerregistry.AuditLogStatusDisabled), - // LogLevel: to.Ptr(armcontainerregistry.LogLevelInformation), - // }, - // Mode: to.Ptr(armcontainerregistry.ConnectedRegistryModeReadWrite), - // NotificationsList: []*string{ - // to.Ptr("hello-world:*:*"), - // to.Ptr("sample/repo/*:1.0:*")}, - // Parent: &armcontainerregistry.ParentProperties{ - // SyncProperties: &armcontainerregistry.SyncProperties{ - // MessageTTL: to.Ptr("P2D"), - // Schedule: to.Ptr("0 9 * * *"), - // SyncWindow: to.Ptr("PT3H"), - // TokenID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/syncToken"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-01-preview/examples/ConnectedRegistryUpdate.json -func ExampleConnectedRegistriesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerregistry.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConnectedRegistriesClient().BeginUpdate(ctx, "myResourceGroup", "myRegistry", "myScopeMap", armcontainerregistry.ConnectedRegistryUpdateParameters{ - Properties: &armcontainerregistry.ConnectedRegistryUpdateProperties{ - ClientTokenIDs: []*string{ - to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/client1Token"), - to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/client2Token")}, - Logging: &armcontainerregistry.LoggingProperties{ - AuditLogStatus: to.Ptr(armcontainerregistry.AuditLogStatusEnabled), - LogLevel: to.Ptr(armcontainerregistry.LogLevelDebug), - }, - NotificationsList: []*string{ - to.Ptr("hello-world:*:*"), - to.Ptr("sample/repo/*:1.0:*")}, - SyncProperties: &armcontainerregistry.SyncUpdateProperties{ - MessageTTL: to.Ptr("P30D"), - Schedule: to.Ptr("0 0 */10 * *"), - SyncWindow: to.Ptr("P2D"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ConnectedRegistry = armcontainerregistry.ConnectedRegistry{ - // Name: to.Ptr("myConnectedRegistry"), - // Type: to.Ptr("Microsoft.ContainerRegistry/registries/connectedRegistries"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/connectedRegistries/myConnectedRegistry"), - // Properties: &armcontainerregistry.ConnectedRegistryProperties{ - // ClientTokenIDs: []*string{ - // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/client1Token"), - // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/client2Token")}, - // Logging: &armcontainerregistry.LoggingProperties{ - // AuditLogStatus: to.Ptr(armcontainerregistry.AuditLogStatusEnabled), - // LogLevel: to.Ptr(armcontainerregistry.LogLevelDebug), - // }, - // Mode: to.Ptr(armcontainerregistry.ConnectedRegistryModeReadWrite), - // NotificationsList: []*string{ - // to.Ptr("hello-world:*:*"), - // to.Ptr("sample/repo/*:1.0:*")}, - // Parent: &armcontainerregistry.ParentProperties{ - // SyncProperties: &armcontainerregistry.SyncProperties{ - // MessageTTL: to.Ptr("P30D"), - // Schedule: to.Ptr("0 0 */10 * *"), - // SyncWindow: to.Ptr("P2D"), - // TokenID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/syncToken"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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 fcfc2caaf1dc..7df7ff098bc2 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/constants.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/constants.go @@ -11,7 +11,7 @@ package armcontainerregistry const ( moduleName = "armcontainerregistry" - moduleVersion = "v1.1.0-beta.1" + moduleVersion = "v1.1.0-beta.2" ) // Action - The action of IP ACL rule. 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 a701d815aefa..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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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.012276+00:00"); 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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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.012276+00:00"); 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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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.012276+00:00"); 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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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.012276+00:00"); return t}()), - // LoginServer: to.Ptr("docker.io"), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // }, - // } -} 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 a889c62c5891..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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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/go.mod b/sdk/resourcemanager/containerregistry/armcontainerregistry/go.mod index 31324df30464..2f1dc15c00e1 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/go.mod +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/go.mod @@ -4,12 +4,12 @@ go 1.18 require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.2 github.com/stretchr/testify v1.7.0 ) require ( + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 // indirect github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.0.0 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 // indirect 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 835ca0165faa..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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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 8fa8c93d2619..75cf095a0681 100644 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/models.go +++ b/sdk/resourcemanager/containerregistry/armcontainerregistry/models.go @@ -14,96 +14,96 @@ import "time" // ActivationProperties - The activation properties of the connected registry. type ActivationProperties struct { // READ-ONLY; The activation status of the connected registry. - Status *ActivationStatus `json:"status,omitempty" azure:"ro"` + Status *ActivationStatus } // ActiveDirectoryObject - The Active Directory Object that will be used for authenticating the token of a container registry. type ActiveDirectoryObject struct { // The user/group/application object ID for Active Directory Object that will be used for authenticating the token of a container // registry. - ObjectID *string `json:"objectId,omitempty"` + ObjectID *string // The tenant ID of user/group/application object Active Directory Object that will be used for authenticating the token of // a container registry. - TenantID *string `json:"tenantId,omitempty"` + TenantID *string } // Actor - The agent that initiated the event. For most situations, this could be from the authorization context of the request. type Actor struct { // The subject or username associated with the request context that generated the event. - Name *string `json:"name,omitempty"` + Name *string } // AgentPool - The agentpool that has the ARM resource and properties. The agentpool will have all information to create an // agent pool. type AgentPool struct { // REQUIRED; The location of the resource. This cannot be changed after the resource is created. - Location *string `json:"location,omitempty"` + Location *string // The properties associated with the agent pool - Properties *AgentPoolProperties `json:"properties,omitempty"` + Properties *AgentPoolProperties // The tags of the resource. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; The resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // AgentPoolListResult - The collection of agent pools. type AgentPoolListResult struct { // The URI that can be used to request the next set of paged results. - NextLink *string `json:"nextLink,omitempty"` + NextLink *string // The collection value. - Value []*AgentPool `json:"value,omitempty"` + Value []*AgentPool } // AgentPoolProperties - The properties of agent pool. type AgentPoolProperties struct { // The count of agent machine - Count *int32 `json:"count,omitempty"` + Count *int32 // The OS of agent machine - OS *OS `json:"os,omitempty"` + OS *OS // The Tier of agent machine - Tier *string `json:"tier,omitempty"` + Tier *string // The Virtual Network Subnet Resource Id of the agent machine - VirtualNetworkSubnetResourceID *string `json:"virtualNetworkSubnetResourceId,omitempty"` + VirtualNetworkSubnetResourceID *string // READ-ONLY; The provisioning state of this agent pool - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *ProvisioningState } type AgentPoolPropertiesUpdateParameters struct { // The count of agent machine - Count *int32 `json:"count,omitempty"` + Count *int32 } // AgentPoolQueueStatus - The QueueStatus of Agent Pool type AgentPoolQueueStatus struct { // The number of pending runs in the queue - Count *int32 `json:"count,omitempty"` + Count *int32 } // AgentPoolUpdateParameters - The parameters for updating an agent pool. type AgentPoolUpdateParameters struct { // The properties associated with the agent pool - Properties *AgentPoolPropertiesUpdateParameters `json:"properties,omitempty"` + Properties *AgentPoolPropertiesUpdateParameters // The ARM resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string } // AgentPoolsClientBeginCreateOptions contains the optional parameters for the AgentPoolsClient.BeginCreate method. @@ -142,178 +142,178 @@ type AgentPoolsClientListOptions struct { // AgentProperties - The properties that determine the run agent configuration. type AgentProperties struct { // The CPU configuration in terms of number of cores required for the run. - CPU *int32 `json:"cpu,omitempty"` + CPU *int32 } // Argument - The properties of a run argument. type Argument struct { // REQUIRED; The name of the argument. - Name *string `json:"name,omitempty"` + Name *string // REQUIRED; The value of the argument. - Value *string `json:"value,omitempty"` + Value *string // Flag to indicate whether the argument represents a secret and want to be removed from build logs. - IsSecret *bool `json:"isSecret,omitempty"` + IsSecret *bool } // AuthCredential - Authentication credential stored for an upstream. type AuthCredential struct { // The name of the credential. - Name *CredentialName `json:"name,omitempty"` + Name *CredentialName // KeyVault Secret URI for accessing the password. - PasswordSecretIdentifier *string `json:"passwordSecretIdentifier,omitempty"` + PasswordSecretIdentifier *string // KeyVault Secret URI for accessing the username. - UsernameSecretIdentifier *string `json:"usernameSecretIdentifier,omitempty"` + UsernameSecretIdentifier *string // READ-ONLY; This provides data pertaining to the health of the auth credential. - CredentialHealth *CredentialHealth `json:"credentialHealth,omitempty" azure:"ro"` + CredentialHealth *CredentialHealth } // AuthInfo - The authorization properties for accessing the source code repository. type AuthInfo struct { // REQUIRED; The access token used to access the source control provider. - Token *string `json:"token,omitempty"` + Token *string // REQUIRED; The type of Auth token. - TokenType *TokenType `json:"tokenType,omitempty"` + TokenType *TokenType // Time in seconds that the token remains valid - ExpiresIn *int32 `json:"expiresIn,omitempty"` + ExpiresIn *int32 // The refresh token used to refresh the access token. - RefreshToken *string `json:"refreshToken,omitempty"` + RefreshToken *string // The scope of the access token. - Scope *string `json:"scope,omitempty"` + Scope *string } // AuthInfoUpdateParameters - The authorization properties for accessing the source code repository. type AuthInfoUpdateParameters struct { // Time in seconds that the token remains valid - ExpiresIn *int32 `json:"expiresIn,omitempty"` + ExpiresIn *int32 // The refresh token used to refresh the access token. - RefreshToken *string `json:"refreshToken,omitempty"` + RefreshToken *string // The scope of the access token. - Scope *string `json:"scope,omitempty"` + Scope *string // The access token used to access the source control provider. - Token *string `json:"token,omitempty"` + Token *string // The type of Auth token. - TokenType *TokenType `json:"tokenType,omitempty"` + TokenType *TokenType } // AzureADAuthenticationAsArmPolicy - The policy for using ARM audience token for a container registry. type AzureADAuthenticationAsArmPolicy struct { // The value that indicates whether the policy is enabled or not. - Status *AzureADAuthenticationAsArmPolicyStatus `json:"status,omitempty"` + Status *AzureADAuthenticationAsArmPolicyStatus } // BaseImageDependency - Properties that describe a base image dependency. type BaseImageDependency struct { // The sha256-based digest of the image manifest. - Digest *string `json:"digest,omitempty"` + Digest *string // The registry login server. - Registry *string `json:"registry,omitempty"` + Registry *string // The repository name. - Repository *string `json:"repository,omitempty"` + Repository *string // The tag name. - Tag *string `json:"tag,omitempty"` + Tag *string // The type of the base image dependency. - Type *BaseImageDependencyType `json:"type,omitempty"` + Type *BaseImageDependencyType } // BaseImageTrigger - The trigger based on base image dependency. type BaseImageTrigger struct { // REQUIRED; The type of the auto trigger for base image dependency updates. - BaseImageTriggerType *BaseImageTriggerType `json:"baseImageTriggerType,omitempty"` + BaseImageTriggerType *BaseImageTriggerType // REQUIRED; The name of the trigger. - Name *string `json:"name,omitempty"` + Name *string // The current status of trigger. - Status *TriggerStatus `json:"status,omitempty"` + Status *TriggerStatus // The endpoint URL for receiving update triggers. - UpdateTriggerEndpoint *string `json:"updateTriggerEndpoint,omitempty"` + UpdateTriggerEndpoint *string // Type of Payload body for Base image update triggers. - UpdateTriggerPayloadType *UpdateTriggerPayloadType `json:"updateTriggerPayloadType,omitempty"` + UpdateTriggerPayloadType *UpdateTriggerPayloadType } // BaseImageTriggerUpdateParameters - The properties for updating base image dependency trigger. type BaseImageTriggerUpdateParameters struct { // REQUIRED; The name of the trigger. - Name *string `json:"name,omitempty"` + Name *string // The type of the auto trigger for base image dependency updates. - BaseImageTriggerType *BaseImageTriggerType `json:"baseImageTriggerType,omitempty"` + BaseImageTriggerType *BaseImageTriggerType // The current status of trigger. - Status *TriggerStatus `json:"status,omitempty"` + Status *TriggerStatus // The endpoint URL for receiving update triggers. - UpdateTriggerEndpoint *string `json:"updateTriggerEndpoint,omitempty"` + UpdateTriggerEndpoint *string // Type of Payload body for Base image update triggers. - UpdateTriggerPayloadType *UpdateTriggerPayloadType `json:"updateTriggerPayloadType,omitempty"` + UpdateTriggerPayloadType *UpdateTriggerPayloadType } // CacheRule - An object that represents a cache rule for a container registry. type CacheRule struct { // The properties of the cache rule. - Properties *CacheRuleProperties `json:"properties,omitempty"` + Properties *CacheRuleProperties // READ-ONLY; The resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // CacheRuleProperties - The properties of a cache rule. type CacheRuleProperties struct { // The ARM resource ID of the credential store which is associated with the cache rule. - CredentialSetResourceID *string `json:"credentialSetResourceId,omitempty"` + CredentialSetResourceID *string // Source repository pulled from upstream. - SourceRepository *string `json:"sourceRepository,omitempty"` + SourceRepository *string // Target repository specified in docker pull command. Eg: docker pull myregistry.azurecr.io/{targetRepository}:{tag} - TargetRepository *string `json:"targetRepository,omitempty"` + TargetRepository *string // READ-ONLY; The creation date of the cache rule. - CreationDate *time.Time `json:"creationDate,omitempty" azure:"ro"` + CreationDate *time.Time // READ-ONLY; Provisioning state of the resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *ProvisioningState } // CacheRuleUpdateParameters - The parameters for updating a cache rule. type CacheRuleUpdateParameters struct { // The properties of the cache rule update parameters. - Properties *CacheRuleUpdateProperties `json:"properties,omitempty"` + Properties *CacheRuleUpdateProperties } // CacheRuleUpdateProperties - The parameters for updating cache rule properties. type CacheRuleUpdateProperties struct { // The ARM resource ID of the credential store which is associated with the Cache rule. - CredentialSetResourceID *string `json:"credentialSetResourceId,omitempty"` + CredentialSetResourceID *string } // CacheRulesClientBeginCreateOptions contains the optional parameters for the CacheRulesClient.BeginCreate method. @@ -347,19 +347,19 @@ type CacheRulesClientListOptions struct { // CacheRulesListResult - The result of a request to list cache rules for a container registry. type CacheRulesListResult struct { // If provided, client must use NextLink URI to request next list of cache rules. - NextLink *string `json:"nextLink,omitempty"` + NextLink *string // The list of cache rules. - Value []*CacheRule `json:"value,omitempty"` + Value []*CacheRule } // CallbackConfig - The configuration of service URI and custom headers for the webhook. type CallbackConfig struct { // REQUIRED; The service URI for the webhook to post notifications. - ServiceURI *string `json:"serviceUri,omitempty"` + ServiceURI *string // Custom headers that will be added to the webhook notifications. - CustomHeaders map[string]*string `json:"customHeaders,omitempty"` + CustomHeaders map[string]*string } // ConnectedRegistriesClientBeginCreateOptions contains the optional parameters for the ConnectedRegistriesClient.BeginCreate @@ -406,162 +406,162 @@ type ConnectedRegistriesClientListOptions struct { // ConnectedRegistry - An object that represents a connected registry for a container registry. type ConnectedRegistry struct { // The properties of the connected registry. - Properties *ConnectedRegistryProperties `json:"properties,omitempty"` + Properties *ConnectedRegistryProperties // READ-ONLY; The resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ConnectedRegistryListResult - The result of a request to list connected registries for a container registry. type ConnectedRegistryListResult struct { // The URI that can be used to request the next list of connected registries. - NextLink *string `json:"nextLink,omitempty"` + NextLink *string // The list of connected registries. Since this list may be incomplete, the nextLink field should be used to request the next // list of connected registries. - Value []*ConnectedRegistry `json:"value,omitempty"` + Value []*ConnectedRegistry } // ConnectedRegistryProperties - The properties of a connected registry. type ConnectedRegistryProperties struct { // REQUIRED; The mode of the connected registry resource that indicates the permissions of the registry. - Mode *ConnectedRegistryMode `json:"mode,omitempty"` + Mode *ConnectedRegistryMode // REQUIRED; The parent of the connected registry. - Parent *ParentProperties `json:"parent,omitempty"` + Parent *ParentProperties // The list of the ACR token resource IDs used to authenticate clients to the connected registry. - ClientTokenIDs []*string `json:"clientTokenIds,omitempty"` + ClientTokenIDs []*string // The logging properties of the connected registry. - Logging *LoggingProperties `json:"logging,omitempty"` + Logging *LoggingProperties // The login server properties of the connected registry. - LoginServer *LoginServerProperties `json:"loginServer,omitempty"` + LoginServer *LoginServerProperties // The list of notifications subscription information for the connected registry. - NotificationsList []*string `json:"notificationsList,omitempty"` + NotificationsList []*string // READ-ONLY; The activation properties of the connected registry. - Activation *ActivationProperties `json:"activation,omitempty" azure:"ro"` + Activation *ActivationProperties // READ-ONLY; The current connection state of the connected registry. - ConnectionState *ConnectionState `json:"connectionState,omitempty" azure:"ro"` + ConnectionState *ConnectionState // READ-ONLY; The last activity time of the connected registry. - LastActivityTime *time.Time `json:"lastActivityTime,omitempty" azure:"ro"` + LastActivityTime *time.Time // READ-ONLY; Provisioning state of the resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *ProvisioningState // READ-ONLY; The list of current statuses of the connected registry. - StatusDetails []*StatusDetailProperties `json:"statusDetails,omitempty" azure:"ro"` + StatusDetails []*StatusDetailProperties // READ-ONLY; The current version of ACR runtime on the connected registry. - Version *string `json:"version,omitempty" azure:"ro"` + Version *string } // ConnectedRegistryUpdateParameters - The parameters for updating a connected registry. type ConnectedRegistryUpdateParameters struct { // The properties of the connected registry update parameters. - Properties *ConnectedRegistryUpdateProperties `json:"properties,omitempty"` + Properties *ConnectedRegistryUpdateProperties } // ConnectedRegistryUpdateProperties - The parameters for updating token properties. type ConnectedRegistryUpdateProperties struct { // The list of the ACR token resource IDs used to authenticate clients to the connected registry. - ClientTokenIDs []*string `json:"clientTokenIds,omitempty"` + ClientTokenIDs []*string // The logging properties of the connected registry. - Logging *LoggingProperties `json:"logging,omitempty"` + Logging *LoggingProperties // The list of notifications subscription information for the connected registry. - NotificationsList []*string `json:"notificationsList,omitempty"` + NotificationsList []*string // The sync properties of the connected registry with its parent. - SyncProperties *SyncUpdateProperties `json:"syncProperties,omitempty"` + SyncProperties *SyncUpdateProperties } // CredentialHealth - The health of the auth credential. type CredentialHealth struct { // Error code representing the health check error. - ErrorCode *string `json:"errorCode,omitempty"` + ErrorCode *string // Descriptive message representing the health check error. - ErrorMessage *string `json:"errorMessage,omitempty"` + ErrorMessage *string // The health status of credential. - Status *CredentialHealthStatus `json:"status,omitempty"` + Status *CredentialHealthStatus } // CredentialSet - An object that represents a credential set resource for a container registry. type CredentialSet struct { // Identities associated with the resource. This is used to access the KeyVault secrets. - Identity *IdentityProperties `json:"identity,omitempty"` + Identity *IdentityProperties // The properties of the credential set. - Properties *CredentialSetProperties `json:"properties,omitempty"` + Properties *CredentialSetProperties // READ-ONLY; The resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // CredentialSetListResult - The result of a request to list credential sets for a container registry. type CredentialSetListResult struct { // The URI that can be used to request the next list of credential sets. - NextLink *string `json:"nextLink,omitempty"` + NextLink *string // The list of credential sets. Since this list may be incomplete, the nextLink field should be used to request the next list // of credential sets. - Value []*CredentialSet `json:"value,omitempty"` + Value []*CredentialSet } // CredentialSetProperties - The properties of a credential set resource. type CredentialSetProperties struct { // List of authentication credentials stored for an upstream. Usually consists of a primary and an optional secondary credential. - AuthCredentials []*AuthCredential `json:"authCredentials,omitempty"` + AuthCredentials []*AuthCredential // The credentials are stored for this upstream or login server. - LoginServer *string `json:"loginServer,omitempty"` + LoginServer *string // READ-ONLY; The creation date of credential store resource. - CreationDate *time.Time `json:"creationDate,omitempty" azure:"ro"` + CreationDate *time.Time // READ-ONLY; Provisioning state of the resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *ProvisioningState } // CredentialSetUpdateParameters - The parameters for updating a credential set type CredentialSetUpdateParameters struct { // Identities associated with the resource. This is used to access the KeyVault secrets. - Identity *IdentityProperties `json:"identity,omitempty"` + Identity *IdentityProperties // The properties of the credential set update parameters - Properties *CredentialSetUpdateProperties `json:"properties,omitempty"` + Properties *CredentialSetUpdateProperties } // CredentialSetUpdateProperties - The parameters for updating credential set properties. type CredentialSetUpdateProperties struct { // List of authentication credentials stored for an upstream. Usually consists of a primary and an optional secondary credential. - AuthCredentials []*AuthCredential `json:"authCredentials,omitempty"` + AuthCredentials []*AuthCredential } // CredentialSetsClientBeginCreateOptions contains the optional parameters for the CredentialSetsClient.BeginCreate method. @@ -597,10 +597,10 @@ type Credentials struct { // Describes the credential parameters for accessing other custom registries. The key for the dictionary item will be the // registry login server (myregistry.azurecr.io) and the value of the item will be // the registry credentials for accessing the registry. - CustomRegistries map[string]*CustomRegistryCredentials `json:"customRegistries,omitempty"` + CustomRegistries map[string]*CustomRegistryCredentials // Describes the credential parameters for accessing the source registry. - SourceRegistry *SourceRegistryCredentials `json:"sourceRegistry,omitempty"` + SourceRegistry *SourceRegistryCredentials } // CustomRegistryCredentials - Describes the credentials that will be used to access a custom registry during a run. @@ -610,63 +610,63 @@ type CustomRegistryCredentials struct { // system-assigned identity, the Client ID will be determined by the runner. This identity may be used to authenticate to // key vault to retrieve credentials or it may be the only source of authentication // used for accessing the registry. - Identity *string `json:"identity,omitempty"` + Identity *string // The password for logging into the custom registry. The password is a secret object that allows multiple ways of providing // the value for it. - Password *SecretObject `json:"password,omitempty"` + Password *SecretObject // The username for logging into the custom registry. - UserName *SecretObject `json:"userName,omitempty"` + UserName *SecretObject } // DockerBuildRequest - The parameters for a docker quick build. type DockerBuildRequest struct { // REQUIRED; The Docker file path relative to the source location. - DockerFilePath *string `json:"dockerFilePath,omitempty"` + DockerFilePath *string // REQUIRED; The platform properties against which the run has to happen. - Platform *PlatformProperties `json:"platform,omitempty"` + Platform *PlatformProperties // REQUIRED; The type of the run request. - Type *string `json:"type,omitempty"` + Type *string // The machine configuration of the run agent. - AgentConfiguration *AgentProperties `json:"agentConfiguration,omitempty"` + AgentConfiguration *AgentProperties // The dedicated agent pool for the run. - AgentPoolName *string `json:"agentPoolName,omitempty"` + AgentPoolName *string // The collection of override arguments to be used when executing the run. - Arguments []*Argument `json:"arguments,omitempty"` + Arguments []*Argument // The properties that describes a set of credentials that will be used when this run is invoked. - Credentials *Credentials `json:"credentials,omitempty"` + Credentials *Credentials // The fully qualified image names including the repository and tag. - ImageNames []*string `json:"imageNames,omitempty"` + ImageNames []*string // The value that indicates whether archiving is enabled for the run or not. - IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"` + IsArchiveEnabled *bool // The value of this property indicates whether the image built should be pushed to the registry or not. - IsPushEnabled *bool `json:"isPushEnabled,omitempty"` + IsPushEnabled *bool // The template that describes the repository and tag information for run log artifact. - LogTemplate *string `json:"logTemplate,omitempty"` + LogTemplate *string // The value of this property indicates whether the image cache is enabled or not. - NoCache *bool `json:"noCache,omitempty"` + NoCache *bool // The URL(absolute or relative) of the source context. It can be an URL to a tar or git repository. If it is relative URL, // the relative path should be obtained from calling listBuildSourceUploadUrl API. - SourceLocation *string `json:"sourceLocation,omitempty"` + SourceLocation *string // The name of the target build stage for the docker build. - Target *string `json:"target,omitempty"` + Target *string // Run timeout in seconds. - Timeout *int32 `json:"timeout,omitempty"` + Timeout *int32 } // GetRunRequest implements the RunRequestClassification interface for type DockerBuildRequest. @@ -682,34 +682,34 @@ func (d *DockerBuildRequest) GetRunRequest() *RunRequest { // DockerBuildStep - The Docker build step. type DockerBuildStep struct { // REQUIRED; The Docker file path relative to the source context. - DockerFilePath *string `json:"dockerFilePath,omitempty"` + DockerFilePath *string // REQUIRED; The type of the step. - Type *StepType `json:"type,omitempty"` + Type *StepType // The collection of override arguments to be used when executing this build step. - Arguments []*Argument `json:"arguments,omitempty"` + Arguments []*Argument // The token (git PAT or SAS token of storage account blob) associated with the context for a step. - ContextAccessToken *string `json:"contextAccessToken,omitempty"` + ContextAccessToken *string // The URL(absolute or relative) of the source context for the task step. - ContextPath *string `json:"contextPath,omitempty"` + ContextPath *string // The fully qualified image names including the repository and tag. - ImageNames []*string `json:"imageNames,omitempty"` + ImageNames []*string // The value of this property indicates whether the image built should be pushed to the registry or not. - IsPushEnabled *bool `json:"isPushEnabled,omitempty"` + IsPushEnabled *bool // The value of this property indicates whether the image cache is enabled or not. - NoCache *bool `json:"noCache,omitempty"` + NoCache *bool // The name of the target build stage for the docker build. - Target *string `json:"target,omitempty"` + Target *string // READ-ONLY; List of base image dependencies for a step. - BaseImageDependencies []*BaseImageDependency `json:"baseImageDependencies,omitempty" azure:"ro"` + BaseImageDependencies []*BaseImageDependency } // GetTaskStepProperties implements the TaskStepPropertiesClassification interface for type DockerBuildStep. @@ -725,31 +725,31 @@ func (d *DockerBuildStep) GetTaskStepProperties() *TaskStepProperties { // DockerBuildStepUpdateParameters - The properties for updating a docker build step. type DockerBuildStepUpdateParameters struct { // REQUIRED; The type of the step. - Type *StepType `json:"type,omitempty"` + Type *StepType // The collection of override arguments to be used when executing this build step. - Arguments []*Argument `json:"arguments,omitempty"` + Arguments []*Argument // The token (git PAT or SAS token of storage account blob) associated with the context for a step. - ContextAccessToken *string `json:"contextAccessToken,omitempty"` + ContextAccessToken *string // The URL(absolute or relative) of the source context for the task step. - ContextPath *string `json:"contextPath,omitempty"` + ContextPath *string // The Docker file path relative to the source context. - DockerFilePath *string `json:"dockerFilePath,omitempty"` + DockerFilePath *string // The fully qualified image names including the repository and tag. - ImageNames []*string `json:"imageNames,omitempty"` + ImageNames []*string // The value of this property indicates whether the image built should be pushed to the registry or not. - IsPushEnabled *bool `json:"isPushEnabled,omitempty"` + IsPushEnabled *bool // The value of this property indicates whether the image cache is enabled or not. - NoCache *bool `json:"noCache,omitempty"` + NoCache *bool // The name of the target build stage for the docker build. - Target *string `json:"target,omitempty"` + Target *string } // GetTaskStepUpdateParameters implements the TaskStepUpdateParametersClassification interface for type DockerBuildStepUpdateParameters. @@ -764,41 +764,41 @@ func (d *DockerBuildStepUpdateParameters) GetTaskStepUpdateParameters() *TaskSte // EncodedTaskRunRequest - The parameters for a quick task run request. type EncodedTaskRunRequest struct { // REQUIRED; Base64 encoded value of the template/definition file content. - EncodedTaskContent *string `json:"encodedTaskContent,omitempty"` + EncodedTaskContent *string // REQUIRED; The platform properties against which the run has to happen. - Platform *PlatformProperties `json:"platform,omitempty"` + Platform *PlatformProperties // REQUIRED; The type of the run request. - Type *string `json:"type,omitempty"` + Type *string // The machine configuration of the run agent. - AgentConfiguration *AgentProperties `json:"agentConfiguration,omitempty"` + AgentConfiguration *AgentProperties // The dedicated agent pool for the run. - AgentPoolName *string `json:"agentPoolName,omitempty"` + AgentPoolName *string // The properties that describes a set of credentials that will be used when this run is invoked. - Credentials *Credentials `json:"credentials,omitempty"` + Credentials *Credentials // Base64 encoded value of the parameters/values file content. - EncodedValuesContent *string `json:"encodedValuesContent,omitempty"` + EncodedValuesContent *string // The value that indicates whether archiving is enabled for the run or not. - IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"` + IsArchiveEnabled *bool // The template that describes the repository and tag information for run log artifact. - LogTemplate *string `json:"logTemplate,omitempty"` + LogTemplate *string // The URL(absolute or relative) of the source context. It can be an URL to a tar or git repository. If it is relative URL, // the relative path should be obtained from calling listBuildSourceUploadUrl API. - SourceLocation *string `json:"sourceLocation,omitempty"` + SourceLocation *string // Run timeout in seconds. - Timeout *int32 `json:"timeout,omitempty"` + Timeout *int32 // The collection of overridable values that can be passed when running a task. - Values []*SetValue `json:"values,omitempty"` + Values []*SetValue } // GetRunRequest implements the RunRequestClassification interface for type EncodedTaskRunRequest. @@ -814,25 +814,25 @@ func (e *EncodedTaskRunRequest) GetRunRequest() *RunRequest { // EncodedTaskStep - The properties of a encoded task step. type EncodedTaskStep struct { // REQUIRED; Base64 encoded value of the template/definition file content. - EncodedTaskContent *string `json:"encodedTaskContent,omitempty"` + EncodedTaskContent *string // REQUIRED; The type of the step. - Type *StepType `json:"type,omitempty"` + Type *StepType // The token (git PAT or SAS token of storage account blob) associated with the context for a step. - ContextAccessToken *string `json:"contextAccessToken,omitempty"` + ContextAccessToken *string // The URL(absolute or relative) of the source context for the task step. - ContextPath *string `json:"contextPath,omitempty"` + ContextPath *string // Base64 encoded value of the parameters/values file content. - EncodedValuesContent *string `json:"encodedValuesContent,omitempty"` + EncodedValuesContent *string // The collection of overridable values that can be passed when running a task. - Values []*SetValue `json:"values,omitempty"` + Values []*SetValue // READ-ONLY; List of base image dependencies for a step. - BaseImageDependencies []*BaseImageDependency `json:"baseImageDependencies,omitempty" azure:"ro"` + BaseImageDependencies []*BaseImageDependency } // GetTaskStepProperties implements the TaskStepPropertiesClassification interface for type EncodedTaskStep. @@ -848,22 +848,22 @@ func (e *EncodedTaskStep) GetTaskStepProperties() *TaskStepProperties { // EncodedTaskStepUpdateParameters - The properties for updating encoded task step. type EncodedTaskStepUpdateParameters struct { // REQUIRED; The type of the step. - Type *StepType `json:"type,omitempty"` + Type *StepType // The token (git PAT or SAS token of storage account blob) associated with the context for a step. - ContextAccessToken *string `json:"contextAccessToken,omitempty"` + ContextAccessToken *string // The URL(absolute or relative) of the source context for the task step. - ContextPath *string `json:"contextPath,omitempty"` + ContextPath *string // Base64 encoded value of the template/definition file content. - EncodedTaskContent *string `json:"encodedTaskContent,omitempty"` + EncodedTaskContent *string // Base64 encoded value of the parameters/values file content. - EncodedValuesContent *string `json:"encodedValuesContent,omitempty"` + EncodedValuesContent *string // The collection of overridable values that can be passed when running a task. - Values []*SetValue `json:"values,omitempty"` + Values []*SetValue } // GetTaskStepUpdateParameters implements the TaskStepUpdateParametersClassification interface for type EncodedTaskStepUpdateParameters. @@ -877,179 +877,179 @@ func (e *EncodedTaskStepUpdateParameters) GetTaskStepUpdateParameters() *TaskSte type EncryptionProperty struct { // Key vault properties. - KeyVaultProperties *KeyVaultProperties `json:"keyVaultProperties,omitempty"` + KeyVaultProperties *KeyVaultProperties // Indicates whether or not the encryption is enabled for container registry. - Status *EncryptionStatus `json:"status,omitempty"` + Status *EncryptionStatus } // ErrorResponse - An error response from the Azure Container Registry service. type ErrorResponse struct { // Azure container registry build API error body. - Error *ErrorResponseBody `json:"error,omitempty"` + Error *ErrorResponseBody } // ErrorResponseBody - An error response from the Azure Container Registry service. type ErrorResponseBody struct { // REQUIRED; error code. - Code *string `json:"code,omitempty"` + Code *string // REQUIRED; error message. - Message *string `json:"message,omitempty"` + Message *string // an array of additional nested error response info objects, as described by this contract. - Details []*InnerErrorDescription `json:"details,omitempty"` + Details []*InnerErrorDescription // target of the particular error. - Target *string `json:"target,omitempty"` + Target *string } // Event - The event for a webhook. type Event struct { // The event request message sent to the service URI. - EventRequestMessage *EventRequestMessage `json:"eventRequestMessage,omitempty"` + EventRequestMessage *EventRequestMessage // The event response message received from the service URI. - EventResponseMessage *EventResponseMessage `json:"eventResponseMessage,omitempty"` + EventResponseMessage *EventResponseMessage // The event ID. - ID *string `json:"id,omitempty"` + ID *string } // EventContent - The content of the event request message. type EventContent struct { // The action that encompasses the provided event. - Action *string `json:"action,omitempty"` + Action *string // The agent that initiated the event. For most situations, this could be from the authorization context of the request. - Actor *Actor `json:"actor,omitempty"` + Actor *Actor // The event ID. - ID *string `json:"id,omitempty"` + ID *string // The request that generated the event. - Request *Request `json:"request,omitempty"` + Request *Request // The registry node that generated the event. Put differently, while the actor initiates the event, the source generates // it. - Source *Source `json:"source,omitempty"` + Source *Source // The target of the event. - Target *Target `json:"target,omitempty"` + Target *Target // The time at which the event occurred. - Timestamp *time.Time `json:"timestamp,omitempty"` + Timestamp *time.Time } // EventInfo - The basic information of an event. type EventInfo struct { // The event ID. - ID *string `json:"id,omitempty"` + ID *string } // EventListResult - The result of a request to list events for a webhook. type EventListResult struct { // The URI that can be used to request the next list of events. - NextLink *string `json:"nextLink,omitempty"` + NextLink *string // The list of events. Since this list may be incomplete, the nextLink field should be used to request the next list of events. - Value []*Event `json:"value,omitempty"` + Value []*Event } // EventRequestMessage - The event request message sent to the service URI. type EventRequestMessage struct { // The content of the event request message. - Content *EventContent `json:"content,omitempty"` + Content *EventContent // The headers of the event request message. - Headers map[string]*string `json:"headers,omitempty"` + Headers map[string]*string // The HTTP method used to send the event request message. - Method *string `json:"method,omitempty"` + Method *string // The URI used to send the event request message. - RequestURI *string `json:"requestUri,omitempty"` + RequestURI *string // The HTTP message version. - Version *string `json:"version,omitempty"` + Version *string } // EventResponseMessage - The event response message received from the service URI. type EventResponseMessage struct { // The content of the event response message. - Content *string `json:"content,omitempty"` + Content *string // The headers of the event response message. - Headers map[string]*string `json:"headers,omitempty"` + Headers map[string]*string // The reason phrase of the event response message. - ReasonPhrase *string `json:"reasonPhrase,omitempty"` + ReasonPhrase *string // The status code of the event response message. - StatusCode *string `json:"statusCode,omitempty"` + StatusCode *string // The HTTP message version. - Version *string `json:"version,omitempty"` + Version *string } // ExportPipeline - An object that represents an export pipeline for a container registry. type ExportPipeline struct { // The identity of the export pipeline. - Identity *IdentityProperties `json:"identity,omitempty"` + Identity *IdentityProperties // The location of the export pipeline. - Location *string `json:"location,omitempty"` + Location *string // The properties of the export pipeline. - Properties *ExportPipelineProperties `json:"properties,omitempty"` + Properties *ExportPipelineProperties // READ-ONLY; The resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ExportPipelineListResult - The result of a request to list export pipelines for a container registry. type ExportPipelineListResult struct { // The URI that can be used to request the next list of pipeline runs. - NextLink *string `json:"nextLink,omitempty"` + NextLink *string // The list of export pipelines. Since this list may be incomplete, the nextLink field should be used to request the next // list of export pipelines. - Value []*ExportPipeline `json:"value,omitempty"` + Value []*ExportPipeline } // ExportPipelineProperties - The properties of an export pipeline. type ExportPipelineProperties struct { // REQUIRED; The target properties of the export pipeline. - Target *ExportPipelineTargetProperties `json:"target,omitempty"` + Target *ExportPipelineTargetProperties // The list of all options configured for the pipeline. - Options []*PipelineOptions `json:"options,omitempty"` + Options []*PipelineOptions // READ-ONLY; The provisioning state of the pipeline at the time the operation was called. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *ProvisioningState } // ExportPipelineTargetProperties - The properties of the export pipeline target. type ExportPipelineTargetProperties struct { // REQUIRED; They key vault secret uri to obtain the target storage SAS token. - KeyVaultURI *string `json:"keyVaultUri,omitempty"` + KeyVaultURI *string // The type of target for the export pipeline. - Type *string `json:"type,omitempty"` + Type *string // The target uri of the export pipeline. When 'AzureStorageBlob': "https://accountName.blob.core.windows.net/containerName/blobName" // When 'AzureStorageBlobContainer': // "https://accountName.blob.core.windows.net/containerName" - URI *string `json:"uri,omitempty"` + URI *string } // ExportPipelinesClientBeginCreateOptions contains the optional parameters for the ExportPipelinesClient.BeginCreate method. @@ -1077,47 +1077,47 @@ type ExportPipelinesClientListOptions struct { // ExportPolicy - The export policy for a container registry. type ExportPolicy struct { // The value that indicates whether the policy is enabled or not. - Status *ExportPolicyStatus `json:"status,omitempty"` + Status *ExportPolicyStatus } // FileTaskRunRequest - The request parameters for a scheduling run against a task file. type FileTaskRunRequest struct { // REQUIRED; The platform properties against which the run has to happen. - Platform *PlatformProperties `json:"platform,omitempty"` + Platform *PlatformProperties // REQUIRED; The template/definition file path relative to the source. - TaskFilePath *string `json:"taskFilePath,omitempty"` + TaskFilePath *string // REQUIRED; The type of the run request. - Type *string `json:"type,omitempty"` + Type *string // The machine configuration of the run agent. - AgentConfiguration *AgentProperties `json:"agentConfiguration,omitempty"` + AgentConfiguration *AgentProperties // The dedicated agent pool for the run. - AgentPoolName *string `json:"agentPoolName,omitempty"` + AgentPoolName *string // The properties that describes a set of credentials that will be used when this run is invoked. - Credentials *Credentials `json:"credentials,omitempty"` + Credentials *Credentials // The value that indicates whether archiving is enabled for the run or not. - IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"` + IsArchiveEnabled *bool // The template that describes the repository and tag information for run log artifact. - LogTemplate *string `json:"logTemplate,omitempty"` + LogTemplate *string // The URL(absolute or relative) of the source context. It can be an URL to a tar or git repository. If it is relative URL, // the relative path should be obtained from calling listBuildSourceUploadUrl API. - SourceLocation *string `json:"sourceLocation,omitempty"` + SourceLocation *string // Run timeout in seconds. - Timeout *int32 `json:"timeout,omitempty"` + Timeout *int32 // The collection of overridable values that can be passed when running a task. - Values []*SetValue `json:"values,omitempty"` + Values []*SetValue // The values/parameters file path relative to the source. - ValuesFilePath *string `json:"valuesFilePath,omitempty"` + ValuesFilePath *string } // GetRunRequest implements the RunRequestClassification interface for type FileTaskRunRequest. @@ -1133,25 +1133,25 @@ func (f *FileTaskRunRequest) GetRunRequest() *RunRequest { // FileTaskStep - The properties of a task step. type FileTaskStep struct { // REQUIRED; The task template/definition file path relative to the source context. - TaskFilePath *string `json:"taskFilePath,omitempty"` + TaskFilePath *string // REQUIRED; The type of the step. - Type *StepType `json:"type,omitempty"` + Type *StepType // The token (git PAT or SAS token of storage account blob) associated with the context for a step. - ContextAccessToken *string `json:"contextAccessToken,omitempty"` + ContextAccessToken *string // The URL(absolute or relative) of the source context for the task step. - ContextPath *string `json:"contextPath,omitempty"` + ContextPath *string // The collection of overridable values that can be passed when running a task. - Values []*SetValue `json:"values,omitempty"` + Values []*SetValue // The task values/parameters file path relative to the source context. - ValuesFilePath *string `json:"valuesFilePath,omitempty"` + ValuesFilePath *string // READ-ONLY; List of base image dependencies for a step. - BaseImageDependencies []*BaseImageDependency `json:"baseImageDependencies,omitempty" azure:"ro"` + BaseImageDependencies []*BaseImageDependency } // GetTaskStepProperties implements the TaskStepPropertiesClassification interface for type FileTaskStep. @@ -1167,22 +1167,22 @@ func (f *FileTaskStep) GetTaskStepProperties() *TaskStepProperties { // FileTaskStepUpdateParameters - The properties of updating a task step. type FileTaskStepUpdateParameters struct { // REQUIRED; The type of the step. - Type *StepType `json:"type,omitempty"` + Type *StepType // The token (git PAT or SAS token of storage account blob) associated with the context for a step. - ContextAccessToken *string `json:"contextAccessToken,omitempty"` + ContextAccessToken *string // The URL(absolute or relative) of the source context for the task step. - ContextPath *string `json:"contextPath,omitempty"` + ContextPath *string // The task template/definition file path relative to the source context. - TaskFilePath *string `json:"taskFilePath,omitempty"` + TaskFilePath *string // The collection of overridable values that can be passed when running a task. - Values []*SetValue `json:"values,omitempty"` + Values []*SetValue // The values/parameters file path relative to the source context. - ValuesFilePath *string `json:"valuesFilePath,omitempty"` + ValuesFilePath *string } // GetTaskStepUpdateParameters implements the TaskStepUpdateParametersClassification interface for type FileTaskStepUpdateParameters. @@ -1198,154 +1198,154 @@ func (f *FileTaskStepUpdateParameters) GetTaskStepUpdateParameters() *TaskStepUp // registry. type GenerateCredentialsParameters struct { // The expiry date of the generated credentials after which the credentials become invalid. - Expiry *time.Time `json:"expiry,omitempty"` + Expiry *time.Time // Specifies name of the password which should be regenerated if any -- password1 or password2. - Name *TokenPasswordName `json:"name,omitempty"` + Name *TokenPasswordName // The resource ID of the token for which credentials have to be generated. - TokenID *string `json:"tokenId,omitempty"` + TokenID *string } // GenerateCredentialsResult - The response from the GenerateCredentials operation. type GenerateCredentialsResult struct { // The list of passwords for a container registry. - Passwords []*TokenPassword `json:"passwords,omitempty"` + Passwords []*TokenPassword // The username for a container registry. - Username *string `json:"username,omitempty"` + Username *string } // IPRule - IP rule with specific IP or IP range in CIDR format. type IPRule struct { // REQUIRED; Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. - IPAddressOrRange *string `json:"value,omitempty"` + IPAddressOrRange *string // The action of IP ACL rule. - Action *Action `json:"action,omitempty"` + Action *Action } // IdentityProperties - Managed identity for the resource. type IdentityProperties struct { // The principal ID of resource identity. - PrincipalID *string `json:"principalId,omitempty"` + PrincipalID *string // The tenant ID of resource. - TenantID *string `json:"tenantId,omitempty"` + TenantID *string // The identity type. - Type *ResourceIdentityType `json:"type,omitempty"` + Type *ResourceIdentityType // The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource // ids in the form: // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - UserAssignedIdentities map[string]*UserIdentityProperties `json:"userAssignedIdentities,omitempty"` + UserAssignedIdentities map[string]*UserIdentityProperties } // ImageDescriptor - Properties for a registry image. type ImageDescriptor struct { // The sha256-based digest of the image manifest. - Digest *string `json:"digest,omitempty"` + Digest *string // The registry login server. - Registry *string `json:"registry,omitempty"` + Registry *string // The repository name. - Repository *string `json:"repository,omitempty"` + Repository *string // The tag name. - Tag *string `json:"tag,omitempty"` + Tag *string } // ImageUpdateTrigger - The image update trigger that caused a build. type ImageUpdateTrigger struct { // The unique ID of the trigger. - ID *string `json:"id,omitempty"` + ID *string // The list of image updates that caused the build. - Images []*ImageDescriptor `json:"images,omitempty"` + Images []*ImageDescriptor // The timestamp when the image update happened. - Timestamp *time.Time `json:"timestamp,omitempty"` + Timestamp *time.Time } type ImportImageParameters struct { // REQUIRED; The source of the image. - Source *ImportSource `json:"source,omitempty"` + Source *ImportSource // When Force, any existing target tags will be overwritten. When NoForce, any existing target tags will fail the operation // before any copying begins. - Mode *ImportMode `json:"mode,omitempty"` + Mode *ImportMode // List of strings of the form repo[:tag]. When tag is omitted the source will be used (or 'latest' if source tag is also // omitted). - TargetTags []*string `json:"targetTags,omitempty"` + TargetTags []*string // List of strings of repository names to do a manifest only copy. No tag will be created. - UntaggedTargetRepositories []*string `json:"untaggedTargetRepositories,omitempty"` + UntaggedTargetRepositories []*string } // ImportPipeline - An object that represents an import pipeline for a container registry. type ImportPipeline struct { // The identity of the import pipeline. - Identity *IdentityProperties `json:"identity,omitempty"` + Identity *IdentityProperties // The location of the import pipeline. - Location *string `json:"location,omitempty"` + Location *string // The properties of the import pipeline. - Properties *ImportPipelineProperties `json:"properties,omitempty"` + Properties *ImportPipelineProperties // READ-ONLY; The resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ImportPipelineListResult - The result of a request to list import pipelines for a container registry. type ImportPipelineListResult struct { // The URI that can be used to request the next list of pipeline runs. - NextLink *string `json:"nextLink,omitempty"` + NextLink *string // The list of import pipelines. Since this list may be incomplete, the nextLink field should be used to request the next // list of import pipelines. - Value []*ImportPipeline `json:"value,omitempty"` + Value []*ImportPipeline } // ImportPipelineProperties - The properties of an import pipeline. type ImportPipelineProperties struct { // REQUIRED; The source properties of the import pipeline. - Source *ImportPipelineSourceProperties `json:"source,omitempty"` + Source *ImportPipelineSourceProperties // The list of all options configured for the pipeline. - Options []*PipelineOptions `json:"options,omitempty"` + Options []*PipelineOptions // The properties that describe the trigger of the import pipeline. - Trigger *PipelineTriggerProperties `json:"trigger,omitempty"` + Trigger *PipelineTriggerProperties // READ-ONLY; The provisioning state of the pipeline at the time the operation was called. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *ProvisioningState } // ImportPipelineSourceProperties - The properties of the import pipeline source. type ImportPipelineSourceProperties struct { // REQUIRED; They key vault secret uri to obtain the source storage SAS token. - KeyVaultURI *string `json:"keyVaultUri,omitempty"` + KeyVaultURI *string // The type of source for the import pipeline. - Type *PipelineSourceType `json:"type,omitempty"` + Type *PipelineSourceType // The source uri of the import pipeline. When 'AzureStorageBlob': "https://accountName.blob.core.windows.net/containerName/blobName" // When 'AzureStorageBlobContainer': // "https://accountName.blob.core.windows.net/containerName" - URI *string `json:"uri,omitempty"` + URI *string } // ImportPipelinesClientBeginCreateOptions contains the optional parameters for the ImportPipelinesClient.BeginCreate method. @@ -1374,171 +1374,171 @@ type ImportSource struct { // REQUIRED; Repository name of the source image. Specify an image by repository ('hello-world'). This will use the 'latest' // tag. Specify an image by tag ('hello-world:latest'). Specify an image by sha256-based // manifest digest ('hello-world@sha256:abc123'). - SourceImage *string `json:"sourceImage,omitempty"` + SourceImage *string // Credentials used when importing from a registry uri. - Credentials *ImportSourceCredentials `json:"credentials,omitempty"` + Credentials *ImportSourceCredentials // The address of the source registry (e.g. 'mcr.microsoft.com'). - RegistryURI *string `json:"registryUri,omitempty"` + RegistryURI *string // The resource identifier of the source Azure Container Registry. - ResourceID *string `json:"resourceId,omitempty"` + ResourceID *string } type ImportSourceCredentials struct { // REQUIRED; The password used to authenticate with the source registry. - Password *string `json:"password,omitempty"` + Password *string // The username to authenticate with the source registry. - Username *string `json:"username,omitempty"` + Username *string } // InnerErrorDescription - inner error. type InnerErrorDescription struct { // REQUIRED; error code. - Code *string `json:"code,omitempty"` + Code *string // REQUIRED; error message. - Message *string `json:"message,omitempty"` + Message *string // target of the particular error. - Target *string `json:"target,omitempty"` + Target *string } type KeyVaultProperties struct { // The client id of the identity which will be used to access key vault. - Identity *string `json:"identity,omitempty"` + Identity *string // Key vault uri to access the encryption key. - KeyIdentifier *string `json:"keyIdentifier,omitempty"` + KeyIdentifier *string // READ-ONLY; Auto key rotation status for a CMK enabled registry. - KeyRotationEnabled *bool `json:"keyRotationEnabled,omitempty" azure:"ro"` + KeyRotationEnabled *bool // READ-ONLY; Timestamp of the last successful key rotation. - LastKeyRotationTimestamp *time.Time `json:"lastKeyRotationTimestamp,omitempty" azure:"ro"` + LastKeyRotationTimestamp *time.Time // READ-ONLY; The fully qualified key identifier that includes the version of the key that is actually used for encryption. - VersionedKeyIdentifier *string `json:"versionedKeyIdentifier,omitempty" azure:"ro"` + VersionedKeyIdentifier *string } // LoggingProperties - The logging properties of the connected registry. type LoggingProperties struct { // Indicates whether audit logs are enabled on the connected registry. - AuditLogStatus *AuditLogStatus `json:"auditLogStatus,omitempty"` + AuditLogStatus *AuditLogStatus // The verbosity of logs persisted on the connected registry. - LogLevel *LogLevel `json:"logLevel,omitempty"` + LogLevel *LogLevel } // LoginServerProperties - The login server properties of the connected registry. type LoginServerProperties struct { // READ-ONLY; The host of the connected registry. Can be FQDN or IP. - Host *string `json:"host,omitempty" azure:"ro"` + Host *string // READ-ONLY; The TLS properties of the connected registry login server. - TLS *TLSProperties `json:"tls,omitempty" azure:"ro"` + TLS *TLSProperties } // NetworkRuleSet - The network rule set for a container registry. type NetworkRuleSet struct { // REQUIRED; The default action of allow or deny when no other rules match. - DefaultAction *DefaultAction `json:"defaultAction,omitempty"` + DefaultAction *DefaultAction // The IP ACL rules. - IPRules []*IPRule `json:"ipRules,omitempty"` + IPRules []*IPRule } // OperationDefinition - The definition of a container registry operation. type OperationDefinition struct { // The display information for the container registry operation. - Display *OperationDisplayDefinition `json:"display,omitempty"` + Display *OperationDisplayDefinition // This property indicates if the operation is an action or a data action ref: https://docs.microsoft.com/en-us/azure/role-based-access-control/role-definitions#management-and-data-operations - IsDataAction *bool `json:"isDataAction,omitempty"` + IsDataAction *bool // Operation name: {provider}/{resource}/{operation}. - Name *string `json:"name,omitempty"` + Name *string // The origin information of the container registry operation. - Origin *string `json:"origin,omitempty"` + Origin *string // The properties information for the container registry operation. - Properties *OperationPropertiesDefinition `json:"properties,omitempty"` + Properties *OperationPropertiesDefinition } // OperationDisplayDefinition - The display information for a container registry operation. type OperationDisplayDefinition struct { // The description for the operation. - Description *string `json:"description,omitempty"` + Description *string // The operation that users can perform. - Operation *string `json:"operation,omitempty"` + Operation *string // The resource provider name: Microsoft.ContainerRegistry. - Provider *string `json:"provider,omitempty"` + Provider *string // The resource on which the operation is performed. - Resource *string `json:"resource,omitempty"` + Resource *string } // OperationListResult - The result of a request to list container registry operations. type OperationListResult struct { // The URI that can be used to request the next list of container registry operations. - NextLink *string `json:"nextLink,omitempty"` + NextLink *string // The list of container registry operations. Since this list may be incomplete, the nextLink field should be used to request // the next list of operations. - Value []*OperationDefinition `json:"value,omitempty"` + Value []*OperationDefinition } // OperationLogSpecificationDefinition - The definition of Azure Monitoring log. type OperationLogSpecificationDefinition struct { // Log blob duration. - BlobDuration *string `json:"blobDuration,omitempty"` + BlobDuration *string // Log display name. - DisplayName *string `json:"displayName,omitempty"` + DisplayName *string // Log name. - Name *string `json:"name,omitempty"` + Name *string } // OperationMetricSpecificationDefinition - The definition of Azure Monitoring metric. type OperationMetricSpecificationDefinition struct { // Metric aggregation type. - AggregationType *string `json:"aggregationType,omitempty"` + AggregationType *string // Metric description. - DisplayDescription *string `json:"displayDescription,omitempty"` + DisplayDescription *string // Metric display name. - DisplayName *string `json:"displayName,omitempty"` + DisplayName *string // Internal metric name. - InternalMetricName *string `json:"internalMetricName,omitempty"` + InternalMetricName *string // Metric name. - Name *string `json:"name,omitempty"` + Name *string // Metric unit. - Unit *string `json:"unit,omitempty"` + Unit *string } // OperationPropertiesDefinition - The definition of Azure Monitoring properties. type OperationPropertiesDefinition struct { // The definition of Azure Monitoring service. - ServiceSpecification *OperationServiceSpecificationDefinition `json:"serviceSpecification,omitempty"` + ServiceSpecification *OperationServiceSpecificationDefinition } // OperationServiceSpecificationDefinition - The definition of Azure Monitoring list. type OperationServiceSpecificationDefinition struct { // A list of Azure Monitoring log definitions. - LogSpecifications []*OperationLogSpecificationDefinition `json:"logSpecifications,omitempty"` + LogSpecifications []*OperationLogSpecificationDefinition // A list of Azure Monitoring metrics definition. - MetricSpecifications []*OperationMetricSpecificationDefinition `json:"metricSpecifications,omitempty"` + MetricSpecifications []*OperationMetricSpecificationDefinition } // OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. @@ -1548,83 +1548,83 @@ type OperationsClientListOptions struct { type OverrideTaskStepProperties struct { // Gets or sets the collection of override arguments to be used when executing a build step. - Arguments []*Argument `json:"arguments,omitempty"` + Arguments []*Argument // The source context against which run has to be queued. - ContextPath *string `json:"contextPath,omitempty"` + ContextPath *string // The file against which run has to be queued. - File *string `json:"file,omitempty"` + File *string // The name of the target build stage for the docker build. - Target *string `json:"target,omitempty"` + Target *string // Base64 encoded update trigger token that will be attached with the base image trigger webhook. - UpdateTriggerToken *string `json:"updateTriggerToken,omitempty"` + UpdateTriggerToken *string // The collection of overridable values that can be passed when running a Task. - Values []*SetValue `json:"values,omitempty"` + Values []*SetValue } // PackageType - The properties of a package type. type PackageType struct { // The name of the package type. - Name *string `json:"name,omitempty"` + Name *string // READ-ONLY; The endpoint of the package type. - Endpoint *string `json:"endpoint,omitempty" azure:"ro"` + Endpoint *string } // ParentProperties - The properties of the connected registry parent. type ParentProperties struct { // REQUIRED; The sync properties of the connected registry with its parent. - SyncProperties *SyncProperties `json:"syncProperties,omitempty"` + SyncProperties *SyncProperties // The resource ID of the parent to which the connected registry will be associated. - ID *string `json:"id,omitempty"` + ID *string } // PipelineRun - An object that represents a pipeline run for a container registry. type PipelineRun struct { // The properties of a pipeline run. - Properties *PipelineRunProperties `json:"properties,omitempty"` + Properties *PipelineRunProperties // READ-ONLY; The resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // PipelineRunListResult - The result of a request to list pipeline runs for a container registry. type PipelineRunListResult struct { // The URI that can be used to request the next list of pipeline runs. - NextLink *string `json:"nextLink,omitempty"` + NextLink *string // The list of pipeline runs. Since this list may be incomplete, the nextLink field should be used to request the next list // of pipeline runs. - Value []*PipelineRun `json:"value,omitempty"` + Value []*PipelineRun } // PipelineRunProperties - The properties of a pipeline run. type PipelineRunProperties struct { // How the pipeline run should be forced to recreate even if the pipeline run configuration has not changed. - ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` + ForceUpdateTag *string // The request parameters for a pipeline run. - Request *PipelineRunRequest `json:"request,omitempty"` + Request *PipelineRunRequest // READ-ONLY; The provisioning state of a pipeline run. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *ProvisioningState // READ-ONLY; The response of a pipeline run. - Response *PipelineRunResponse `json:"response,omitempty" azure:"ro"` + Response *PipelineRunResponse } // PipelineRunRequest - The request properties provided for a pipeline run. @@ -1632,68 +1632,68 @@ type PipelineRunRequest struct { // List of source artifacts to be transferred by the pipeline. Specify an image by repository ('hello-world'). This will use // the 'latest' tag. Specify an image by tag ('hello-world:latest'). Specify an // image by sha256-based manifest digest ('hello-world@sha256:abc123'). - Artifacts []*string `json:"artifacts,omitempty"` + Artifacts []*string // The digest of the tar used to transfer the artifacts. - CatalogDigest *string `json:"catalogDigest,omitempty"` + CatalogDigest *string // The resource ID of the pipeline to run. - PipelineResourceID *string `json:"pipelineResourceId,omitempty"` + PipelineResourceID *string // The source properties of the pipeline run. - Source *PipelineRunSourceProperties `json:"source,omitempty"` + Source *PipelineRunSourceProperties // The target properties of the pipeline run. - Target *PipelineRunTargetProperties `json:"target,omitempty"` + Target *PipelineRunTargetProperties } // PipelineRunResponse - The response properties returned for a pipeline run. type PipelineRunResponse struct { // The digest of the tar used to transfer the artifacts. - CatalogDigest *string `json:"catalogDigest,omitempty"` + CatalogDigest *string // The time the pipeline run finished. - FinishTime *time.Time `json:"finishTime,omitempty"` + FinishTime *time.Time // The artifacts imported in the pipeline run. - ImportedArtifacts []*string `json:"importedArtifacts,omitempty"` + ImportedArtifacts []*string // The detailed error message for the pipeline run in the case of failure. - PipelineRunErrorMessage *string `json:"pipelineRunErrorMessage,omitempty"` + PipelineRunErrorMessage *string // The current progress of the copy operation. - Progress *ProgressProperties `json:"progress,omitempty"` + Progress *ProgressProperties // The source of the pipeline run. - Source *ImportPipelineSourceProperties `json:"source,omitempty"` + Source *ImportPipelineSourceProperties // The time the pipeline run started. - StartTime *time.Time `json:"startTime,omitempty"` + StartTime *time.Time // The current status of the pipeline run. - Status *string `json:"status,omitempty"` + Status *string // The target of the pipeline run. - Target *ExportPipelineTargetProperties `json:"target,omitempty"` + Target *ExportPipelineTargetProperties // The trigger that caused the pipeline run. - Trigger *PipelineTriggerDescriptor `json:"trigger,omitempty"` + Trigger *PipelineTriggerDescriptor } type PipelineRunSourceProperties struct { // The name of the source. - Name *string `json:"name,omitempty"` + Name *string // The type of the source. - Type *PipelineRunSourceType `json:"type,omitempty"` + Type *PipelineRunSourceType } type PipelineRunTargetProperties struct { // The name of the target. - Name *string `json:"name,omitempty"` + Name *string // The type of the target. - Type *PipelineRunTargetType `json:"type,omitempty"` + Type *PipelineRunTargetType } // PipelineRunsClientBeginCreateOptions contains the optional parameters for the PipelineRunsClient.BeginCreate method. @@ -1720,113 +1720,113 @@ type PipelineRunsClientListOptions struct { type PipelineSourceTriggerDescriptor struct { // The timestamp when the source update happened. - Timestamp *time.Time `json:"timestamp,omitempty"` + Timestamp *time.Time } type PipelineSourceTriggerProperties struct { // REQUIRED; The current status of the source trigger. - Status *TriggerStatus `json:"status,omitempty"` + Status *TriggerStatus } type PipelineTriggerDescriptor struct { // The source trigger that caused the pipeline run. - SourceTrigger *PipelineSourceTriggerDescriptor `json:"sourceTrigger,omitempty"` + SourceTrigger *PipelineSourceTriggerDescriptor } type PipelineTriggerProperties struct { // The source trigger properties of the pipeline. - SourceTrigger *PipelineSourceTriggerProperties `json:"sourceTrigger,omitempty"` + SourceTrigger *PipelineSourceTriggerProperties } // PlatformProperties - The platform properties against which the run has to happen. type PlatformProperties struct { // REQUIRED; The operating system type required for the run. - OS *OS `json:"os,omitempty"` + OS *OS // The OS architecture. - Architecture *Architecture `json:"architecture,omitempty"` + Architecture *Architecture // Variant of the CPU. - Variant *Variant `json:"variant,omitempty"` + Variant *Variant } // PlatformUpdateParameters - The properties for updating the platform configuration. type PlatformUpdateParameters struct { // The OS architecture. - Architecture *Architecture `json:"architecture,omitempty"` + Architecture *Architecture // The operating system type required for the run. - OS *OS `json:"os,omitempty"` + OS *OS // Variant of the CPU. - Variant *Variant `json:"variant,omitempty"` + Variant *Variant } // Policies - The policies for a container registry. type Policies struct { // The policy for using ARM audience token for a container registry. - AzureADAuthenticationAsArmPolicy *AzureADAuthenticationAsArmPolicy `json:"azureADAuthenticationAsArmPolicy,omitempty"` + AzureADAuthenticationAsArmPolicy *AzureADAuthenticationAsArmPolicy // The export policy for a container registry. - ExportPolicy *ExportPolicy `json:"exportPolicy,omitempty"` + ExportPolicy *ExportPolicy // The quarantine policy for a container registry. - QuarantinePolicy *QuarantinePolicy `json:"quarantinePolicy,omitempty"` + QuarantinePolicy *QuarantinePolicy // The retention policy for a container registry. - RetentionPolicy *RetentionPolicy `json:"retentionPolicy,omitempty"` + RetentionPolicy *RetentionPolicy // The soft delete policy for a container registry. - SoftDeletePolicy *SoftDeletePolicy `json:"softDeletePolicy,omitempty"` + SoftDeletePolicy *SoftDeletePolicy // The content trust policy for a container registry. - TrustPolicy *TrustPolicy `json:"trustPolicy,omitempty"` + TrustPolicy *TrustPolicy } // PrivateEndpoint - The Private Endpoint resource. type PrivateEndpoint struct { // This is private endpoint resource created with Microsoft.Network resource provider. - ID *string `json:"id,omitempty"` + ID *string } // PrivateEndpointConnection - An object that represents a private endpoint connection for a container registry. type PrivateEndpointConnection struct { // The properties of a private endpoint connection. - Properties *PrivateEndpointConnectionProperties `json:"properties,omitempty"` + Properties *PrivateEndpointConnectionProperties // READ-ONLY; The resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // PrivateEndpointConnectionListResult - The result of a request to list private endpoint connections for a container registry. type PrivateEndpointConnectionListResult struct { // The URI that can be used to request the next list of private endpoint connections. - NextLink *string `json:"nextLink,omitempty"` + NextLink *string // The list of private endpoint connections. Since this list may be incomplete, the nextLink field should be used to request // the next list of private endpoint connections. - Value []*PrivateEndpointConnection `json:"value,omitempty"` + Value []*PrivateEndpointConnection } // PrivateEndpointConnectionProperties - The properties of a private endpoint connection. type PrivateEndpointConnectionProperties struct { // The resource of private endpoint. - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateEndpoint *PrivateEndpoint // A collection of information about the state of the connection between service consumer and provider. - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState // READ-ONLY; The provisioning state of private endpoint connection resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *ProvisioningState } // PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginCreateOrUpdate @@ -1858,83 +1858,83 @@ type PrivateEndpointConnectionsClientListOptions struct { // PrivateLinkResource - A resource that supports private link capabilities. type PrivateLinkResource struct { // The resource ID. - ID *string `json:"id,omitempty"` + ID *string // The name of the resource. - Name *string `json:"name,omitempty"` + Name *string // A resource that supports private link capabilities. - Properties *PrivateLinkResourceProperties `json:"properties,omitempty"` + Properties *PrivateLinkResourceProperties // READ-ONLY; The resource type is private link resource. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // PrivateLinkResourceListResult - The result of a request to list private link resources for a container registry. type PrivateLinkResourceListResult struct { // The URI that can be used to request the next list of private link resources. - NextLink *string `json:"nextLink,omitempty"` + NextLink *string // The list of private link resources. Since this list may be incomplete, the nextLink field should be used to request the // next list of private link resources. - Value []*PrivateLinkResource `json:"value,omitempty"` + Value []*PrivateLinkResource } // PrivateLinkResourceProperties - The properties of a private link resource. type PrivateLinkResourceProperties struct { // The private link resource group id. - GroupID *string `json:"groupId,omitempty"` + GroupID *string // The private link resource required member names. - RequiredMembers []*string `json:"requiredMembers,omitempty"` + RequiredMembers []*string // The private link resource Private link DNS zone name. - RequiredZoneNames []*string `json:"requiredZoneNames,omitempty"` + RequiredZoneNames []*string } // PrivateLinkServiceConnectionState - The state of a private link service connection. type PrivateLinkServiceConnectionState struct { // A message indicating if changes on the service provider require any updates on the consumer. - ActionsRequired *ActionsRequired `json:"actionsRequired,omitempty"` + ActionsRequired *ActionsRequired // The description for connection status. For example if connection is rejected it can indicate reason for rejection. - Description *string `json:"description,omitempty"` + Description *string // The private link service connection status. - Status *ConnectionStatus `json:"status,omitempty"` + Status *ConnectionStatus } type ProgressProperties struct { // The percentage complete of the copy operation. - Percentage *string `json:"percentage,omitempty"` + Percentage *string } // ProxyResource - The resource model definition for a ARM proxy resource. It will have everything other than required location // and tags. type ProxyResource struct { // READ-ONLY; The resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // QuarantinePolicy - The quarantine policy for a container registry. type QuarantinePolicy struct { // The value that indicates whether the policy is enabled or not. - Status *PolicyStatus `json:"status,omitempty"` + Status *PolicyStatus } // RegenerateCredentialParameters - The parameters used to regenerate the login credential. type RegenerateCredentialParameters struct { // REQUIRED; Specifies name of the password which should be regenerated -- password or password2. - Name *PasswordName `json:"name,omitempty"` + Name *PasswordName } // RegistriesClientBeginCreateOptions contains the optional parameters for the RegistriesClient.BeginCreate method. @@ -2033,226 +2033,226 @@ type RegistriesClientRegenerateCredentialOptions struct { // Registry - An object that represents a container registry. type Registry struct { // REQUIRED; The location of the resource. This cannot be changed after the resource is created. - Location *string `json:"location,omitempty"` + Location *string // REQUIRED; The SKU of the container registry. - SKU *SKU `json:"sku,omitempty"` + SKU *SKU // The identity of the container registry. - Identity *IdentityProperties `json:"identity,omitempty"` + Identity *IdentityProperties // The properties of the container registry. - Properties *RegistryProperties `json:"properties,omitempty"` + Properties *RegistryProperties // The tags of the resource. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; The resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // RegistryListCredentialsResult - The response from the ListCredentials operation. type RegistryListCredentialsResult struct { // The list of passwords for a container registry. - Passwords []*RegistryPassword `json:"passwords,omitempty"` + Passwords []*RegistryPassword // The username for a container registry. - Username *string `json:"username,omitempty"` + Username *string } // RegistryListResult - The result of a request to list container registries. type RegistryListResult struct { // The URI that can be used to request the next list of container registries. - NextLink *string `json:"nextLink,omitempty"` + NextLink *string // The list of container registries. Since this list may be incomplete, the nextLink field should be used to request the next // list of container registries. - Value []*Registry `json:"value,omitempty"` + Value []*Registry } // RegistryNameCheckRequest - A request to check whether a container registry name is available. type RegistryNameCheckRequest struct { // REQUIRED; The name of the container registry. - Name *string `json:"name,omitempty"` + Name *string // CONSTANT; The resource type of the container registry. This field must be set to 'Microsoft.ContainerRegistry/registries'. // Field has constant value "Microsoft.ContainerRegistry/registries", any specified value is ignored. - Type *string `json:"type,omitempty"` + Type *string } // RegistryNameStatus - The result of a request to check the availability of a container registry name. type RegistryNameStatus struct { // If any, the error message that provides more detail for the reason that the name is not available. - Message *string `json:"message,omitempty"` + Message *string // The value that indicates whether the name is available. - NameAvailable *bool `json:"nameAvailable,omitempty"` + NameAvailable *bool // If any, the reason that the name is not available. - Reason *string `json:"reason,omitempty"` + Reason *string } // RegistryPassword - The login password for the container registry. type RegistryPassword struct { // The password name. - Name *PasswordName `json:"name,omitempty"` + Name *PasswordName // The password value. - Value *string `json:"value,omitempty"` + Value *string } // RegistryProperties - The properties of a container registry. type RegistryProperties struct { // The value that indicates whether the admin user is enabled. - AdminUserEnabled *bool `json:"adminUserEnabled,omitempty"` + AdminUserEnabled *bool // Enables registry-wide pull from unauthenticated clients. - AnonymousPullEnabled *bool `json:"anonymousPullEnabled,omitempty"` + AnonymousPullEnabled *bool // Enable a single data endpoint per region for serving data. - DataEndpointEnabled *bool `json:"dataEndpointEnabled,omitempty"` + DataEndpointEnabled *bool // The encryption settings of container registry. - Encryption *EncryptionProperty `json:"encryption,omitempty"` + Encryption *EncryptionProperty // Whether to allow trusted Azure services to access a network restricted registry. - NetworkRuleBypassOptions *NetworkRuleBypassOptions `json:"networkRuleBypassOptions,omitempty"` + NetworkRuleBypassOptions *NetworkRuleBypassOptions // The network rule set for a container registry. - NetworkRuleSet *NetworkRuleSet `json:"networkRuleSet,omitempty"` + NetworkRuleSet *NetworkRuleSet // The policies for a container registry. - Policies *Policies `json:"policies,omitempty"` + Policies *Policies // Whether or not public network access is allowed for the container registry. - PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` + PublicNetworkAccess *PublicNetworkAccess // Whether or not zone redundancy is enabled for this container registry - ZoneRedundancy *ZoneRedundancy `json:"zoneRedundancy,omitempty"` + ZoneRedundancy *ZoneRedundancy // READ-ONLY; The creation date of the container registry in ISO8601 format. - CreationDate *time.Time `json:"creationDate,omitempty" azure:"ro"` + CreationDate *time.Time // READ-ONLY; List of host names that will serve data when dataEndpointEnabled is true. - DataEndpointHostNames []*string `json:"dataEndpointHostNames,omitempty" azure:"ro"` + DataEndpointHostNames []*string // READ-ONLY; The URL that can be used to log into the container registry. - LoginServer *string `json:"loginServer,omitempty" azure:"ro"` + LoginServer *string // READ-ONLY; List of private endpoint connections for a container registry. - PrivateEndpointConnections []*PrivateEndpointConnection `json:"privateEndpointConnections,omitempty" azure:"ro"` + PrivateEndpointConnections []*PrivateEndpointConnection // READ-ONLY; The provisioning state of the container registry at the time the operation was called. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *ProvisioningState // READ-ONLY; The status of the container registry at the time the operation was called. - Status *Status `json:"status,omitempty" azure:"ro"` + Status *Status } // RegistryPropertiesUpdateParameters - The parameters for updating the properties of a container registry. type RegistryPropertiesUpdateParameters struct { // The value that indicates whether the admin user is enabled. - AdminUserEnabled *bool `json:"adminUserEnabled,omitempty"` + AdminUserEnabled *bool // Enables registry-wide pull from unauthenticated clients. - AnonymousPullEnabled *bool `json:"anonymousPullEnabled,omitempty"` + AnonymousPullEnabled *bool // Enable a single data endpoint per region for serving data. - DataEndpointEnabled *bool `json:"dataEndpointEnabled,omitempty"` + DataEndpointEnabled *bool // The encryption settings of container registry. - Encryption *EncryptionProperty `json:"encryption,omitempty"` + Encryption *EncryptionProperty // Whether to allow trusted Azure services to access a network restricted registry. - NetworkRuleBypassOptions *NetworkRuleBypassOptions `json:"networkRuleBypassOptions,omitempty"` + NetworkRuleBypassOptions *NetworkRuleBypassOptions // The network rule set for a container registry. - NetworkRuleSet *NetworkRuleSet `json:"networkRuleSet,omitempty"` + NetworkRuleSet *NetworkRuleSet // The policies for a container registry. - Policies *Policies `json:"policies,omitempty"` + Policies *Policies // Whether or not public network access is allowed for the container registry. - PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` + PublicNetworkAccess *PublicNetworkAccess } // RegistryUpdateParameters - The parameters for updating a container registry. type RegistryUpdateParameters struct { // The identity of the container registry. - Identity *IdentityProperties `json:"identity,omitempty"` + Identity *IdentityProperties // The properties that the container registry will be updated with. - Properties *RegistryPropertiesUpdateParameters `json:"properties,omitempty"` + Properties *RegistryPropertiesUpdateParameters // The SKU of the container registry. - SKU *SKU `json:"sku,omitempty"` + SKU *SKU // The tags for the container registry. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string } // RegistryUsage - The quota usage for a container registry. type RegistryUsage struct { // The current value of the usage. - CurrentValue *int64 `json:"currentValue,omitempty"` + CurrentValue *int64 // The limit of the usage. - Limit *int64 `json:"limit,omitempty"` + Limit *int64 // The name of the usage. - Name *string `json:"name,omitempty"` + Name *string // The unit of measurement. - Unit *RegistryUsageUnit `json:"unit,omitempty"` + Unit *RegistryUsageUnit } // RegistryUsageListResult - The result of a request to get container registry quota usages. type RegistryUsageListResult struct { // The list of container registry quota usages. - Value []*RegistryUsage `json:"value,omitempty"` + Value []*RegistryUsage } // Replication - An object that represents a replication for a container registry. type Replication struct { // REQUIRED; The location of the resource. This cannot be changed after the resource is created. - Location *string `json:"location,omitempty"` + Location *string // The properties of the replication. - Properties *ReplicationProperties `json:"properties,omitempty"` + Properties *ReplicationProperties // The tags of the resource. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; The resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ReplicationListResult - The result of a request to list replications for a container registry. type ReplicationListResult struct { // The URI that can be used to request the next list of replications. - NextLink *string `json:"nextLink,omitempty"` + NextLink *string // The list of replications. Since this list may be incomplete, the nextLink field should be used to request the next list // of replications. - Value []*Replication `json:"value,omitempty"` + Value []*Replication } // ReplicationProperties - The properties of a replication. @@ -2260,32 +2260,32 @@ type ReplicationProperties struct { // Specifies whether the replication's regional endpoint is enabled. Requests will not be routed to a replication whose regional // endpoint is disabled, however its data will continue to be synced with // other replications. - RegionEndpointEnabled *bool `json:"regionEndpointEnabled,omitempty"` + RegionEndpointEnabled *bool // Whether or not zone redundancy is enabled for this container registry replication - ZoneRedundancy *ZoneRedundancy `json:"zoneRedundancy,omitempty"` + ZoneRedundancy *ZoneRedundancy // READ-ONLY; The provisioning state of the replication at the time the operation was called. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *ProvisioningState // READ-ONLY; The status of the replication at the time the operation was called. - Status *Status `json:"status,omitempty" azure:"ro"` + Status *Status } // ReplicationUpdateParameters - The parameters for updating a replication. type ReplicationUpdateParameters struct { // The parameters for updating a replication's properties - Properties *ReplicationUpdateParametersProperties `json:"properties,omitempty"` + Properties *ReplicationUpdateParametersProperties // The tags for the replication. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string } type ReplicationUpdateParametersProperties struct { // Specifies whether the replication's regional endpoint is enabled. Requests will not be routed to a replication whose regional // endpoint is disabled, however its data will continue to be synced with // other replications. - RegionEndpointEnabled *bool `json:"regionEndpointEnabled,omitempty"` + RegionEndpointEnabled *bool } // ReplicationsClientBeginCreateOptions contains the optional parameters for the ReplicationsClient.BeginCreate method. @@ -2320,188 +2320,188 @@ type ReplicationsClientListOptions struct { type Request struct { // The IP or hostname and possibly port of the client connection that initiated the event. This is the RemoteAddr from the // standard http request. - Addr *string `json:"addr,omitempty"` + Addr *string // The externally accessible hostname of the registry instance, as specified by the http host header on incoming requests. - Host *string `json:"host,omitempty"` + Host *string // The ID of the request that initiated the event. - ID *string `json:"id,omitempty"` + ID *string // The request method that generated the event. - Method *string `json:"method,omitempty"` + Method *string // The user agent header of the request. - Useragent *string `json:"useragent,omitempty"` + Useragent *string } // Resource - An Azure resource. type Resource struct { // REQUIRED; The location of the resource. This cannot be changed after the resource is created. - Location *string `json:"location,omitempty"` + Location *string // The tags of the resource. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; The resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // RetentionPolicy - The retention policy for a container registry. type RetentionPolicy struct { // The number of days to retain an untagged manifest after which it gets purged. - Days *int32 `json:"days,omitempty"` + Days *int32 // The value that indicates whether the policy is enabled or not. - Status *PolicyStatus `json:"status,omitempty"` + Status *PolicyStatus // READ-ONLY; The timestamp when the policy was last updated. - LastUpdatedTime *time.Time `json:"lastUpdatedTime,omitempty" azure:"ro"` + LastUpdatedTime *time.Time } // Run resource properties type Run struct { // The properties of a run. - Properties *RunProperties `json:"properties,omitempty"` + Properties *RunProperties // READ-ONLY; The resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // RunFilter - Properties that are enabled for Odata querying on runs. type RunFilter struct { // The name of the agent pool that the run corresponds to. - AgentPoolName *string `json:"agentPoolName,omitempty"` + AgentPoolName *string // The create time for a run. - CreateTime *time.Time `json:"createTime,omitempty"` + CreateTime *time.Time // The time the run finished. - FinishTime *time.Time `json:"finishTime,omitempty"` + FinishTime *time.Time // The value that indicates whether archiving is enabled or not. - IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"` + IsArchiveEnabled *bool // The list of comma-separated image manifests that were generated from the run. This is applicable if the run is of build // type. - OutputImageManifests *string `json:"outputImageManifests,omitempty"` + OutputImageManifests *string // The unique identifier for the run. - RunID *string `json:"runId,omitempty"` + RunID *string // The type of run. - RunType *RunType `json:"runType,omitempty"` + RunType *RunType // The current status of the run. - Status *RunStatus `json:"status,omitempty"` + Status *RunStatus // The name of the task that the run corresponds to. - TaskName *string `json:"taskName,omitempty"` + TaskName *string } // RunGetLogResult - The result of get log link operation. type RunGetLogResult struct { // The link to logs in registry for a run on a azure container registry. - LogArtifactLink *string `json:"logArtifactLink,omitempty"` + LogArtifactLink *string // The link to logs for a run on a azure container registry. - LogLink *string `json:"logLink,omitempty"` + LogLink *string } // RunListResult - Collection of runs. type RunListResult struct { // The URI that can be used to request the next set of paged results. - NextLink *string `json:"nextLink,omitempty"` + NextLink *string // The collection value. - Value []*Run `json:"value,omitempty"` + Value []*Run } // RunProperties - The properties for a run. type RunProperties struct { // The machine configuration of the run agent. - AgentConfiguration *AgentProperties `json:"agentConfiguration,omitempty"` + AgentConfiguration *AgentProperties // The dedicated agent pool for the run. - AgentPoolName *string `json:"agentPoolName,omitempty"` + AgentPoolName *string // The time the run was scheduled. - CreateTime *time.Time `json:"createTime,omitempty"` + CreateTime *time.Time // The list of custom registries that were logged in during this run. - CustomRegistries []*string `json:"customRegistries,omitempty"` + CustomRegistries []*string // The time the run finished. - FinishTime *time.Time `json:"finishTime,omitempty"` + FinishTime *time.Time // The image update trigger that caused the run. This is applicable if the task has base image trigger configured. - ImageUpdateTrigger *ImageUpdateTrigger `json:"imageUpdateTrigger,omitempty"` + ImageUpdateTrigger *ImageUpdateTrigger // The value that indicates whether archiving is enabled or not. - IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"` + IsArchiveEnabled *bool // The last updated time for the run. - LastUpdatedTime *time.Time `json:"lastUpdatedTime,omitempty"` + LastUpdatedTime *time.Time // The list of all images that were generated from the run. This is applicable if the run generates base image dependencies. - OutputImages []*ImageDescriptor `json:"outputImages,omitempty"` + OutputImages []*ImageDescriptor // The platform properties against which the run will happen. - Platform *PlatformProperties `json:"platform,omitempty"` + Platform *PlatformProperties // The provisioning state of a run. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + ProvisioningState *ProvisioningState // The unique identifier for the run. - RunID *string `json:"runId,omitempty"` + RunID *string // The type of run. - RunType *RunType `json:"runType,omitempty"` + RunType *RunType // The scope of the credentials that were used to login to the source registry during this run. - SourceRegistryAuth *string `json:"sourceRegistryAuth,omitempty"` + SourceRegistryAuth *string // The source trigger that caused the run. - SourceTrigger *SourceTriggerDescriptor `json:"sourceTrigger,omitempty"` + SourceTrigger *SourceTriggerDescriptor // The time the run started. - StartTime *time.Time `json:"startTime,omitempty"` + StartTime *time.Time // The current status of the run. - Status *RunStatus `json:"status,omitempty"` + Status *RunStatus // The task against which run was scheduled. - Task *string `json:"task,omitempty"` + Task *string // The timer trigger that caused the run. - TimerTrigger *TimerTriggerDescriptor `json:"timerTrigger,omitempty"` + TimerTrigger *TimerTriggerDescriptor // The update trigger token passed for the Run. - UpdateTriggerToken *string `json:"updateTriggerToken,omitempty"` + UpdateTriggerToken *string // READ-ONLY; The image description for the log artifact. - LogArtifact *ImageDescriptor `json:"logArtifact,omitempty" azure:"ro"` + LogArtifact *ImageDescriptor // READ-ONLY; The error message received from backend systems after the run is scheduled. - RunErrorMessage *string `json:"runErrorMessage,omitempty" azure:"ro"` + RunErrorMessage *string } // RunRequestClassification provides polymorphic access to related types. @@ -2516,16 +2516,16 @@ type RunRequestClassification interface { // RunRequest - The request parameters for scheduling a run. type RunRequest struct { // REQUIRED; The type of the run request. - Type *string `json:"type,omitempty"` + Type *string // The dedicated agent pool for the run. - AgentPoolName *string `json:"agentPoolName,omitempty"` + AgentPoolName *string // The value that indicates whether archiving is enabled for the run or not. - IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"` + IsArchiveEnabled *bool // The template that describes the repository and tag information for run log artifact. - LogTemplate *string `json:"logTemplate,omitempty"` + LogTemplate *string } // GetRunRequest implements the RunRequestClassification interface for type RunRequest. @@ -2534,7 +2534,7 @@ func (r *RunRequest) GetRunRequest() *RunRequest { return r } // RunUpdateParameters - The set of run properties that can be updated. type RunUpdateParameters struct { // The value that indicates whether archiving is enabled or not. - IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"` + IsArchiveEnabled *bool } // RunsClientBeginCancelOptions contains the optional parameters for the RunsClient.BeginCancel method. @@ -2571,71 +2571,71 @@ type RunsClientListOptions struct { // SKU - The SKU of a container registry. type SKU struct { // REQUIRED; The SKU name of the container registry. Required for registry creation. - Name *SKUName `json:"name,omitempty"` + Name *SKUName // READ-ONLY; The SKU tier based on the SKU name. - Tier *SKUTier `json:"tier,omitempty" azure:"ro"` + Tier *SKUTier } // ScopeMap - An object that represents a scope map for a container registry. type ScopeMap struct { // The properties of the scope map. - Properties *ScopeMapProperties `json:"properties,omitempty"` + Properties *ScopeMapProperties // READ-ONLY; The resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ScopeMapListResult - The result of a request to list scope maps for a container registry. type ScopeMapListResult struct { // The URI that can be used to request the next list of scope maps. - NextLink *string `json:"nextLink,omitempty"` + NextLink *string // The list of scope maps. Since this list may be incomplete, the nextLink field should be used to request the next list of // scope maps. - Value []*ScopeMap `json:"value,omitempty"` + Value []*ScopeMap } // ScopeMapProperties - The properties of a scope map. type ScopeMapProperties struct { // REQUIRED; The list of scoped permissions for registry artifacts. E.g. repositories/repository-name/content/read, repositories/repository-name/metadata/write - Actions []*string `json:"actions,omitempty"` + Actions []*string // The user friendly description of the scope map. - Description *string `json:"description,omitempty"` + Description *string // READ-ONLY; The creation date of scope map. - CreationDate *time.Time `json:"creationDate,omitempty" azure:"ro"` + CreationDate *time.Time // READ-ONLY; Provisioning state of the resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *ProvisioningState // READ-ONLY; The type of the scope map. E.g. BuildIn scope map. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ScopeMapPropertiesUpdateParameters - The update parameters for scope map properties. type ScopeMapPropertiesUpdateParameters struct { // The list of scope permissions for registry artifacts. E.g. repositories/repository-name/pull, repositories/repository-name/delete - Actions []*string `json:"actions,omitempty"` + Actions []*string // The user friendly description of the scope map. - Description *string `json:"description,omitempty"` + Description *string } // ScopeMapUpdateParameters - The properties for updating the scope map. type ScopeMapUpdateParameters struct { // The update parameters for scope map properties. - Properties *ScopeMapPropertiesUpdateParameters `json:"properties,omitempty"` + Properties *ScopeMapPropertiesUpdateParameters } // ScopeMapsClientBeginCreateOptions contains the optional parameters for the ScopeMapsClient.BeginCreate method. @@ -2669,35 +2669,35 @@ type ScopeMapsClientListOptions struct { // SecretObject - Describes the properties of a secret object value. type SecretObject struct { // The type of the secret object which determines how the value of the secret object has to be interpreted. - Type *SecretObjectType `json:"type,omitempty"` + Type *SecretObjectType // The value of the secret. The format of this value will be determined based on the type of the secret object. If the type // is Opaque, the value will be used as is without any modification. - Value *string `json:"value,omitempty"` + Value *string } // SetValue - The properties of a overridable value that can be passed to a task template. type SetValue struct { // REQUIRED; The name of the overridable value. - Name *string `json:"name,omitempty"` + Name *string // REQUIRED; The overridable value. - Value *string `json:"value,omitempty"` + Value *string // Flag to indicate whether the value represents a secret or not. - IsSecret *bool `json:"isSecret,omitempty"` + IsSecret *bool } // SoftDeletePolicy - The soft delete policy for a container registry type SoftDeletePolicy struct { // The number of days after which a soft-deleted item is permanently deleted. - RetentionDays *int32 `json:"retentionDays,omitempty"` + RetentionDays *int32 // The value that indicates whether the policy is enabled or not. - Status *PolicyStatus `json:"status,omitempty"` + Status *PolicyStatus // READ-ONLY; The timestamp when the policy was last updated. - LastUpdatedTime *time.Time `json:"lastUpdatedTime,omitempty" azure:"ro"` + LastUpdatedTime *time.Time } // Source - The registry node that generated the event. Put differently, while the actor initiates the event, the source generates @@ -2705,25 +2705,25 @@ type SoftDeletePolicy struct { type Source struct { // The IP or hostname and the port of the registry node that generated the event. Generally, this will be resolved by os.Hostname() // along with the running port. - Addr *string `json:"addr,omitempty"` + Addr *string // The running instance of an application. Changes after each restart. - InstanceID *string `json:"instanceID,omitempty"` + InstanceID *string } // SourceProperties - The properties of the source code repository. type SourceProperties struct { // REQUIRED; The full URL to the source code repository - RepositoryURL *string `json:"repositoryUrl,omitempty"` + RepositoryURL *string // REQUIRED; The type of source control service. - SourceControlType *SourceControlType `json:"sourceControlType,omitempty"` + SourceControlType *SourceControlType // The branch name of the source code. - Branch *string `json:"branch,omitempty"` + Branch *string // The authorization properties for accessing the source code repository and to set up webhooks for notifications. - SourceControlAuthProperties *AuthInfo `json:"sourceControlAuthProperties,omitempty"` + SourceControlAuthProperties *AuthInfo } // SourceRegistryCredentials - Describes the credential parameters for accessing the source registry. @@ -2731,412 +2731,412 @@ type SourceRegistryCredentials struct { // The authentication mode which determines the source registry login scope. The credentials for the source registry will // be generated using the given scope. These credentials will be used to login to // the source registry during the run. - LoginMode *SourceRegistryLoginMode `json:"loginMode,omitempty"` + LoginMode *SourceRegistryLoginMode } // SourceTrigger - The properties of a source based trigger. type SourceTrigger struct { // REQUIRED; The name of the trigger. - Name *string `json:"name,omitempty"` + Name *string // REQUIRED; The properties that describes the source(code) for the task. - SourceRepository *SourceProperties `json:"sourceRepository,omitempty"` + SourceRepository *SourceProperties // REQUIRED; The source event corresponding to the trigger. - SourceTriggerEvents []*SourceTriggerEvent `json:"sourceTriggerEvents,omitempty"` + SourceTriggerEvents []*SourceTriggerEvent // The current status of trigger. - Status *TriggerStatus `json:"status,omitempty"` + Status *TriggerStatus } // SourceTriggerDescriptor - The source trigger that caused a run. type SourceTriggerDescriptor struct { // The branch name in the repository. - BranchName *string `json:"branchName,omitempty"` + BranchName *string // The unique ID that identifies a commit. - CommitID *string `json:"commitId,omitempty"` + CommitID *string // The event type of the trigger. - EventType *string `json:"eventType,omitempty"` + EventType *string // The unique ID of the trigger. - ID *string `json:"id,omitempty"` + ID *string // The source control provider type. - ProviderType *string `json:"providerType,omitempty"` + ProviderType *string // The unique ID that identifies pull request. - PullRequestID *string `json:"pullRequestId,omitempty"` + PullRequestID *string // The repository URL. - RepositoryURL *string `json:"repositoryUrl,omitempty"` + RepositoryURL *string } // SourceTriggerUpdateParameters - The properties for updating a source based trigger. type SourceTriggerUpdateParameters struct { // REQUIRED; The name of the trigger. - Name *string `json:"name,omitempty"` + Name *string // The properties that describes the source(code) for the task. - SourceRepository *SourceUpdateParameters `json:"sourceRepository,omitempty"` + SourceRepository *SourceUpdateParameters // The source event corresponding to the trigger. - SourceTriggerEvents []*SourceTriggerEvent `json:"sourceTriggerEvents,omitempty"` + SourceTriggerEvents []*SourceTriggerEvent // The current status of trigger. - Status *TriggerStatus `json:"status,omitempty"` + Status *TriggerStatus } // SourceUpdateParameters - The properties for updating the source code repository. type SourceUpdateParameters struct { // The branch name of the source code. - Branch *string `json:"branch,omitempty"` + Branch *string // The full URL to the source code repository - RepositoryURL *string `json:"repositoryUrl,omitempty"` + RepositoryURL *string // The authorization properties for accessing the source code repository and to set up webhooks for notifications. - SourceControlAuthProperties *AuthInfoUpdateParameters `json:"sourceControlAuthProperties,omitempty"` + SourceControlAuthProperties *AuthInfoUpdateParameters // The type of source control service. - SourceControlType *SourceControlType `json:"sourceControlType,omitempty"` + SourceControlType *SourceControlType } // SourceUploadDefinition - The properties of a response to source upload request. type SourceUploadDefinition struct { // The relative path to the source. This is used to submit the subsequent queue build request. - RelativePath *string `json:"relativePath,omitempty"` + RelativePath *string // The URL where the client can upload the source. - UploadURL *string `json:"uploadUrl,omitempty"` + UploadURL *string } // Status - The status of an Azure resource at the time the operation was called. type Status struct { // READ-ONLY; The short label for the status. - DisplayStatus *string `json:"displayStatus,omitempty" azure:"ro"` + DisplayStatus *string // READ-ONLY; The detailed message for the status, including alerts and error messages. - Message *string `json:"message,omitempty" azure:"ro"` + Message *string // READ-ONLY; The timestamp when the status was changed to the current value. - Timestamp *time.Time `json:"timestamp,omitempty" azure:"ro"` + Timestamp *time.Time } // StatusDetailProperties - The status detail properties of the connected registry. type StatusDetailProperties struct { // READ-ONLY; The code of the status. - Code *string `json:"code,omitempty" azure:"ro"` + Code *string // READ-ONLY; The correlation ID of the status. - CorrelationID *string `json:"correlationId,omitempty" azure:"ro"` + CorrelationID *string // READ-ONLY; The description of the status. - Description *string `json:"description,omitempty" azure:"ro"` + Description *string // READ-ONLY; The timestamp of the status. - Timestamp *time.Time `json:"timestamp,omitempty" azure:"ro"` + Timestamp *time.Time // READ-ONLY; The component of the connected registry corresponding to the status. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // StorageAccountProperties - The properties of a storage account for a container registry. Only applicable to Classic SKU. type StorageAccountProperties struct { // REQUIRED; The resource ID of the storage account. - ID *string `json:"id,omitempty"` + ID *string } // SyncProperties - The sync properties of the connected registry with its parent. type SyncProperties struct { // REQUIRED; The period of time for which a message is available to sync before it is expired. Specify the duration using // the format P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601. - MessageTTL *string `json:"messageTtl,omitempty"` + MessageTTL *string // REQUIRED; The resource ID of the ACR token used to authenticate the connected registry to its parent during sync. - TokenID *string `json:"tokenId,omitempty"` + TokenID *string // The cron expression indicating the schedule that the connected registry will sync with its parent. - Schedule *string `json:"schedule,omitempty"` + Schedule *string // The time window during which sync is enabled for each schedule occurrence. Specify the duration using the format P[n]Y[n]M[n]DT[n]H[n]M[n]S // as per ISO8601. - SyncWindow *string `json:"syncWindow,omitempty"` + SyncWindow *string // READ-ONLY; The gateway endpoint used by the connected registry to communicate with its parent. - GatewayEndpoint *string `json:"gatewayEndpoint,omitempty" azure:"ro"` + GatewayEndpoint *string // READ-ONLY; The last time a sync occurred between the connected registry and its parent. - LastSyncTime *time.Time `json:"lastSyncTime,omitempty" azure:"ro"` + LastSyncTime *time.Time } // SyncUpdateProperties - The parameters for updating the sync properties of the connected registry with its parent. type SyncUpdateProperties struct { // The period of time for which a message is available to sync before it is expired. Specify the duration using the format // P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601. - MessageTTL *string `json:"messageTtl,omitempty"` + MessageTTL *string // The cron expression indicating the schedule that the connected registry will sync with its parent. - Schedule *string `json:"schedule,omitempty"` + Schedule *string // The time window during which sync is enabled for each schedule occurrence. Specify the duration using the format P[n]Y[n]M[n]DT[n]H[n]M[n]S // as per ISO8601. - SyncWindow *string `json:"syncWindow,omitempty"` + SyncWindow *string } // SystemData - Metadata pertaining to creation and last modification of the resource. type SystemData struct { // The timestamp of resource creation (UTC). - CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAt *time.Time // The identity that created the resource. - CreatedBy *string `json:"createdBy,omitempty"` + CreatedBy *string // The type of identity that created the resource. - CreatedByType *CreatedByType `json:"createdByType,omitempty"` + CreatedByType *CreatedByType // The timestamp of resource modification (UTC). - LastModifiedAt *time.Time `json:"lastModifiedAt,omitempty"` + LastModifiedAt *time.Time // The identity that last modified the resource. - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + LastModifiedBy *string // The type of identity that last modified the resource. - LastModifiedByType *LastModifiedByType `json:"lastModifiedByType,omitempty"` + LastModifiedByType *LastModifiedByType } // TLSCertificateProperties - The TLS certificate properties of the connected registry login server. type TLSCertificateProperties struct { // READ-ONLY; Indicates the location of the certificates. - Location *string `json:"location,omitempty" azure:"ro"` + Location *string // READ-ONLY; The type of certificate location. - Type *CertificateType `json:"type,omitempty" azure:"ro"` + Type *CertificateType } // TLSProperties - The TLS properties of the connected registry login server. type TLSProperties struct { // READ-ONLY; The certificate used to configure HTTPS for the login server. - Certificate *TLSCertificateProperties `json:"certificate,omitempty" azure:"ro"` + Certificate *TLSCertificateProperties // READ-ONLY; Indicates whether HTTPS is enabled for the login server. - Status *TLSStatus `json:"status,omitempty" azure:"ro"` + Status *TLSStatus } // Target - The target of the event. type Target struct { // The digest of the content, as defined by the Registry V2 HTTP API Specification. - Digest *string `json:"digest,omitempty"` + Digest *string // The number of bytes of the content. Same as Size field. - Length *int64 `json:"length,omitempty"` + Length *int64 // The MIME type of the referenced object. - MediaType *string `json:"mediaType,omitempty"` + MediaType *string // The name of the artifact. - Name *string `json:"name,omitempty"` + Name *string // The repository name. - Repository *string `json:"repository,omitempty"` + Repository *string // The number of bytes of the content. Same as Length field. - Size *int64 `json:"size,omitempty"` + Size *int64 // The tag name. - Tag *string `json:"tag,omitempty"` + Tag *string // The direct URL to the content. - URL *string `json:"url,omitempty"` + URL *string // The version of the artifact. - Version *string `json:"version,omitempty"` + Version *string } // Task - The task that has the ARM resource and task properties. The task will have all information to schedule a run against // it. type Task struct { // REQUIRED; The location of the resource. This cannot be changed after the resource is created. - Location *string `json:"location,omitempty"` + Location *string // Identity for the resource. - Identity *IdentityProperties `json:"identity,omitempty"` + Identity *IdentityProperties // The properties of a task. - Properties *TaskProperties `json:"properties,omitempty"` + Properties *TaskProperties // The tags of the resource. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; The resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // TaskListResult - The collection of tasks. type TaskListResult struct { // The URI that can be used to request the next set of paged results. - NextLink *string `json:"nextLink,omitempty"` + NextLink *string // The collection value. - Value []*Task `json:"value,omitempty"` + Value []*Task } // TaskProperties - The properties of a task. type TaskProperties struct { // The machine configuration of the run agent. - AgentConfiguration *AgentProperties `json:"agentConfiguration,omitempty"` + AgentConfiguration *AgentProperties // The dedicated agent pool for the task. - AgentPoolName *string `json:"agentPoolName,omitempty"` + AgentPoolName *string // The properties that describes a set of credentials that will be used when this run is invoked. - Credentials *Credentials `json:"credentials,omitempty"` + Credentials *Credentials // The value of this property indicates whether the task resource is system task or not. - IsSystemTask *bool `json:"isSystemTask,omitempty"` + IsSystemTask *bool // The template that describes the repository and tag information for run log artifact. - LogTemplate *string `json:"logTemplate,omitempty"` + LogTemplate *string // The platform properties against which the run has to happen. - Platform *PlatformProperties `json:"platform,omitempty"` + Platform *PlatformProperties // The current status of task. - Status *TaskStatus `json:"status,omitempty"` + Status *TaskStatus // The properties of a task step. - Step TaskStepPropertiesClassification `json:"step,omitempty"` + Step TaskStepPropertiesClassification // Run timeout in seconds. - Timeout *int32 `json:"timeout,omitempty"` + Timeout *int32 // The properties that describe all triggers for the task. - Trigger *TriggerProperties `json:"trigger,omitempty"` + Trigger *TriggerProperties // READ-ONLY; The creation date of task. - CreationDate *time.Time `json:"creationDate,omitempty" azure:"ro"` + CreationDate *time.Time // READ-ONLY; The provisioning state of the task. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *ProvisioningState } // TaskPropertiesUpdateParameters - The properties for updating a task. type TaskPropertiesUpdateParameters struct { // The machine configuration of the run agent. - AgentConfiguration *AgentProperties `json:"agentConfiguration,omitempty"` + AgentConfiguration *AgentProperties // The dedicated agent pool for the task. - AgentPoolName *string `json:"agentPoolName,omitempty"` + AgentPoolName *string // The parameters that describes a set of credentials that will be used when this run is invoked. - Credentials *Credentials `json:"credentials,omitempty"` + Credentials *Credentials // The template that describes the repository and tag information for run log artifact. - LogTemplate *string `json:"logTemplate,omitempty"` + LogTemplate *string // The platform properties against which the run has to happen. - Platform *PlatformUpdateParameters `json:"platform,omitempty"` + Platform *PlatformUpdateParameters // The current status of task. - Status *TaskStatus `json:"status,omitempty"` + Status *TaskStatus // The properties for updating a task step. - Step TaskStepUpdateParametersClassification `json:"step,omitempty"` + Step TaskStepUpdateParametersClassification // Run timeout in seconds. - Timeout *int32 `json:"timeout,omitempty"` + Timeout *int32 // The properties for updating trigger properties. - Trigger *TriggerUpdateParameters `json:"trigger,omitempty"` + Trigger *TriggerUpdateParameters } // TaskRun - The task run that has the ARM resource and properties. The task run will have the information of request and // result of a run. type TaskRun struct { // Identity for the resource. - Identity *IdentityProperties `json:"identity,omitempty"` + Identity *IdentityProperties // The location of the resource - Location *string `json:"location,omitempty"` + Location *string // The properties associated with the task run, i.e., request and result of the run - Properties *TaskRunProperties `json:"properties,omitempty"` + Properties *TaskRunProperties // READ-ONLY; The resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // TaskRunListResult - The collection of task runs. type TaskRunListResult struct { // The URI that can be used to request the next set of paged results. - NextLink *string `json:"nextLink,omitempty"` + NextLink *string // The collection value. - Value []*TaskRun `json:"value,omitempty"` + Value []*TaskRun } // TaskRunProperties - The properties of task run. type TaskRunProperties struct { // How the run should be forced to rerun even if the run request configuration has not changed - ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` + ForceUpdateTag *string // The request (parameters) for the run - RunRequest RunRequestClassification `json:"runRequest,omitempty"` + RunRequest RunRequestClassification // READ-ONLY; The provisioning state of this task run - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *ProvisioningState // READ-ONLY; The result of this task run - RunResult *Run `json:"runResult,omitempty" azure:"ro"` + RunResult *Run } // TaskRunPropertiesUpdateParameters - The properties of a task run update parameters. type TaskRunPropertiesUpdateParameters struct { // How the run should be forced to rerun even if the run request configuration has not changed - ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` + ForceUpdateTag *string // The request (parameters) for the new run - RunRequest RunRequestClassification `json:"runRequest,omitempty"` + RunRequest RunRequestClassification } // TaskRunRequest - The parameters for a task run request. type TaskRunRequest struct { // REQUIRED; The resource ID of task against which run has to be queued. - TaskID *string `json:"taskId,omitempty"` + TaskID *string // REQUIRED; The type of the run request. - Type *string `json:"type,omitempty"` + Type *string // The dedicated agent pool for the run. - AgentPoolName *string `json:"agentPoolName,omitempty"` + AgentPoolName *string // The value that indicates whether archiving is enabled for the run or not. - IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"` + IsArchiveEnabled *bool // The template that describes the repository and tag information for run log artifact. - LogTemplate *string `json:"logTemplate,omitempty"` + LogTemplate *string // Set of overridable parameters that can be passed when running a Task. - OverrideTaskStepProperties *OverrideTaskStepProperties `json:"overrideTaskStepProperties,omitempty"` + OverrideTaskStepProperties *OverrideTaskStepProperties } // GetRunRequest implements the RunRequestClassification interface for type TaskRunRequest. @@ -3152,16 +3152,16 @@ func (t *TaskRunRequest) GetRunRequest() *RunRequest { // TaskRunUpdateParameters - The parameters for updating a task run. type TaskRunUpdateParameters struct { // Identity for the resource. - Identity *IdentityProperties `json:"identity,omitempty"` + Identity *IdentityProperties // The location of the resource - Location *string `json:"location,omitempty"` + Location *string // The properties for updating a task run. - Properties *TaskRunPropertiesUpdateParameters `json:"properties,omitempty"` + Properties *TaskRunPropertiesUpdateParameters // The ARM resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string } // TaskRunsClientBeginCreateOptions contains the optional parameters for the TaskRunsClient.BeginCreate method. @@ -3209,16 +3209,16 @@ type TaskStepPropertiesClassification interface { // TaskStepProperties - Base properties for any task step. type TaskStepProperties struct { // REQUIRED; The type of the step. - Type *StepType `json:"type,omitempty"` + Type *StepType // The token (git PAT or SAS token of storage account blob) associated with the context for a step. - ContextAccessToken *string `json:"contextAccessToken,omitempty"` + ContextAccessToken *string // The URL(absolute or relative) of the source context for the task step. - ContextPath *string `json:"contextPath,omitempty"` + ContextPath *string // READ-ONLY; List of base image dependencies for a step. - BaseImageDependencies []*BaseImageDependency `json:"baseImageDependencies,omitempty" azure:"ro"` + BaseImageDependencies []*BaseImageDependency } // GetTaskStepProperties implements the TaskStepPropertiesClassification interface for type TaskStepProperties. @@ -3236,13 +3236,13 @@ type TaskStepUpdateParametersClassification interface { // TaskStepUpdateParameters - Base properties for updating any task step. type TaskStepUpdateParameters struct { // REQUIRED; The type of the step. - Type *StepType `json:"type,omitempty"` + Type *StepType // The token (git PAT or SAS token of storage account blob) associated with the context for a step. - ContextAccessToken *string `json:"contextAccessToken,omitempty"` + ContextAccessToken *string // The URL(absolute or relative) of the source context for the task step. - ContextPath *string `json:"contextPath,omitempty"` + ContextPath *string } // GetTaskStepUpdateParameters implements the TaskStepUpdateParametersClassification interface for type TaskStepUpdateParameters. @@ -3251,13 +3251,13 @@ func (t *TaskStepUpdateParameters) GetTaskStepUpdateParameters() *TaskStepUpdate // TaskUpdateParameters - The parameters for updating a task. type TaskUpdateParameters struct { // Identity for the resource. - Identity *IdentityProperties `json:"identity,omitempty"` + Identity *IdentityProperties // The properties for updating a task. - Properties *TaskPropertiesUpdateParameters `json:"properties,omitempty"` + Properties *TaskPropertiesUpdateParameters // The ARM resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string } // TasksClientBeginCreateOptions contains the optional parameters for the TasksClient.BeginCreate method. @@ -3296,130 +3296,130 @@ type TasksClientListOptions struct { // TimerTrigger - The properties of a timer trigger. type TimerTrigger struct { // REQUIRED; The name of the trigger. - Name *string `json:"name,omitempty"` + Name *string // REQUIRED; The CRON expression for the task schedule - Schedule *string `json:"schedule,omitempty"` + Schedule *string // The current status of trigger. - Status *TriggerStatus `json:"status,omitempty"` + Status *TriggerStatus } type TimerTriggerDescriptor struct { // The occurrence that triggered the run. - ScheduleOccurrence *string `json:"scheduleOccurrence,omitempty"` + ScheduleOccurrence *string // The timer trigger name that caused the run. - TimerTriggerName *string `json:"timerTriggerName,omitempty"` + TimerTriggerName *string } // TimerTriggerUpdateParameters - The properties for updating a timer trigger. type TimerTriggerUpdateParameters struct { // REQUIRED; The name of the trigger. - Name *string `json:"name,omitempty"` + Name *string // The CRON expression for the task schedule - Schedule *string `json:"schedule,omitempty"` + Schedule *string // The current status of trigger. - Status *TriggerStatus `json:"status,omitempty"` + Status *TriggerStatus } // Token - An object that represents a token for a container registry. type Token struct { // The properties of the token. - Properties *TokenProperties `json:"properties,omitempty"` + Properties *TokenProperties // READ-ONLY; The resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // TokenCertificate - The properties of a certificate used for authenticating a token. type TokenCertificate struct { // Base 64 encoded string of the public certificate1 in PEM format that will be used for authenticating the token. - EncodedPemCertificate *string `json:"encodedPemCertificate,omitempty"` + EncodedPemCertificate *string // The expiry datetime of the certificate. - Expiry *time.Time `json:"expiry,omitempty"` - Name *TokenCertificateName `json:"name,omitempty"` + Expiry *time.Time + Name *TokenCertificateName // The thumbprint of the certificate. - Thumbprint *string `json:"thumbprint,omitempty"` + Thumbprint *string } // TokenCredentialsProperties - The properties of the credentials that can be used for authenticating the token. type TokenCredentialsProperties struct { - Certificates []*TokenCertificate `json:"certificates,omitempty"` - Passwords []*TokenPassword `json:"passwords,omitempty"` + Certificates []*TokenCertificate + Passwords []*TokenPassword } // TokenListResult - The result of a request to list tokens for a container registry. type TokenListResult struct { // The URI that can be used to request the next list of tokens. - NextLink *string `json:"nextLink,omitempty"` + NextLink *string // The list of tokens. Since this list may be incomplete, the nextLink field should be used to request the next list of tokens. - Value []*Token `json:"value,omitempty"` + Value []*Token } // TokenPassword - The password that will be used for authenticating the token of a container registry. type TokenPassword struct { // The creation datetime of the password. - CreationTime *time.Time `json:"creationTime,omitempty"` + CreationTime *time.Time // The expiry datetime of the password. - Expiry *time.Time `json:"expiry,omitempty"` + Expiry *time.Time // The password name "password1" or "password2" - Name *TokenPasswordName `json:"name,omitempty"` + Name *TokenPasswordName // READ-ONLY; The password value. - Value *string `json:"value,omitempty" azure:"ro"` + Value *string } // TokenProperties - The properties of a token. type TokenProperties struct { // The credentials that can be used for authenticating the token. - Credentials *TokenCredentialsProperties `json:"credentials,omitempty"` + Credentials *TokenCredentialsProperties // The resource ID of the scope map to which the token will be associated with. - ScopeMapID *string `json:"scopeMapId,omitempty"` + ScopeMapID *string // The status of the token example enabled or disabled. - Status *TokenStatus `json:"status,omitempty"` + Status *TokenStatus // READ-ONLY; The creation date of scope map. - CreationDate *time.Time `json:"creationDate,omitempty" azure:"ro"` + CreationDate *time.Time // READ-ONLY; Provisioning state of the resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *ProvisioningState } // TokenUpdateParameters - The parameters for updating a token. type TokenUpdateParameters struct { // The properties of the token update parameters. - Properties *TokenUpdateProperties `json:"properties,omitempty"` + Properties *TokenUpdateProperties } // TokenUpdateProperties - The parameters for updating token properties. type TokenUpdateProperties struct { // The credentials that can be used for authenticating the token. - Credentials *TokenCredentialsProperties `json:"credentials,omitempty"` + Credentials *TokenCredentialsProperties // The resource ID of the scope map to which the token will be associated with. - ScopeMapID *string `json:"scopeMapId,omitempty"` + ScopeMapID *string // The status of the token example enabled or disabled. - Status *TokenStatus `json:"status,omitempty"` + Status *TokenStatus } // TokensClientBeginCreateOptions contains the optional parameters for the TokensClient.BeginCreate method. @@ -3453,154 +3453,154 @@ type TokensClientListOptions struct { // TriggerProperties - The properties of a trigger. type TriggerProperties struct { // The trigger based on base image dependencies. - BaseImageTrigger *BaseImageTrigger `json:"baseImageTrigger,omitempty"` + BaseImageTrigger *BaseImageTrigger // The collection of triggers based on source code repository. - SourceTriggers []*SourceTrigger `json:"sourceTriggers,omitempty"` + SourceTriggers []*SourceTrigger // The collection of timer triggers. - TimerTriggers []*TimerTrigger `json:"timerTriggers,omitempty"` + TimerTriggers []*TimerTrigger } // TriggerUpdateParameters - The properties for updating triggers. type TriggerUpdateParameters struct { // The trigger based on base image dependencies. - BaseImageTrigger *BaseImageTriggerUpdateParameters `json:"baseImageTrigger,omitempty"` + BaseImageTrigger *BaseImageTriggerUpdateParameters // The collection of triggers based on source code repository. - SourceTriggers []*SourceTriggerUpdateParameters `json:"sourceTriggers,omitempty"` + SourceTriggers []*SourceTriggerUpdateParameters // The collection of timer triggers. - TimerTriggers []*TimerTriggerUpdateParameters `json:"timerTriggers,omitempty"` + TimerTriggers []*TimerTriggerUpdateParameters } // TrustPolicy - The content trust policy for a container registry. type TrustPolicy struct { // The value that indicates whether the policy is enabled or not. - Status *PolicyStatus `json:"status,omitempty"` + Status *PolicyStatus // The type of trust policy. - Type *TrustPolicyType `json:"type,omitempty"` + Type *TrustPolicyType } type UserIdentityProperties struct { // The client id of user assigned identity. - ClientID *string `json:"clientId,omitempty"` + ClientID *string // The principal id of user assigned identity. - PrincipalID *string `json:"principalId,omitempty"` + PrincipalID *string } // Webhook - An object that represents a webhook for a container registry. type Webhook struct { // REQUIRED; The location of the resource. This cannot be changed after the resource is created. - Location *string `json:"location,omitempty"` + Location *string // The properties of the webhook. - Properties *WebhookProperties `json:"properties,omitempty"` + Properties *WebhookProperties // The tags of the resource. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; The resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // WebhookCreateParameters - The parameters for creating a webhook. type WebhookCreateParameters struct { // REQUIRED; The location of the webhook. This cannot be changed after the resource is created. - Location *string `json:"location,omitempty"` + Location *string // The properties that the webhook will be created with. - Properties *WebhookPropertiesCreateParameters `json:"properties,omitempty"` + Properties *WebhookPropertiesCreateParameters // The tags for the webhook. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string } // WebhookListResult - The result of a request to list webhooks for a container registry. type WebhookListResult struct { // The URI that can be used to request the next list of webhooks. - NextLink *string `json:"nextLink,omitempty"` + NextLink *string // The list of webhooks. Since this list may be incomplete, the nextLink field should be used to request the next list of // webhooks. - Value []*Webhook `json:"value,omitempty"` + Value []*Webhook } // WebhookProperties - The properties of a webhook. type WebhookProperties struct { // REQUIRED; The list of actions that trigger the webhook to post notifications. - Actions []*WebhookAction `json:"actions,omitempty"` + Actions []*WebhookAction // The scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository // 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to // 'foo:latest'. Empty means all events. - Scope *string `json:"scope,omitempty"` + Scope *string // The status of the webhook at the time the operation was called. - Status *WebhookStatus `json:"status,omitempty"` + Status *WebhookStatus // READ-ONLY; The provisioning state of the webhook at the time the operation was called. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *ProvisioningState } // WebhookPropertiesCreateParameters - The parameters for creating the properties of a webhook. type WebhookPropertiesCreateParameters struct { // REQUIRED; The list of actions that trigger the webhook to post notifications. - Actions []*WebhookAction `json:"actions,omitempty"` + Actions []*WebhookAction // REQUIRED; The service URI for the webhook to post notifications. - ServiceURI *string `json:"serviceUri,omitempty"` + ServiceURI *string // Custom headers that will be added to the webhook notifications. - CustomHeaders map[string]*string `json:"customHeaders,omitempty"` + CustomHeaders map[string]*string // The scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository // 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to // 'foo:latest'. Empty means all events. - Scope *string `json:"scope,omitempty"` + Scope *string // The status of the webhook at the time the operation was called. - Status *WebhookStatus `json:"status,omitempty"` + Status *WebhookStatus } // WebhookPropertiesUpdateParameters - The parameters for updating the properties of a webhook. type WebhookPropertiesUpdateParameters struct { // The list of actions that trigger the webhook to post notifications. - Actions []*WebhookAction `json:"actions,omitempty"` + Actions []*WebhookAction // Custom headers that will be added to the webhook notifications. - CustomHeaders map[string]*string `json:"customHeaders,omitempty"` + CustomHeaders map[string]*string // The scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository // 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to // 'foo:latest'. Empty means all events. - Scope *string `json:"scope,omitempty"` + Scope *string // The service URI for the webhook to post notifications. - ServiceURI *string `json:"serviceUri,omitempty"` + ServiceURI *string // The status of the webhook at the time the operation was called. - Status *WebhookStatus `json:"status,omitempty"` + Status *WebhookStatus } // WebhookUpdateParameters - The parameters for updating a webhook. type WebhookUpdateParameters struct { // The properties that the webhook will be updated with. - Properties *WebhookPropertiesUpdateParameters `json:"properties,omitempty"` + Properties *WebhookPropertiesUpdateParameters // The tags for the webhook. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string } // WebhooksClientBeginCreateOptions contains the optional parameters for the WebhooksClient.BeginCreate method. 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 b7c60317b641..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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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_example_test.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/pipelineruns_client_example_test.go deleted file mode 100644 index 8c93423998cc..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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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.9261521+00:00"); 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.9261521+00:00"); 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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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.9261521+00:00"); 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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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.9261521+00:00"); 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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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.9261521+00:00"); 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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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_example_test.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/privateendpointconnections_client_example_test.go deleted file mode 100644 index 5da6c619f819..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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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_example_test.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/registries_client_example_test.go deleted file mode 100644 index 9b0992bca8d8..000000000000 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/registries_client_example_test.go +++ /dev/null @@ -1,1389 +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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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"), - }, 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{ - // NameAvailable: to.Ptr(true), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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"), - }, 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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:38:26.1537861Z"); return t}()), - // DataEndpointEnabled: to.Ptr(false), - // DataEndpointHostNames: []*string{ - // }, - // Encryption: &armcontainerregistry.EncryptionProperty{ - // Status: to.Ptr(armcontainerregistry.EncryptionStatusDisabled), - // }, - // LoginServer: to.Ptr("myRegistry.azurecr-test.io"), - // 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.8506835+00:00"); 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), - // 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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:38:26.1537861Z"); return t}()), - // DataEndpointEnabled: to.Ptr(false), - // DataEndpointHostNames: []*string{ - // }, - // Encryption: &armcontainerregistry.EncryptionProperty{ - // Status: to.Ptr(armcontainerregistry.EncryptionStatusDisabled), - // }, - // LoginServer: to.Ptr("myRegistry.azurecr-test.io"), - // 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.8506835+00:00"); 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), - // 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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:38:26.1537861Z"); return t}()), - // DataEndpointEnabled: to.Ptr(false), - // DataEndpointHostNames: []*string{ - // }, - // Encryption: &armcontainerregistry.EncryptionProperty{ - // Status: to.Ptr(armcontainerregistry.EncryptionStatusDisabled), - // }, - // LoginServer: to.Ptr("myRegistry.azurecr-test.io"), - // 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.8506835+00:00"); 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), - // 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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:38:26.1537861Z"); return t}()), - // DataEndpointEnabled: to.Ptr(false), - // DataEndpointHostNames: []*string{ - // }, - // Encryption: &armcontainerregistry.EncryptionProperty{ - // Status: to.Ptr(armcontainerregistry.EncryptionStatusDisabled), - // }, - // LoginServer: to.Ptr("myRegistry.azurecr-test.io"), - // 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.8506835+00:00"); 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), - // 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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:38:26.1537861Z"); return t}()), - // DataEndpointEnabled: to.Ptr(false), - // DataEndpointHostNames: []*string{ - // }, - // Encryption: &armcontainerregistry.EncryptionProperty{ - // Status: to.Ptr(armcontainerregistry.EncryptionStatusDisabled), - // }, - // LoginServer: to.Ptr("myRegistry.azurecr-test.io"), - // 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.8506835+00:00"); 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), - // 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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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), - }, - 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), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:38:26.1537861Z"); return t}()), - // DataEndpointEnabled: to.Ptr(false), - // DataEndpointHostNames: []*string{ - // }, - // Encryption: &armcontainerregistry.EncryptionProperty{ - // Status: to.Ptr(armcontainerregistry.EncryptionStatusDisabled), - // }, - // LoginServer: to.Ptr("myRegistry.azurecr-test.io"), - // 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.8506835+00:00"); 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), - // 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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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.0707808Z"); 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.0707808Z"); 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.0707808Z"); return t}()), - // Value: to.Ptr("00000000000000000000000000000000"), - // }}, - // Username: to.Ptr("myToken"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun.json -func ExampleRegistriesClient_BeginScheduleRun_registriesScheduleRun() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - 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().BeginScheduleRun(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) - } - 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.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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_EncodedTaskRun.json -func ExampleRegistriesClient_BeginScheduleRun_registriesScheduleRunEncodedTaskRun() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - 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().BeginScheduleRun(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) - } - 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.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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_FileTaskRun.json -func ExampleRegistriesClient_BeginScheduleRun_registriesScheduleRunFileTaskRun() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - 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().BeginScheduleRun(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) - } - 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.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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_Task.json -func ExampleRegistriesClient_BeginScheduleRun_registriesScheduleRunTask() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - 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().BeginScheduleRun(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) - } - 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.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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_FileTask_WithCustomCredentials.json -func ExampleRegistriesClient_BeginScheduleRun_registriesScheduleRunTaskWithCustomCredentials() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - 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().BeginScheduleRun(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) - } - 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.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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_WithCustomCredentials.json -func ExampleRegistriesClient_BeginScheduleRun_registriesScheduleRunWithCustomCredentials() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - 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().BeginScheduleRun(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) - } - 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.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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_WithLogTemplate.json -func ExampleRegistriesClient_BeginScheduleRun_registriesScheduleRunWithLogTemplate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - 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().BeginScheduleRun(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) - } - 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.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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesGetBuildSourceUploadUrl.json -func ExampleRegistriesClient_GetBuildSourceUploadURL() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - 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_example_test.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/replications_client_example_test.go deleted file mode 100644 index 2829a153c6d5..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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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.0707808Z"); return t}()), - // }, - // ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyDisabled), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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.0707808Z"); return t}()), - // }, - // ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyDisabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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.0707808Z"); return t}()), - // }, - // ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyDisabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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.0707808Z"); return t}()), - // }, - // ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyEnabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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.0707808Z"); 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 5b3e40647ba9..000000000000 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/runs_client_example_test.go +++ /dev/null @@ -1,283 +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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RunsList.json -func ExampleRunsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - 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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RunsGet.json -func ExampleRunsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - 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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RunsUpdate.json -func ExampleRunsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - 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.NewRunsClient().BeginUpdate(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) - } - 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.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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RunsGetLogSasUrl.json -func ExampleRunsClient_GetLogSasURL() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - 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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RunsCancel.json -func ExampleRunsClient_BeginCancel() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - 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.NewRunsClient().BeginCancel(ctx, "myResourceGroup", "myRegistry", "0accec26-d6de-4757-8e74-d080f38eaaab", 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/scopemaps_client_example_test.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/scopemaps_client_example_test.go deleted file mode 100644 index 099746cb6619..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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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.0707808Z"); return t}()), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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.0707808Z"); return t}()), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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.0707808Z"); return t}()), - // ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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.0707808Z"); 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 4ec6b2012a69..000000000000 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/taskruns_client_example_test.go +++ /dev/null @@ -1,408 +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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsGet.json -func ExampleTaskRunsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - 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.9261521+00:00"); return t}()), - // FinishTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-06T17:23:29.8792157+00:00"); return t}()), - // IsArchiveEnabled: to.Ptr(true), - // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-06T17:23:29+00:00"); 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.1348714+00:00"); return t}()), - // Status: to.Ptr(armcontainerregistry.RunStatusSucceeded), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsCreate.json -func ExampleTaskRunsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - 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.9261521+00:00"); return t}()), - // IsArchiveEnabled: to.Ptr(true), - // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-06T17:23:21+00:00"); 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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsDelete.json -func ExampleTaskRunsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - 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().BeginDelete(ctx, "myResourceGroup", "myRegistry", "myRun", 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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsUpdate.json -func ExampleTaskRunsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - 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.1184031+00:00"); return t}()), - // IsArchiveEnabled: to.Ptr(true), - // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-06T17:31:34+00:00"); 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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsGetDetails.json -func ExampleTaskRunsClient_GetDetails() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - 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.9261521+00:00"); return t}()), - // FinishTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-06T17:23:29.8792157+00:00"); return t}()), - // IsArchiveEnabled: to.Ptr(true), - // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-06T17:23:29+00:00"); 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.1348714+00:00"); return t}()), - // Status: to.Ptr(armcontainerregistry.RunStatusSucceeded), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsList.json -func ExampleTaskRunsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - 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.2278794+00:00"); return t}()), - // FinishTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-04T17:15:37.0349516+00:00"); return t}()), - // IsArchiveEnabled: to.Ptr(true), - // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-04T17:15:37+00:00"); 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.4589616+00:00"); 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 09c531205fd1..000000000000 --- a/sdk/resourcemanager/containerregistry/armcontainerregistry/tasks_client_example_test.go +++ /dev/null @@ -1,1651 +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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksList.json -func ExampleTasksClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - 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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksGet.json -func ExampleTasksClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - 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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksCreate.json -func ExampleTasksClient_BeginCreate_tasksCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - 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.NewTasksClient().BeginCreate(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) - } - 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.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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksCreate_QuickTask.json -func ExampleTasksClient_BeginCreate_tasksCreateQuickTask() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - 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.NewTasksClient().BeginCreate(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) - } - 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.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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/ManagedIdentity/TasksCreate_WithSystemAndUserIdentities.json -func ExampleTasksClient_BeginCreate_tasksCreateWithSystemAndUserIdentities() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - 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.NewTasksClient().BeginCreate(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) - } - 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.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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/ManagedIdentity/TasksCreate_WithUserIdentities.json -func ExampleTasksClient_BeginCreate_tasksCreateWithUserIdentities() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - 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.NewTasksClient().BeginCreate(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) - } - 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.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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/ManagedIdentity/TasksCreate_WithSystemIdentity.json -func ExampleTasksClient_BeginCreate_tasksCreateWithUserIdentitiesWithSystemIdentity() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - 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.NewTasksClient().BeginCreate(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) - } - 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.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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksDelete.json -func ExampleTasksClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - 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.NewTasksClient().BeginDelete(ctx, "myResourceGroup", "myRegistry", "myTask", 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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksUpdate.json -func ExampleTasksClient_BeginUpdate_tasksUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - 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.NewTasksClient().BeginUpdate(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) - } - 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.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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksUpdate_QuickTask.json -func ExampleTasksClient_BeginUpdate_tasksUpdateQuickTask() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - 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.NewTasksClient().BeginUpdate(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) - } - 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.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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/ManagedIdentity/TasksUpdate_WithKeyVaultCustomCredentials.json -func ExampleTasksClient_BeginUpdate_tasksUpdateWithKeyVaultCustomCredentials() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - 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.NewTasksClient().BeginUpdate(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) - } - 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.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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/ManagedIdentity/TasksUpdate_WithMSICustomCredentials.json -func ExampleTasksClient_BeginUpdate_tasksUpdateWithMsiCustomCredentials() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - 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.NewTasksClient().BeginUpdate(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) - } - 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.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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksUpdate_WithOpaqueCustomCredentials.json -func ExampleTasksClient_BeginUpdate_tasksUpdateWithOpaqueCustomCredentials() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - 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.NewTasksClient().BeginUpdate(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) - } - 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.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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksGetDetails.json -func ExampleTasksClient_GetDetails() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - 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_example_test.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/tokens_client_example_test.go deleted file mode 100644 index 5dcabaafeffc..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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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.0707808Z"); 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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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.0707808Z"); 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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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.0707808Z"); 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.0707808Z"); 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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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.0707808Z"); 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_example_test.go b/sdk/resourcemanager/containerregistry/armcontainerregistry/webhooks_client_example_test.go deleted file mode 100644 index bb2a36ce200d..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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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("Basic 000000000000000000000000000000000000000000000000000"), - }, - 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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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("Basic 000000000000000000000000000000000000000000000000000"), - }, - 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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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.0707808Z"); 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/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-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("Basic 000000000000000000000000000000000000000000000000000"), - // }, - // ServiceURI: to.Ptr("http://myservice.com"), - // } -}