diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/Azure.ResourceManager.ContainerRegistryTasks.sln b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/Azure.ResourceManager.ContainerRegistryTasks.sln
new file mode 100644
index 000000000000..ec4b80812b46
--- /dev/null
+++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/Azure.ResourceManager.ContainerRegistryTasks.sln
@@ -0,0 +1,30 @@
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.0.31903.59
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.ContainerRegistryTasks", "src\Azure.ResourceManager.ContainerRegistryTasks.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.ContainerRegistryTasks.Tests", "tests\Azure.ResourceManager.ContainerRegistryTasks.Tests.csproj", "{E2E6A1D6-8F7B-4F92-B8A3-1C3D5E7F9A2B}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU
+ {E2E6A1D6-8F7B-4F92-B8A3-1C3D5E7F9A2B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {E2E6A1D6-8F7B-4F92-B8A3-1C3D5E7F9A2B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {E2E6A1D6-8F7B-4F92-B8A3-1C3D5E7F9A2B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {E2E6A1D6-8F7B-4F92-B8A3-1C3D5E7F9A2B}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE}
+ EndGlobalSection
+EndGlobal
diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/CHANGELOG.md b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/CHANGELOG.md
new file mode 100644
index 000000000000..e8b37573af11
--- /dev/null
+++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/CHANGELOG.md
@@ -0,0 +1,8 @@
+# Release History
+
+## 1.0.0-beta.1 (2026-03-13)
+
+### Features Added
+
+- Initial release of `Azure.ResourceManager.ContainerRegistryTasks` for managing Container Registry Tasks resources (Tasks, Runs, TaskRuns, and Agent Pools).
+- This package provides dedicated management of the `Microsoft.ContainerRegistry/RegistryTasks` resource provider, separated from the `Azure.ResourceManager.ContainerRegistry` package where these resources were previously included.
\ No newline at end of file
diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/Directory.Build.props b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/Directory.Build.props
new file mode 100644
index 000000000000..63bd836ad44b
--- /dev/null
+++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/Directory.Build.props
@@ -0,0 +1,6 @@
+
+
+
+
diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/README.md b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/README.md
new file mode 100644
index 000000000000..99e997403989
--- /dev/null
+++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/README.md
@@ -0,0 +1,80 @@
+# Microsoft Azure containerregistrytasks management client library for .NET
+
+The Azure Container Registry Tasks .NET client library enables you to manage Azure Container Registry task resources, including task definitions, runs, triggers, and related configuration.
+
+This library follows the [new Azure SDK guidelines](https://azure.github.io/azure-sdk/general_introduction.html), and provides many core capabilities:
+
+ - Support MSAL.NET, Azure.Identity is out of box for supporting MSAL.NET.
+ - Support [OpenTelemetry](https://opentelemetry.io/) for distributed tracing.
+ - HTTP pipeline with custom policies.
+ - Better error-handling.
+ - Support uniform telemetry across all languages.
+
+## Getting started
+
+### Install the package
+
+Install the Microsoft Azure containerregistrytasks management library for .NET with [NuGet](https://www.nuget.org/):
+
+```dotnetcli
+dotnet add package Azure.ResourceManager.containerregistrytasks --prerelease
+```
+
+### Prerequisites
+
+* You must have a [Microsoft Azure subscription](https://azure.microsoft.com/free/dotnet/).
+
+### Authenticate the Client
+
+To create an authenticated client and start interacting with Microsoft Azure resources, see the [quickstart guide here](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md).
+
+## Key concepts
+
+Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azure.github.io/azure-sdk/dotnet_introduction.html)
+
+## Documentation
+
+Documentation is available to help you learn how to use this package:
+
+- [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md).
+- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet).
+- [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md).
+
+## Examples
+
+Code samples for using the management library for .NET can be found in the following locations
+- [.NET Management Library Code Samples](https://aka.ms/azuresdk-net-mgmt-samples)
+
+## Troubleshooting
+
+- File an issue via [GitHub Issues](https://github.com/Azure/azure-sdk-for-net/issues).
+- Check [previous questions](https://stackoverflow.com/questions/tagged/azure+.net) or ask new ones on Stack Overflow using Azure and .NET tags.
+
+## Next steps
+
+For more information about Microsoft Azure SDK, see [this website](https://azure.github.io/azure-sdk/).
+
+## Contributing
+
+For details on contributing to this repository, see the [contributing
+guide][cg].
+
+This project welcomes contributions and suggestions. Most contributions
+require you to agree to a Contributor License Agreement (CLA) declaring
+that you have the right to, and actually do, grant us the rights to use
+your contribution. For details, visit .
+
+When you submit a pull request, a CLA-bot will automatically determine
+whether you need to provide a CLA and decorate the PR appropriately
+(for example, label, comment). Follow the instructions provided by the
+bot. You'll only need to do this action once across all repositories
+using our CLA.
+
+This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For
+more information, see the [Code of Conduct FAQ][coc_faq] or contact
+ with any other questions or comments.
+
+
+[cg]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md
+[coc]: https://opensource.microsoft.com/codeofconduct/
+[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/
diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/assets.json b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/assets.json
new file mode 100644
index 000000000000..fc70647de1a0
--- /dev/null
+++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/assets.json
@@ -0,0 +1,7 @@
+
+{
+ "AssetsRepo": "Azure/azure-sdk-assets",
+ "AssetsRepoPrefixPath": "net",
+ "TagPrefix": "net/containerregistrytasks/Azure.ResourceManager.containerregistrytasks",
+ "Tag": ""
+}
diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/metadata.json b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/metadata.json
new file mode 100644
index 000000000000..608fe7ee617b
--- /dev/null
+++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/metadata.json
@@ -0,0 +1,5 @@
+{
+ "apiVersions": {
+ "Microsoft.ContainerRegistry": "2025-03-01-preview"
+ }
+}
\ No newline at end of file
diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Azure.ResourceManager.ContainerRegistryTasks.csproj b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Azure.ResourceManager.ContainerRegistryTasks.csproj
new file mode 100644
index 000000000000..9ae1b7eb98d7
--- /dev/null
+++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Azure.ResourceManager.ContainerRegistryTasks.csproj
@@ -0,0 +1,9 @@
+
+
+ This is the Azure.ResourceManager.ContainerRegistryTasks client library for developing .NET applications with rich experience.
+ SDK Code Generation Azure.ResourceManager.ContainerRegistryTasks
+ 1.0.0-beta.1
+ Azure.ResourceManager.ContainerRegistryTasks
+ true
+
+
diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/AgentPoolCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/AgentPoolCollection.cs
new file mode 100644
index 000000000000..06e6a18c24e3
--- /dev/null
+++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/AgentPoolCollection.cs
@@ -0,0 +1,584 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager;
+using Azure.ResourceManager.Resources;
+
+namespace Azure.ResourceManager.ContainerRegistryTasks
+{
+ ///
+ /// A class representing a collection of and their operations.
+ /// Each in the collection will belong to the same instance of .
+ /// To get a instance call the GetAgentPools method from an instance of .
+ ///
+ public partial class AgentPoolCollection : ArmCollection, IEnumerable, IAsyncEnumerable
+ {
+ private readonly ClientDiagnostics _agentPoolsClientDiagnostics;
+ private readonly AgentPools _agentPoolsRestClient;
+ /// The registryName.
+ private readonly string _registryName;
+
+ /// Initializes a new instance of AgentPoolCollection for mocking.
+ protected AgentPoolCollection()
+ {
+ }
+
+ /// Initializes a new instance of class.
+ /// The client parameters to use in these operations.
+ /// The identifier of the resource that is the target of operations.
+ /// The registryName for the resource.
+ internal AgentPoolCollection(ArmClient client, ResourceIdentifier id, string registryName) : base(client, id)
+ {
+ TryGetApiVersion(AgentPoolResource.ResourceType, out string agentPoolApiVersion);
+ _registryName = registryName;
+ _agentPoolsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerRegistryTasks", AgentPoolResource.ResourceType.Namespace, Diagnostics);
+ _agentPoolsRestClient = new AgentPools(_agentPoolsClientDiagnostics, Pipeline, Endpoint, agentPoolApiVersion ?? "2025-03-01-preview");
+ ValidateResourceId(id);
+ }
+
+ ///
+ [Conditional("DEBUG")]
+ internal static void ValidateResourceId(ResourceIdentifier id)
+ {
+ if (id.ResourceType != ResourceGroupResource.ResourceType)
+ {
+ throw new ArgumentException(string.Format("Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), id);
+ }
+ }
+
+ ///
+ /// Creates an agent pool for a container registry with the specified parameters.
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}.
+ ///
+ /// -
+ /// Operation Id.
+ /// AgentPools_Create.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-03-01-preview.
+ ///
+ ///
+ ///
+ /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// The name of the agent pool.
+ /// The parameters of an agent pool that needs to scheduled.
+ /// The cancellation token to use.
+ /// or is null.
+ /// is an empty string, and was expected to be non-empty.
+ public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string agentPoolName, AgentPoolData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName));
+ Argument.AssertNotNull(data, nameof(data));
+
+ using DiagnosticScope scope = _agentPoolsClientDiagnostics.CreateScope("AgentPoolCollection.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = _agentPoolsRestClient.CreateCreateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, _registryName, agentPoolName, AgentPoolData.ToRequestContent(data), context);
+ Response response = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ ContainerRegistryTasksArmOperation operation = new ContainerRegistryTasksArmOperation(
+ new AgentPoolOperationSource(Client),
+ _agentPoolsClientDiagnostics,
+ Pipeline,
+ message.Request,
+ response,
+ OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ {
+ await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
+ }
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Creates an agent pool for a container registry with the specified parameters.
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}.
+ ///
+ /// -
+ /// Operation Id.
+ /// AgentPools_Create.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-03-01-preview.
+ ///
+ ///
+ ///
+ /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// The name of the agent pool.
+ /// The parameters of an agent pool that needs to scheduled.
+ /// The cancellation token to use.
+ /// or is null.
+ /// is an empty string, and was expected to be non-empty.
+ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string agentPoolName, AgentPoolData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName));
+ Argument.AssertNotNull(data, nameof(data));
+
+ using DiagnosticScope scope = _agentPoolsClientDiagnostics.CreateScope("AgentPoolCollection.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = _agentPoolsRestClient.CreateCreateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, _registryName, agentPoolName, AgentPoolData.ToRequestContent(data), context);
+ Response response = Pipeline.ProcessMessage(message, context);
+ ContainerRegistryTasksArmOperation operation = new ContainerRegistryTasksArmOperation(
+ new AgentPoolOperationSource(Client),
+ _agentPoolsClientDiagnostics,
+ Pipeline,
+ message.Request,
+ response,
+ OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ {
+ operation.WaitForCompletion(cancellationToken);
+ }
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Gets the detailed information for a given agent pool.
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}.
+ ///
+ /// -
+ /// Operation Id.
+ /// AgentPools_Get.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-03-01-preview.
+ ///
+ ///
+ ///
+ /// The name of the agent pool.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ public virtual async Task> GetAsync(string agentPoolName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName));
+
+ using DiagnosticScope scope = _agentPoolsClientDiagnostics.CreateScope("AgentPoolCollection.Get");
+ scope.Start();
+ try
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = _agentPoolsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, _registryName, agentPoolName, context);
+ Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ Response response = Response.FromValue(AgentPoolData.FromResponse(result), result);
+ if (response.Value == null)
+ {
+ throw new RequestFailedException(response.GetRawResponse());
+ }
+ return Response.FromValue(new AgentPoolResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Gets the detailed information for a given agent pool.
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}.
+ ///
+ /// -
+ /// Operation Id.
+ /// AgentPools_Get.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-03-01-preview.
+ ///
+ ///
+ ///
+ /// The name of the agent pool.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ public virtual Response Get(string agentPoolName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName));
+
+ using DiagnosticScope scope = _agentPoolsClientDiagnostics.CreateScope("AgentPoolCollection.Get");
+ scope.Start();
+ try
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = _agentPoolsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, _registryName, agentPoolName, context);
+ Response result = Pipeline.ProcessMessage(message, context);
+ Response response = Response.FromValue(AgentPoolData.FromResponse(result), result);
+ if (response.Value == null)
+ {
+ throw new RequestFailedException(response.GetRawResponse());
+ }
+ return Response.FromValue(new AgentPoolResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Lists all the agent pools for a specified container registry.
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools.
+ ///
+ /// -
+ /// Operation Id.
+ /// AgentPools_List.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-03-01-preview.
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ /// A collection of that may take multiple service requests to iterate over.
+ public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default)
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ return new AsyncPageableWrapper(new AgentPoolsGetAllAsyncCollectionResultOfT(_agentPoolsRestClient, Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, _registryName, context), data => new AgentPoolResource(Client, data));
+ }
+
+ ///
+ /// Lists all the agent pools for a specified container registry.
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools.
+ ///
+ /// -
+ /// Operation Id.
+ /// AgentPools_List.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-03-01-preview.
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ /// A collection of that may take multiple service requests to iterate over.
+ public virtual Pageable GetAll(CancellationToken cancellationToken = default)
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ return new PageableWrapper(new AgentPoolsGetAllCollectionResultOfT(_agentPoolsRestClient, Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, _registryName, context), data => new AgentPoolResource(Client, data));
+ }
+
+ ///
+ /// Checks to see if the resource exists in azure.
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}.
+ ///
+ /// -
+ /// Operation Id.
+ /// AgentPools_Get.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-03-01-preview.
+ ///
+ ///
+ ///
+ /// The name of the agent pool.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ public virtual async Task> ExistsAsync(string agentPoolName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName));
+
+ using DiagnosticScope scope = _agentPoolsClientDiagnostics.CreateScope("AgentPoolCollection.Exists");
+ scope.Start();
+ try
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = _agentPoolsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, _registryName, agentPoolName, context);
+ await Pipeline.SendAsync(message, context.CancellationToken).ConfigureAwait(false);
+ Response result = message.Response;
+ Response response = default;
+ switch (result.Status)
+ {
+ case 200:
+ response = Response.FromValue(AgentPoolData.FromResponse(result), result);
+ break;
+ case 404:
+ response = Response.FromValue((AgentPoolData)null, result);
+ break;
+ default:
+ throw new RequestFailedException(result);
+ }
+ return Response.FromValue(response.Value != null, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Checks to see if the resource exists in azure.
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}.
+ ///
+ /// -
+ /// Operation Id.
+ /// AgentPools_Get.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-03-01-preview.
+ ///
+ ///
+ ///
+ /// The name of the agent pool.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ public virtual Response Exists(string agentPoolName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName));
+
+ using DiagnosticScope scope = _agentPoolsClientDiagnostics.CreateScope("AgentPoolCollection.Exists");
+ scope.Start();
+ try
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = _agentPoolsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, _registryName, agentPoolName, context);
+ Pipeline.Send(message, context.CancellationToken);
+ Response result = message.Response;
+ Response response = default;
+ switch (result.Status)
+ {
+ case 200:
+ response = Response.FromValue(AgentPoolData.FromResponse(result), result);
+ break;
+ case 404:
+ response = Response.FromValue((AgentPoolData)null, result);
+ break;
+ default:
+ throw new RequestFailedException(result);
+ }
+ return Response.FromValue(response.Value != null, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Tries to get details for this resource from the service.
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}.
+ ///
+ /// -
+ /// Operation Id.
+ /// AgentPools_Get.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-03-01-preview.
+ ///
+ ///
+ ///
+ /// The name of the agent pool.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ public virtual async Task> GetIfExistsAsync(string agentPoolName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName));
+
+ using DiagnosticScope scope = _agentPoolsClientDiagnostics.CreateScope("AgentPoolCollection.GetIfExists");
+ scope.Start();
+ try
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = _agentPoolsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, _registryName, agentPoolName, context);
+ await Pipeline.SendAsync(message, context.CancellationToken).ConfigureAwait(false);
+ Response result = message.Response;
+ Response response = default;
+ switch (result.Status)
+ {
+ case 200:
+ response = Response.FromValue(AgentPoolData.FromResponse(result), result);
+ break;
+ case 404:
+ response = Response.FromValue((AgentPoolData)null, result);
+ break;
+ default:
+ throw new RequestFailedException(result);
+ }
+ if (response.Value == null)
+ {
+ return new NoValueResponse(response.GetRawResponse());
+ }
+ return Response.FromValue(new AgentPoolResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Tries to get details for this resource from the service.
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}.
+ ///
+ /// -
+ /// Operation Id.
+ /// AgentPools_Get.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-03-01-preview.
+ ///
+ ///
+ ///
+ /// The name of the agent pool.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ public virtual NullableResponse GetIfExists(string agentPoolName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName));
+
+ using DiagnosticScope scope = _agentPoolsClientDiagnostics.CreateScope("AgentPoolCollection.GetIfExists");
+ scope.Start();
+ try
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = _agentPoolsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, _registryName, agentPoolName, context);
+ Pipeline.Send(message, context.CancellationToken);
+ Response result = message.Response;
+ Response response = default;
+ switch (result.Status)
+ {
+ case 200:
+ response = Response.FromValue(AgentPoolData.FromResponse(result), result);
+ break;
+ case 404:
+ response = Response.FromValue((AgentPoolData)null, result);
+ break;
+ default:
+ throw new RequestFailedException(result);
+ }
+ if (response.Value == null)
+ {
+ return new NoValueResponse(response.GetRawResponse());
+ }
+ return Response.FromValue(new AgentPoolResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return GetAll().GetEnumerator();
+ }
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return GetAll().GetEnumerator();
+ }
+
+ /// The cancellation token to use.
+ IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken)
+ {
+ return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken);
+ }
+ }
+}
diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/AgentPoolData.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/AgentPoolData.Serialization.cs
new file mode 100644
index 000000000000..33580cd7de70
--- /dev/null
+++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/AgentPoolData.Serialization.cs
@@ -0,0 +1,234 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Collections.Generic;
+using System.Text;
+using System.Text.Json;
+using Azure;
+using Azure.Core;
+using Azure.ResourceManager.ContainerRegistryTasks.Models;
+using Azure.ResourceManager.Models;
+
+namespace Azure.ResourceManager.ContainerRegistryTasks
+{
+ ///
+ /// The agentpool that has the ARM resource and properties.
+ /// The agentpool will have all information to create an agent pool.
+ ///
+ public partial class AgentPoolData : TrackedResourceData, IJsonModel
+ {
+ /// Initializes a new instance of for deserialization.
+ internal AgentPoolData()
+ {
+ }
+
+ /// The data to parse.
+ /// The client options for reading and writing models.
+ protected virtual ResourceData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options)
+ {
+ string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ switch (format)
+ {
+ case "J":
+ using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions))
+ {
+ return DeserializeAgentPoolData(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(AgentPoolData)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ /// The client options for reading and writing models.
+ protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options)
+ {
+ string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options, AzureResourceManagerContainerRegistryTasksContext.Default);
+ default:
+ throw new FormatException($"The model {nameof(AgentPoolData)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ /// The client options for reading and writing models.
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options);
+
+ /// The data to parse.
+ /// The client options for reading and writing models.
+ AgentPoolData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (AgentPoolData)PersistableModelCreateCore(data, options);
+
+ /// The client options for reading and writing models.
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+
+ /// The to serialize into .
+ internal static RequestContent ToRequestContent(AgentPoolData agentPoolData)
+ {
+ if (agentPoolData == null)
+ {
+ return null;
+ }
+ Utf8JsonRequestContent content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(agentPoolData, ModelSerializationExtensions.WireOptions);
+ return content;
+ }
+
+ /// The to deserialize the from.
+ internal static AgentPoolData FromResponse(Response response)
+ {
+ using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeAgentPoolData(document.RootElement, ModelSerializationExtensions.WireOptions);
+ }
+
+ /// The JSON writer.
+ /// The client options for reading and writing models.
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ writer.WriteStartObject();
+ JsonModelWriteCore(writer, options);
+ writer.WriteEndObject();
+ }
+
+ /// The JSON writer.
+ /// The client options for reading and writing models.
+ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(AgentPoolData)} does not support writing '{format}' format.");
+ }
+ base.JsonModelWriteCore(writer, options);
+ if (Optional.IsDefined(Properties))
+ {
+ writer.WritePropertyName("properties"u8);
+ writer.WriteObjectValue(Properties, options);
+ }
+ }
+
+ /// The JSON reader.
+ /// The client options for reading and writing models.
+ AgentPoolData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (AgentPoolData)JsonModelCreateCore(ref reader, options);
+
+ /// The JSON reader.
+ /// The client options for reading and writing models.
+ protected virtual ResourceData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ {
+ string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(AgentPoolData)} does not support reading '{format}' format.");
+ }
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeAgentPoolData(document.RootElement, options);
+ }
+
+ /// The JSON element to deserialize.
+ /// The client options for reading and writing models.
+ internal static AgentPoolData DeserializeAgentPoolData(JsonElement element, ModelReaderWriterOptions options)
+ {
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ ResourceIdentifier id = default;
+ string name = default;
+ ResourceType resourceType = default;
+ SystemData systemData = default;
+ IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary();
+ IDictionary tags = default;
+ AzureLocation location = default;
+ AgentPoolProperties properties = default;
+ foreach (var prop in element.EnumerateObject())
+ {
+ if (prop.NameEquals("id"u8))
+ {
+ if (prop.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ id = new ResourceIdentifier(prop.Value.GetString());
+ continue;
+ }
+ if (prop.NameEquals("name"u8))
+ {
+ name = prop.Value.GetString();
+ continue;
+ }
+ if (prop.NameEquals("type"u8))
+ {
+ if (prop.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ resourceType = new ResourceType(prop.Value.GetString());
+ continue;
+ }
+ if (prop.NameEquals("systemData"u8))
+ {
+ if (prop.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(prop.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerContainerRegistryTasksContext.Default);
+ continue;
+ }
+ if (prop.NameEquals("tags"u8))
+ {
+ if (prop.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ Dictionary dictionary = new Dictionary();
+ foreach (var prop0 in prop.Value.EnumerateObject())
+ {
+ if (prop0.Value.ValueKind == JsonValueKind.Null)
+ {
+ dictionary.Add(prop0.Name, null);
+ }
+ else
+ {
+ dictionary.Add(prop0.Name, prop0.Value.GetString());
+ }
+ }
+ tags = dictionary;
+ continue;
+ }
+ if (prop.NameEquals("location"u8))
+ {
+ location = new AzureLocation(prop.Value.GetString());
+ continue;
+ }
+ if (prop.NameEquals("properties"u8))
+ {
+ if (prop.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ properties = AgentPoolProperties.DeserializeAgentPoolProperties(prop.Value, options);
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText()));
+ }
+ }
+ return new AgentPoolData(
+ id,
+ name,
+ resourceType,
+ systemData,
+ additionalBinaryDataProperties,
+ tags ?? new ChangeTrackingDictionary(),
+ location,
+ properties);
+ }
+ }
+}
diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/AgentPoolData.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/AgentPoolData.cs
new file mode 100644
index 000000000000..7a82b8b45815
--- /dev/null
+++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/AgentPoolData.cs
@@ -0,0 +1,126 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using Azure.Core;
+using Azure.ResourceManager.ContainerRegistryTasks.Models;
+using Azure.ResourceManager.Models;
+
+namespace Azure.ResourceManager.ContainerRegistryTasks
+{
+ ///
+ /// The agentpool that has the ARM resource and properties.
+ /// The agentpool will have all information to create an agent pool.
+ ///
+ public partial class AgentPoolData : TrackedResourceData
+ {
+ /// Keeps track of any properties unknown to the library.
+ private protected readonly IDictionary _additionalBinaryDataProperties;
+
+ /// Initializes a new instance of .
+ /// The geo-location where the resource lives.
+ public AgentPoolData(AzureLocation location) : base(location)
+ {
+ }
+
+ /// Initializes a new instance of .
+ /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ /// The name of the resource.
+ /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".
+ /// Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ /// Keeps track of any properties unknown to the library.
+ /// Resource tags.
+ /// The geo-location where the resource lives.
+ /// The properties associated with the agent pool.
+ internal AgentPoolData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary additionalBinaryDataProperties, IDictionary tags, AzureLocation location, AgentPoolProperties properties) : base(id, name, resourceType, systemData, tags, location)
+ {
+ _additionalBinaryDataProperties = additionalBinaryDataProperties;
+ Properties = properties;
+ }
+
+ /// The properties associated with the agent pool.
+ internal AgentPoolProperties Properties { get; set; }
+
+ /// The count of agent machine.
+ public int? Count
+ {
+ get
+ {
+ return Properties is null ? default : Properties.Count;
+ }
+ set
+ {
+ if (Properties is null)
+ {
+ Properties = new AgentPoolProperties();
+ }
+ Properties.Count = value.Value;
+ }
+ }
+
+ /// The Tier of agent machine.
+ public string Tier
+ {
+ get
+ {
+ return Properties is null ? default : Properties.Tier;
+ }
+ set
+ {
+ if (Properties is null)
+ {
+ Properties = new AgentPoolProperties();
+ }
+ Properties.Tier = value;
+ }
+ }
+
+ /// The OS of agent machine.
+ public ContainerRegistryTaskOS? OS
+ {
+ get
+ {
+ return Properties is null ? default : Properties.OS;
+ }
+ set
+ {
+ if (Properties is null)
+ {
+ Properties = new AgentPoolProperties();
+ }
+ Properties.OS = value.Value;
+ }
+ }
+
+ /// The Virtual Network Subnet Resource Id of the agent machine.
+ public ResourceIdentifier VirtualNetworkSubnetResourceId
+ {
+ get
+ {
+ return Properties is null ? default : Properties.VirtualNetworkSubnetResourceId;
+ }
+ set
+ {
+ if (Properties is null)
+ {
+ Properties = new AgentPoolProperties();
+ }
+ Properties.VirtualNetworkSubnetResourceId = value;
+ }
+ }
+
+ /// The provisioning state of this agent pool.
+ public ContainerRegistryTaskProvisioningState? ProvisioningState
+ {
+ get
+ {
+ return Properties is null ? default : Properties.ProvisioningState;
+ }
+ }
+ }
+}
diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/AgentPoolResource.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/AgentPoolResource.Serialization.cs
new file mode 100644
index 000000000000..e13773cdafe1
--- /dev/null
+++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/AgentPoolResource.Serialization.cs
@@ -0,0 +1,39 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Text.Json;
+
+namespace Azure.ResourceManager.ContainerRegistryTasks
+{
+ ///
+ public partial class AgentPoolResource : IJsonModel
+ {
+ private static IJsonModel s_dataDeserializationInstance;
+
+ private static IJsonModel DataDeserializationInstance => s_dataDeserializationInstance ??= new AgentPoolData();
+
+ /// The writer to serialize the model to.
+ /// The client options for reading and writing models.
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options);
+
+ /// The reader for deserializing the model.
+ /// The client options for reading and writing models.
+ AgentPoolData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => DataDeserializationInstance.Create(ref reader, options);
+
+ /// The client options for reading and writing models.
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerContainerRegistryTasksContext.Default);
+
+ /// The binary data to be processed.
+ /// The client options for reading and writing models.
+ AgentPoolData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerContainerRegistryTasksContext.Default);
+
+ /// The client options for reading and writing models.
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => DataDeserializationInstance.GetFormatFromOptions(options);
+ }
+}
diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/AgentPoolResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/AgentPoolResource.cs
new file mode 100644
index 000000000000..3619bac42c35
--- /dev/null
+++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/AgentPoolResource.cs
@@ -0,0 +1,779 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager;
+using Azure.ResourceManager.ContainerRegistryTasks.Models;
+using Azure.ResourceManager.Resources;
+
+namespace Azure.ResourceManager.ContainerRegistryTasks
+{
+ ///
+ /// A class representing a AgentPool along with the instance operations that can be performed on it.
+ /// If you have a you can construct a from an instance of using the GetResource method.
+ /// Otherwise you can get one from its parent resource using the GetAgentPools method.
+ ///
+ public partial class AgentPoolResource : ArmResource
+ {
+ private readonly ClientDiagnostics _agentPoolsClientDiagnostics;
+ private readonly AgentPools _agentPoolsRestClient;
+ private readonly AgentPoolData _data;
+ /// Gets the resource type for the operations.
+ public static readonly ResourceType ResourceType = "Microsoft.ContainerRegistry/registries/agentPools";
+
+ /// Initializes a new instance of AgentPoolResource for mocking.
+ protected AgentPoolResource()
+ {
+ }
+
+ /// Initializes a new instance of class.
+ /// The client parameters to use in these operations.
+ /// The resource that is the target of operations.
+ internal AgentPoolResource(ArmClient client, AgentPoolData data) : this(client, data.Id)
+ {
+ HasData = true;
+ _data = data;
+ }
+
+ /// Initializes a new instance of class.
+ /// The client parameters to use in these operations.
+ /// The identifier of the resource that is the target of operations.
+ internal AgentPoolResource(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ TryGetApiVersion(ResourceType, out string agentPoolApiVersion);
+ _agentPoolsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerRegistryTasks", ResourceType.Namespace, Diagnostics);
+ _agentPoolsRestClient = new AgentPools(_agentPoolsClientDiagnostics, Pipeline, Endpoint, agentPoolApiVersion ?? "2025-03-01-preview");
+ ValidateResourceId(id);
+ }
+
+ /// Gets whether or not the current instance has data.
+ public virtual bool HasData { get; }
+
+ /// Gets the data representing this Feature.
+ public virtual AgentPoolData Data
+ {
+ get
+ {
+ if (!HasData)
+ {
+ throw new InvalidOperationException("The current instance does not have data, you must call Get first.");
+ }
+ return _data;
+ }
+ }
+
+ /// Generate the resource identifier for this resource.
+ /// The subscriptionId.
+ /// The resourceGroupName.
+ /// The registryName.
+ /// The agentPoolName.
+ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string agentPoolName)
+ {
+ string resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}";
+ return new ResourceIdentifier(resourceId);
+ }
+
+ ///
+ [Conditional("DEBUG")]
+ internal static void ValidateResourceId(ResourceIdentifier id)
+ {
+ if (id.ResourceType != ResourceType)
+ {
+ throw new ArgumentException(string.Format("Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), id);
+ }
+ }
+
+ ///
+ /// Gets the detailed information for a given agent pool.
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}.
+ ///
+ /// -
+ /// Operation Id.
+ /// AgentPools_Get.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-03-01-preview.
+ ///
+ /// -
+ /// Resource.
+ /// .
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ public virtual async Task> GetAsync(CancellationToken cancellationToken = default)
+ {
+ using DiagnosticScope scope = _agentPoolsClientDiagnostics.CreateScope("AgentPoolResource.Get");
+ scope.Start();
+ try
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = _agentPoolsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, context);
+ Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ Response response = Response.FromValue(AgentPoolData.FromResponse(result), result);
+ if (response.Value == null)
+ {
+ throw new RequestFailedException(response.GetRawResponse());
+ }
+ return Response.FromValue(new AgentPoolResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Gets the detailed information for a given agent pool.
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}.
+ ///
+ /// -
+ /// Operation Id.
+ /// AgentPools_Get.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-03-01-preview.
+ ///
+ /// -
+ /// Resource.
+ /// .
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ public virtual Response Get(CancellationToken cancellationToken = default)
+ {
+ using DiagnosticScope scope = _agentPoolsClientDiagnostics.CreateScope("AgentPoolResource.Get");
+ scope.Start();
+ try
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = _agentPoolsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, context);
+ Response result = Pipeline.ProcessMessage(message, context);
+ Response response = Response.FromValue(AgentPoolData.FromResponse(result), result);
+ if (response.Value == null)
+ {
+ throw new RequestFailedException(response.GetRawResponse());
+ }
+ return Response.FromValue(new AgentPoolResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Updates an agent pool with the specified parameters.
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}.
+ ///
+ /// -
+ /// Operation Id.
+ /// AgentPools_Update.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-03-01-preview.
+ ///
+ /// -
+ /// Resource.
+ /// .
+ ///
+ ///
+ ///
+ /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// The parameters for updating an agent pool.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual async Task> UpdateAsync(WaitUntil waitUntil, AgentPoolPatch patch, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(patch, nameof(patch));
+
+ using DiagnosticScope scope = _agentPoolsClientDiagnostics.CreateScope("AgentPoolResource.Update");
+ scope.Start();
+ try
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = _agentPoolsRestClient.CreateUpdateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, AgentPoolPatch.ToRequestContent(patch), context);
+ Response response = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ ContainerRegistryTasksArmOperation operation = new ContainerRegistryTasksArmOperation(
+ new AgentPoolOperationSource(Client),
+ _agentPoolsClientDiagnostics,
+ Pipeline,
+ message.Request,
+ response,
+ OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ {
+ await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
+ }
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Updates an agent pool with the specified parameters.
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}.
+ ///
+ /// -
+ /// Operation Id.
+ /// AgentPools_Update.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-03-01-preview.
+ ///
+ /// -
+ /// Resource.
+ /// .
+ ///
+ ///
+ ///
+ /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// The parameters for updating an agent pool.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual ArmOperation Update(WaitUntil waitUntil, AgentPoolPatch patch, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(patch, nameof(patch));
+
+ using DiagnosticScope scope = _agentPoolsClientDiagnostics.CreateScope("AgentPoolResource.Update");
+ scope.Start();
+ try
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = _agentPoolsRestClient.CreateUpdateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, AgentPoolPatch.ToRequestContent(patch), context);
+ Response response = Pipeline.ProcessMessage(message, context);
+ ContainerRegistryTasksArmOperation operation = new ContainerRegistryTasksArmOperation(
+ new AgentPoolOperationSource(Client),
+ _agentPoolsClientDiagnostics,
+ Pipeline,
+ message.Request,
+ response,
+ OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ {
+ operation.WaitForCompletion(cancellationToken);
+ }
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Deletes a specified agent pool resource.
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}.
+ ///
+ /// -
+ /// Operation Id.
+ /// AgentPools_Delete.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-03-01-preview.
+ ///
+ /// -
+ /// Resource.
+ /// .
+ ///
+ ///
+ ///
+ /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// The cancellation token to use.
+ public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default)
+ {
+ using DiagnosticScope scope = _agentPoolsClientDiagnostics.CreateScope("AgentPoolResource.Delete");
+ scope.Start();
+ try
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = _agentPoolsRestClient.CreateDeleteRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, context);
+ Response response = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ ContainerRegistryTasksArmOperation operation = new ContainerRegistryTasksArmOperation(_agentPoolsClientDiagnostics, Pipeline, message.Request, response, OperationFinalStateVia.Location);
+ if (waitUntil == WaitUntil.Completed)
+ {
+ await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false);
+ }
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Deletes a specified agent pool resource.
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}.
+ ///
+ /// -
+ /// Operation Id.
+ /// AgentPools_Delete.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-03-01-preview.
+ ///
+ /// -
+ /// Resource.
+ /// .
+ ///
+ ///
+ ///
+ /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// The cancellation token to use.
+ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default)
+ {
+ using DiagnosticScope scope = _agentPoolsClientDiagnostics.CreateScope("AgentPoolResource.Delete");
+ scope.Start();
+ try
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = _agentPoolsRestClient.CreateDeleteRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, context);
+ Response response = Pipeline.ProcessMessage(message, context);
+ ContainerRegistryTasksArmOperation operation = new ContainerRegistryTasksArmOperation(_agentPoolsClientDiagnostics, Pipeline, message.Request, response, OperationFinalStateVia.Location);
+ if (waitUntil == WaitUntil.Completed)
+ {
+ operation.WaitForCompletionResponse(cancellationToken);
+ }
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Gets the count of queued runs for a given agent pool.
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}/listQueueStatus.
+ ///
+ /// -
+ /// Operation Id.
+ /// AgentPools_GetQueueStatus.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-03-01-preview.
+ ///
+ /// -
+ /// Resource.
+ /// .
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ public virtual async Task> GetQueueStatusAsync(CancellationToken cancellationToken = default)
+ {
+ using DiagnosticScope scope = _agentPoolsClientDiagnostics.CreateScope("AgentPoolResource.GetQueueStatus");
+ scope.Start();
+ try
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = _agentPoolsRestClient.CreateGetQueueStatusRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, context);
+ Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ Response response = Response.FromValue(AgentPoolQueueStatus.FromResponse(result), result);
+ if (response.Value == null)
+ {
+ throw new RequestFailedException(response.GetRawResponse());
+ }
+ return response;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Gets the count of queued runs for a given agent pool.
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}/listQueueStatus.
+ ///
+ /// -
+ /// Operation Id.
+ /// AgentPools_GetQueueStatus.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-03-01-preview.
+ ///
+ /// -
+ /// Resource.
+ /// .
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ public virtual Response GetQueueStatus(CancellationToken cancellationToken = default)
+ {
+ using DiagnosticScope scope = _agentPoolsClientDiagnostics.CreateScope("AgentPoolResource.GetQueueStatus");
+ scope.Start();
+ try
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = _agentPoolsRestClient.CreateGetQueueStatusRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, context);
+ Response result = Pipeline.ProcessMessage(message, context);
+ Response response = Response.FromValue(AgentPoolQueueStatus.FromResponse(result), result);
+ if (response.Value == null)
+ {
+ throw new RequestFailedException(response.GetRawResponse());
+ }
+ return response;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Add a tag to the current resource.
+ /// The key for the tag.
+ /// The value for the tag.
+ /// The cancellation token to use.
+ /// or is null.
+ public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(key, nameof(key));
+ Argument.AssertNotNull(value, nameof(value));
+
+ using DiagnosticScope scope = _agentPoolsClientDiagnostics.CreateScope("AgentPoolResource.AddTag");
+ scope.Start();
+ try
+ {
+ if (await CanUseTagResourceAsync(cancellationToken).ConfigureAwait(false))
+ {
+ Response originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false);
+ originalTags.Value.Data.TagValues[key] = value;
+ await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken).ConfigureAwait(false);
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = _agentPoolsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, context);
+ Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ Response response = Response.FromValue(AgentPoolData.FromResponse(result), result);
+ return Response.FromValue(new AgentPoolResource(Client, response.Value), response.GetRawResponse());
+ }
+ else
+ {
+ AgentPoolData current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data;
+ AgentPoolPatch patch = new AgentPoolPatch();
+ foreach (KeyValuePair tag in current.Tags)
+ {
+ patch.Tags.Add(tag);
+ }
+ patch.Tags[key] = value;
+ ArmOperation result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return Response.FromValue(result.Value, result.GetRawResponse());
+ }
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Add a tag to the current resource.
+ /// The key for the tag.
+ /// The value for the tag.
+ /// The cancellation token to use.
+ /// or is null.
+ public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(key, nameof(key));
+ Argument.AssertNotNull(value, nameof(value));
+
+ using DiagnosticScope scope = _agentPoolsClientDiagnostics.CreateScope("AgentPoolResource.AddTag");
+ scope.Start();
+ try
+ {
+ if (CanUseTagResource(cancellationToken))
+ {
+ Response originalTags = GetTagResource().Get(cancellationToken);
+ originalTags.Value.Data.TagValues[key] = value;
+ GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken);
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = _agentPoolsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, context);
+ Response result = Pipeline.ProcessMessage(message, context);
+ Response response = Response.FromValue(AgentPoolData.FromResponse(result), result);
+ return Response.FromValue(new AgentPoolResource(Client, response.Value), response.GetRawResponse());
+ }
+ else
+ {
+ AgentPoolData current = Get(cancellationToken: cancellationToken).Value.Data;
+ AgentPoolPatch patch = new AgentPoolPatch();
+ foreach (KeyValuePair tag in current.Tags)
+ {
+ patch.Tags.Add(tag);
+ }
+ patch.Tags[key] = value;
+ ArmOperation result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken);
+ return Response.FromValue(result.Value, result.GetRawResponse());
+ }
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Replace the tags on the resource with the given set.
+ /// The tags to set on the resource.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(tags, nameof(tags));
+
+ using DiagnosticScope scope = _agentPoolsClientDiagnostics.CreateScope("AgentPoolResource.SetTags");
+ scope.Start();
+ try
+ {
+ if (await CanUseTagResourceAsync(cancellationToken).ConfigureAwait(false))
+ {
+ await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken).ConfigureAwait(false);
+ Response originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false);
+ originalTags.Value.Data.TagValues.ReplaceWith(tags);
+ await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken).ConfigureAwait(false);
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = _agentPoolsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, context);
+ Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ Response response = Response.FromValue(AgentPoolData.FromResponse(result), result);
+ return Response.FromValue(new AgentPoolResource(Client, response.Value), response.GetRawResponse());
+ }
+ else
+ {
+ AgentPoolData current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data;
+ AgentPoolPatch patch = new AgentPoolPatch();
+ patch.Tags.ReplaceWith(tags);
+ ArmOperation result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return Response.FromValue(result.Value, result.GetRawResponse());
+ }
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Replace the tags on the resource with the given set.
+ /// The tags to set on the resource.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(tags, nameof(tags));
+
+ using DiagnosticScope scope = _agentPoolsClientDiagnostics.CreateScope("AgentPoolResource.SetTags");
+ scope.Start();
+ try
+ {
+ if (CanUseTagResource(cancellationToken))
+ {
+ GetTagResource().Delete(WaitUntil.Completed, cancellationToken);
+ Response originalTags = GetTagResource().Get(cancellationToken);
+ originalTags.Value.Data.TagValues.ReplaceWith(tags);
+ GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken);
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = _agentPoolsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, context);
+ Response result = Pipeline.ProcessMessage(message, context);
+ Response response = Response.FromValue(AgentPoolData.FromResponse(result), result);
+ return Response.FromValue(new AgentPoolResource(Client, response.Value), response.GetRawResponse());
+ }
+ else
+ {
+ AgentPoolData current = Get(cancellationToken: cancellationToken).Value.Data;
+ AgentPoolPatch patch = new AgentPoolPatch();
+ patch.Tags.ReplaceWith(tags);
+ ArmOperation result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken);
+ return Response.FromValue(result.Value, result.GetRawResponse());
+ }
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Removes a tag by key from the resource.
+ /// The key for the tag.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(key, nameof(key));
+
+ using DiagnosticScope scope = _agentPoolsClientDiagnostics.CreateScope("AgentPoolResource.RemoveTag");
+ scope.Start();
+ try
+ {
+ if (await CanUseTagResourceAsync(cancellationToken).ConfigureAwait(false))
+ {
+ Response originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false);
+ originalTags.Value.Data.TagValues.Remove(key);
+ await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken).ConfigureAwait(false);
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = _agentPoolsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, context);
+ Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ Response response = Response.FromValue(AgentPoolData.FromResponse(result), result);
+ return Response.FromValue(new AgentPoolResource(Client, response.Value), response.GetRawResponse());
+ }
+ else
+ {
+ AgentPoolData current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data;
+ AgentPoolPatch patch = new AgentPoolPatch();
+ foreach (KeyValuePair tag in current.Tags)
+ {
+ patch.Tags.Add(tag);
+ }
+ patch.Tags.Remove(key);
+ ArmOperation result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return Response.FromValue(result.Value, result.GetRawResponse());
+ }
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Removes a tag by key from the resource.
+ /// The key for the tag.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(key, nameof(key));
+
+ using DiagnosticScope scope = _agentPoolsClientDiagnostics.CreateScope("AgentPoolResource.RemoveTag");
+ scope.Start();
+ try
+ {
+ if (CanUseTagResource(cancellationToken))
+ {
+ Response originalTags = GetTagResource().Get(cancellationToken);
+ originalTags.Value.Data.TagValues.Remove(key);
+ GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken);
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = _agentPoolsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, context);
+ Response result = Pipeline.ProcessMessage(message, context);
+ Response response = Response.FromValue(AgentPoolData.FromResponse(result), result);
+ return Response.FromValue(new AgentPoolResource(Client, response.Value), response.GetRawResponse());
+ }
+ else
+ {
+ AgentPoolData current = Get(cancellationToken: cancellationToken).Value.Data;
+ AgentPoolPatch patch = new AgentPoolPatch();
+ foreach (KeyValuePair tag in current.Tags)
+ {
+ patch.Tags.Add(tag);
+ }
+ patch.Tags.Remove(key);
+ ArmOperation result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken);
+ return Response.FromValue(result.Value, result.GetRawResponse());
+ }
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ }
+}
diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/ArmContainerRegistryTasksModelFactory.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/ArmContainerRegistryTasksModelFactory.cs
new file mode 100644
index 000000000000..2147cc5056cf
--- /dev/null
+++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/ArmContainerRegistryTasksModelFactory.cs
@@ -0,0 +1,763 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Azure;
+using Azure.Core;
+using Azure.ResourceManager.ContainerRegistryTasks;
+using Azure.ResourceManager.Models;
+
+namespace Azure.ResourceManager.ContainerRegistryTasks.Models
+{
+ /// A factory class for creating instances of the models for mocking.
+ public static partial class ArmContainerRegistryTasksModelFactory
+ {
+ /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ /// The name of the resource.
+ /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".
+ /// Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ /// Resource tags.
+ /// The geo-location where the resource lives.
+ /// The count of agent machine.
+ /// The Tier of agent machine.
+ /// The OS of agent machine.
+ /// The Virtual Network Subnet Resource Id of the agent machine.
+ /// The provisioning state of this agent pool.
+ /// A new instance for mocking.
+ public static AgentPoolData AgentPoolData(ResourceIdentifier id = default, string name = default, ResourceType resourceType = default, SystemData systemData = default, IDictionary tags = default, AzureLocation location = default, int? count = default, string tier = default, ContainerRegistryTaskOS? os = default, ResourceIdentifier virtualNetworkSubnetResourceId = default, ContainerRegistryTaskProvisioningState? provisioningState = default)
+ {
+ tags ??= new ChangeTrackingDictionary();
+
+ return new AgentPoolData(
+ id,
+ name,
+ resourceType,
+ systemData,
+ additionalBinaryDataProperties: null,
+ tags,
+ location,
+ count is null && tier is null && os is null && virtualNetworkSubnetResourceId is null && provisioningState is null ? default : new AgentPoolProperties(
+ count,
+ tier,
+ os,
+ virtualNetworkSubnetResourceId,
+ provisioningState,
+ null));
+ }
+
+ /// The count of agent machine.
+ /// The ARM resource tags.
+ /// A new instance for mocking.
+ public static AgentPoolPatch AgentPoolPatch(int? count = default, IDictionary tags = default)
+ {
+ tags ??= new ChangeTrackingDictionary();
+
+ return new AgentPoolPatch(count is null ? default : new AgentPoolPropertiesUpdateParameters(count, null), tags, additionalBinaryDataProperties: null);
+ }
+
+ /// The QueueStatus of Agent Pool.
+ /// The number of pending runs in the queue.
+ /// A new instance for mocking.
+ public static AgentPoolQueueStatus AgentPoolQueueStatus(int? count = default)
+ {
+ return new AgentPoolQueueStatus(count, additionalBinaryDataProperties: null);
+ }
+
+ /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ /// The name of the resource.
+ /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".
+ /// Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ /// The unique identifier for the run.
+ /// The current status of the run.
+ /// The last updated time for the run.
+ /// The type of run.
+ /// The dedicated agent pool for the run.
+ /// The time the run was scheduled.
+ /// The time the run started.
+ /// The time the run finished.
+ /// The list of all images that were generated from the run. This is applicable if the run generates base image dependencies.
+ /// The task against which run was scheduled.
+ /// The image update trigger that caused the run. This is applicable if the task has base image trigger configured.
+ /// The source trigger that caused the run.
+ /// The timer trigger that caused the run.
+ /// The platform properties against which the run will happen.
+ /// The scope of the credentials that were used to login to the source registry during this run.
+ /// The list of custom registries that were logged in during this run.
+ /// The error message received from backend systems after the run is scheduled.
+ /// The update trigger token passed for the Run.
+ /// The image description for the log artifact.
+ /// The provisioning state of a run.
+ /// The value that indicates whether archiving is enabled or not.
+ /// The CPU configuration in terms of number of cores required for the run.
+ /// A new instance for mocking.
+ public static RunData RunData(ResourceIdentifier id = default, string name = default, ResourceType resourceType = default, SystemData systemData = default, string runId = default, ContainerRegistryTaskRunStatus? status = default, DateTimeOffset? lastUpdatedOn = default, ContainerRegistryTaskRunType? runType = default, string agentPoolName = default, DateTimeOffset? createdOn = default, DateTimeOffset? startOn = default, DateTimeOffset? finishOn = default, IEnumerable outputImages = default, string task = default, ImageUpdateTrigger imageUpdateTrigger = default, SourceTriggerDescriptor sourceTrigger = default, TimerTriggerDescriptor timerTrigger = default, PlatformProperties platform = default, string sourceRegistryAuth = default, IEnumerable customRegistries = default, string runErrorMessage = default, string updateTriggerToken = default, ImageDescriptor logArtifact = default, ContainerRegistryTaskProvisioningState? provisioningState = default, bool? isArchiveEnabled = default, int? agentCpu = default)
+ {
+ return new RunData(
+ id,
+ name,
+ resourceType,
+ systemData,
+ additionalBinaryDataProperties: null,
+ runId is null && status is null && lastUpdatedOn is null && runType is null && agentPoolName is null && createdOn is null && startOn is null && finishOn is null && outputImages is null && task is null && imageUpdateTrigger is null && sourceTrigger is null && timerTrigger is null && platform is null && sourceRegistryAuth is null && customRegistries is null && runErrorMessage is null && updateTriggerToken is null && logArtifact is null && provisioningState is null && isArchiveEnabled is null && agentCpu is null ? default : new RunProperties(
+ runId,
+ status,
+ lastUpdatedOn,
+ runType,
+ agentPoolName,
+ createdOn,
+ startOn,
+ finishOn,
+ (outputImages ?? new ChangeTrackingList()).ToList(),
+ task,
+ imageUpdateTrigger,
+ sourceTrigger,
+ timerTrigger,
+ platform,
+ new AgentProperties(agentCpu, null),
+ sourceRegistryAuth,
+ (customRegistries ?? new ChangeTrackingList()).ToList(),
+ runErrorMessage,
+ updateTriggerToken,
+ logArtifact,
+ provisioningState,
+ isArchiveEnabled,
+ null));
+ }
+
+ /// Properties for a registry image.
+ /// The registry login server.
+ /// The repository name.
+ /// The tag name.
+ /// The sha256-based digest of the image manifest.
+ /// A new instance for mocking.
+ public static ImageDescriptor ImageDescriptor(string registry = default, string repository = default, string tag = default, string digest = default)
+ {
+ return new ImageDescriptor(registry, repository, tag, digest, additionalBinaryDataProperties: null);
+ }
+
+ /// The image update trigger that caused a build.
+ /// The unique ID of the trigger.
+ /// The timestamp when the image update happened.
+ /// The list of image updates that caused the build.
+ /// A new instance for mocking.
+ public static ImageUpdateTrigger ImageUpdateTrigger(string id = default, DateTimeOffset? occurredOn = default, IEnumerable images = default)
+ {
+ images ??= new ChangeTrackingList();
+
+ return new ImageUpdateTrigger(id, occurredOn, images.ToList(), additionalBinaryDataProperties: null);
+ }
+
+ /// The source trigger that caused a run.
+ /// The unique ID of the trigger.
+ /// The event type of the trigger.
+ /// The unique ID that identifies a commit.
+ /// The unique ID that identifies pull request.
+ /// The repository URL.
+ /// The branch name in the repository.
+ /// The source control provider type.
+ /// A new instance for mocking.
+ public static SourceTriggerDescriptor SourceTriggerDescriptor(string id = default, string eventType = default, string commitId = default, string pullRequestId = default, Uri repositoryUri = default, string branchName = default, string providerType = default)
+ {
+ return new SourceTriggerDescriptor(
+ id,
+ eventType,
+ commitId,
+ pullRequestId,
+ repositoryUri,
+ branchName,
+ providerType,
+ additionalBinaryDataProperties: null);
+ }
+
+ /// The TimerTriggerDescriptor.
+ /// The timer trigger name that caused the run.
+ /// The occurrence that triggered the run.
+ /// A new instance for mocking.
+ public static TimerTriggerDescriptor TimerTriggerDescriptor(string timerTriggerName = default, string scheduleOccurrence = default)
+ {
+ return new TimerTriggerDescriptor(timerTriggerName, scheduleOccurrence, additionalBinaryDataProperties: null);
+ }
+
+ /// The result of get log link operation.
+ /// The link to logs for a run on a azure container registry.
+ /// The link to logs in registry for a run on a azure container registry.
+ /// A new instance for mocking.
+ public static RunGetLogResult RunGetLogResult(string logLink = default, string logArtifactLink = default)
+ {
+ return new RunGetLogResult(logLink, logArtifactLink, additionalBinaryDataProperties: null);
+ }
+
+ /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ /// The name of the resource.
+ /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".
+ /// Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ /// The provisioning state of this task run.
+ /// The request (parameters) for the run.
+ /// The result of this task run.
+ /// How the run should be forced to rerun even if the run request configuration has not changed.
+ /// Identity for the resource.
+ /// The location of the resource.
+ /// A new instance for mocking.
+ public static TaskRunData TaskRunData(ResourceIdentifier id = default, string name = default, ResourceType resourceType = default, SystemData systemData = default, ContainerRegistryTaskProvisioningState? provisioningState = default, RunContent runRequest = default, RunData runResult = default, string forceUpdateTag = default, IdentityProperties identity = default, AzureLocation? location = default)
+ {
+ return new TaskRunData(
+ id,
+ name,
+ resourceType,
+ systemData,
+ additionalBinaryDataProperties: null,
+ provisioningState is null && runRequest is null && runResult is null && forceUpdateTag is null ? default : new TaskRunProperties(provisioningState, runRequest, runResult, forceUpdateTag, null),
+ identity,
+ location);
+ }
+
+ /// The value that indicates whether archiving is enabled for the run or not.
+ /// The dedicated agent pool for the run.
+ /// The template that describes the repository and tag information for run log artifact.
+ /// The fully qualified image names including the repository and tag.
+ /// The value of this property indicates whether the image built should be pushed to the registry or not.
+ /// The value of this property indicates whether the image cache is enabled or not.
+ /// The Docker file path relative to the source location.
+ /// The name of the target build stage for the docker build.
+ /// The collection of override arguments to be used when executing the run.
+ /// Run timeout in seconds.
+ /// The platform properties against which the run has to happen.
+ /// The CPU configuration in terms of number of cores required for the run.
+ ///
+ /// 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.
+ ///
+ /// The properties that describes a set of credentials that will be used when this run is invoked.
+ /// A new instance for mocking.
+ public static DockerBuildContent DockerBuildContent(bool? isArchiveEnabled = default, string agentPoolName = default, string logTemplate = default, IEnumerable imageNames = default, bool? isPushEnabled = default, bool? isCacheDisabled = default, string dockerFilePath = default, string target = default, IEnumerable arguments = default, int? timeoutInSeconds = default, PlatformProperties platform = default, int? agentCpu = default, string sourceLocation = default, ContainerRegistryTaskCredentials credentials = default)
+ {
+ imageNames ??= new ChangeTrackingList();
+ arguments ??= new ChangeTrackingList();
+
+ return new DockerBuildContent(
+ "DockerBuildRequest",
+ isArchiveEnabled,
+ agentPoolName,
+ logTemplate,
+ additionalBinaryDataProperties: null,
+ imageNames.ToList(),
+ isPushEnabled,
+ isCacheDisabled,
+ dockerFilePath,
+ target,
+ arguments.ToList(),
+ timeoutInSeconds,
+ platform,
+ agentCpu is null ? default : new AgentProperties(agentCpu, null),
+ sourceLocation,
+ credentials);
+ }
+
+ /// The parameters that describes a set of credentials that will be used when a run is invoked.
+ /// Describes the credential parameters for accessing the source registry.
+ ///
+ /// 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.
+ ///
+ /// A new instance for mocking.
+ public static ContainerRegistryTaskCredentials ContainerRegistryTaskCredentials(SourceRegistryCredentials sourceRegistry = default, IDictionary customRegistries = default)
+ {
+ customRegistries ??= new ChangeTrackingDictionary();
+
+ return new ContainerRegistryTaskCredentials(sourceRegistry, customRegistries, additionalBinaryDataProperties: null);
+ }
+
+ /// The value that indicates whether archiving is enabled for the run or not.
+ /// The dedicated agent pool for the run.
+ /// The template that describes the repository and tag information for run log artifact.
+ /// The template/definition file path relative to the source.
+ /// The values/parameters file path relative to the source.
+ /// The collection of overridable values that can be passed when running a task.
+ /// Run timeout in seconds.
+ /// The platform properties against which the run has to happen.
+ /// The CPU configuration in terms of number of cores required for the run.
+ ///
+ /// 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.
+ ///
+ /// The properties that describes a set of credentials that will be used when this run is invoked.
+ /// A new instance for mocking.
+ public static FileTaskRunContent FileTaskRunContent(bool? isArchiveEnabled = default, string agentPoolName = default, string logTemplate = default, string taskFilePath = default, string valuesFilePath = default, IEnumerable values = default, int? timeoutInSeconds = default, PlatformProperties platform = default, int? agentCpu = default, string sourceLocation = default, ContainerRegistryTaskCredentials credentials = default)
+ {
+ values ??= new ChangeTrackingList();
+
+ return new FileTaskRunContent(
+ "FileTaskRunRequest",
+ isArchiveEnabled,
+ agentPoolName,
+ logTemplate,
+ additionalBinaryDataProperties: null,
+ taskFilePath,
+ valuesFilePath,
+ values.ToList(),
+ timeoutInSeconds,
+ platform,
+ agentCpu is null ? default : new AgentProperties(agentCpu, null),
+ sourceLocation,
+ credentials);
+ }
+
+ /// The OverrideTaskStepProperties.
+ /// The source context against which run has to be queued.
+ /// The file against which run has to be queued.
+ ///
+ /// Gets or sets the collection of override arguments to be used when
+ /// executing a build step.
+ ///
+ /// The name of the target build stage for the docker build.
+ /// The collection of overridable values that can be passed when running a Task.
+ /// Base64 encoded update trigger token that will be attached with the base image trigger webhook.
+ /// A new instance for mocking.
+ public static OverrideTaskStepProperties OverrideTaskStepProperties(string contextPath = default, string @file = default, IEnumerable arguments = default, string target = default, IEnumerable values = default, string updateTriggerToken = default)
+ {
+ arguments ??= new ChangeTrackingList();
+ values ??= new ChangeTrackingList();
+
+ return new OverrideTaskStepProperties(
+ contextPath,
+ @file,
+ arguments.ToList(),
+ target,
+ values.ToList(),
+ updateTriggerToken,
+ additionalBinaryDataProperties: null);
+ }
+
+ /// The value that indicates whether archiving is enabled for the run or not.
+ /// The dedicated agent pool for the run.
+ /// The template that describes the repository and tag information for run log artifact.
+ /// Base64 encoded value of the template/definition file content.
+ /// Base64 encoded value of the parameters/values file content.
+ /// The collection of overridable values that can be passed when running a task.
+ /// Run timeout in seconds.
+ /// The platform properties against which the run has to happen.
+ /// The CPU configuration in terms of number of cores required for the run.
+ ///
+ /// 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.
+ ///
+ /// The properties that describes a set of credentials that will be used when this run is invoked.
+ /// A new instance for mocking.
+ public static EncodedTaskRunContent EncodedTaskRunContent(bool? isArchiveEnabled = default, string agentPoolName = default, string logTemplate = default, string encodedTaskContent = default, string encodedValuesContent = default, IEnumerable values = default, int? timeoutInSeconds = default, PlatformProperties platform = default, int? agentCpu = default, string sourceLocation = default, ContainerRegistryTaskCredentials credentials = default)
+ {
+ values ??= new ChangeTrackingList();
+
+ return new EncodedTaskRunContent(
+ "EncodedTaskRunRequest",
+ isArchiveEnabled,
+ agentPoolName,
+ logTemplate,
+ additionalBinaryDataProperties: null,
+ encodedTaskContent,
+ encodedValuesContent,
+ values.ToList(),
+ timeoutInSeconds,
+ platform,
+ agentCpu is null ? default : new AgentProperties(agentCpu, null),
+ sourceLocation,
+ credentials);
+ }
+
+ /// Managed identity for the resource.
+ /// The principal ID of resource identity.
+ /// The tenant ID of resource.
+ /// The identity type.
+ ///
+ /// 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}'.
+ ///
+ /// A new instance for mocking.
+ public static IdentityProperties IdentityProperties(string principalId = default, string tenantId = default, ResourceIdentityType? @type = default, IDictionary userAssignedIdentities = default)
+ {
+ userAssignedIdentities ??= new ChangeTrackingDictionary();
+
+ return new IdentityProperties(principalId, tenantId, @type, userAssignedIdentities, additionalBinaryDataProperties: null);
+ }
+
+ /// The UserIdentityProperties.
+ /// The principal id of user assigned identity.
+ /// The client id of user assigned identity.
+ /// A new instance for mocking.
+ public static UserIdentityProperties UserIdentityProperties(string principalId = default, string clientId = default)
+ {
+ return new UserIdentityProperties(principalId, clientId, additionalBinaryDataProperties: null);
+ }
+
+ /// Identity for the resource.
+ /// The request (parameters) for the new run.
+ /// How the run should be forced to rerun even if the run request configuration has not changed.
+ /// The location of the resource.
+ /// The ARM resource tags.
+ /// A new instance for mocking.
+ public static TaskRunPatch TaskRunPatch(IdentityProperties identity = default, RunContent runRequest = default, string forceUpdateTag = default, string location = default, IDictionary tags = default)
+ {
+ tags ??= new ChangeTrackingDictionary();
+
+ return new TaskRunPatch(identity, runRequest is null && forceUpdateTag is null ? default : new TaskRunPropertiesUpdateParameters(runRequest, forceUpdateTag, null), location, tags, additionalBinaryDataProperties: null);
+ }
+
+ /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
+ /// The name of the resource.
+ /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".
+ /// Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ /// Resource tags.
+ /// The geo-location where the resource lives.
+ /// The provisioning state of the task.
+ /// The creation date of task.
+ /// The current status of task.
+ /// The platform properties against which the run has to happen.
+ /// The dedicated agent pool for the task.
+ /// Run timeout in seconds.
+ /// The properties of a task step.
+ /// The properties that describe all triggers for the task.
+ /// The properties that describes a set of credentials that will be used when this run is invoked.
+ /// The template that describes the repository and tag information for run log artifact.
+ /// The value of this property indicates whether the task resource is system task or not.
+ /// The CPU configuration in terms of number of cores required for the run.
+ /// Identity for the resource.
+ /// A new instance for mocking.
+ public static TaskData TaskData(ResourceIdentifier id = default, string name = default, ResourceType resourceType = default, SystemData systemData = default, IDictionary tags = default, AzureLocation location = default, ContainerRegistryTaskProvisioningState? provisioningState = default, DateTimeOffset? createdOn = default, ContainerRegistryTaskStatus? status = default, PlatformProperties platform = default, string agentPoolName = default, int? timeoutInSeconds = default, TaskStepProperties step = default, TriggerProperties trigger = default, ContainerRegistryTaskCredentials credentials = default, string logTemplate = default, bool? isSystemTask = default, int? agentCpu = default, IdentityProperties identity = default)
+ {
+ tags ??= new ChangeTrackingDictionary();
+
+ return new TaskData(
+ id,
+ name,
+ resourceType,
+ systemData,
+ additionalBinaryDataProperties: null,
+ tags,
+ location,
+ provisioningState is null && createdOn is null && status is null && platform is null && agentPoolName is null && timeoutInSeconds is null && step is null && trigger is null && credentials is null && logTemplate is null && isSystemTask is null && agentCpu is null ? default : new TaskProperties(
+ provisioningState,
+ createdOn,
+ status,
+ platform,
+ new AgentProperties(agentCpu, null),
+ agentPoolName,
+ timeoutInSeconds,
+ step,
+ trigger,
+ credentials,
+ logTemplate,
+ isSystemTask,
+ null),
+ identity);
+ }
+
+ ///
+ /// Base properties for any task step.
+ /// Please note this is the abstract base class. The derived classes available for instantiation are: , , and .
+ ///
+ /// The type of the step.
+ /// List of base image dependencies for a step.
+ /// The URL(absolute or relative) of the source context for the task step.
+ /// The token (git PAT or SAS token of storage account blob) associated with the context for a step.
+ /// A new instance for mocking.
+ public static TaskStepProperties TaskStepProperties(string @type = default, IEnumerable baseImageDependencies = default, string contextPath = default, string contextAccessToken = default)
+ {
+ baseImageDependencies ??= new ChangeTrackingList();
+
+ return new UnknownTaskStepProperties(new StepType(@type), baseImageDependencies.ToList(), contextPath, contextAccessToken, additionalBinaryDataProperties: null);
+ }
+
+ /// Properties that describe a base image dependency.
+ /// The type of the base image dependency.
+ /// The registry login server.
+ /// The repository name.
+ /// The tag name.
+ /// The sha256-based digest of the image manifest.
+ /// A new instance for mocking.
+ public static BaseImageDependency BaseImageDependency(BaseImageDependencyType? @type = default, string registry = default, string repository = default, string tag = default, string digest = default)
+ {
+ return new BaseImageDependency(
+ @type,
+ registry,
+ repository,
+ tag,
+ digest,
+ additionalBinaryDataProperties: null);
+ }
+
+ /// The Docker build step.
+ /// List of base image dependencies for a step.
+ /// The URL(absolute or relative) of the source context for the task step.
+ /// The token (git PAT or SAS token of storage account blob) associated with the context for a step.
+ /// The fully qualified image names including the repository and tag.
+ /// The value of this property indicates whether the image built should be pushed to the registry or not.
+ /// The value of this property indicates whether the image cache is enabled or not.
+ /// The Docker file path relative to the source context.
+ /// The name of the target build stage for the docker build.
+ /// The collection of override arguments to be used when executing this build step.
+ /// A new instance for mocking.
+ public static DockerBuildStep DockerBuildStep(IEnumerable baseImageDependencies = default, string contextPath = default, string contextAccessToken = default, IEnumerable imageNames = default, bool? isPushEnabled = default, bool? isCacheDisabled = default, string dockerFilePath = default, string target = default, IEnumerable arguments = default)
+ {
+ baseImageDependencies ??= new ChangeTrackingList();
+ imageNames ??= new ChangeTrackingList();
+ arguments ??= new ChangeTrackingList();
+
+ return new DockerBuildStep(
+ StepType.Docker,
+ baseImageDependencies.ToList(),
+ contextPath,
+ contextAccessToken,
+ additionalBinaryDataProperties: null,
+ imageNames.ToList(),
+ isPushEnabled,
+ isCacheDisabled,
+ dockerFilePath,
+ target,
+ arguments.ToList());
+ }
+
+ /// The properties of a task step.
+ /// List of base image dependencies for a step.
+ /// The URL(absolute or relative) of the source context for the task step.
+ /// The token (git PAT or SAS token of storage account blob) associated with the context for a step.
+ /// The task template/definition file path relative to the source context.
+ /// The task values/parameters file path relative to the source context.
+ /// The collection of overridable values that can be passed when running a task.
+ /// A new instance for mocking.
+ public static FileTaskStep FileTaskStep(IEnumerable baseImageDependencies = default, string contextPath = default, string contextAccessToken = default, string taskFilePath = default, string valuesFilePath = default, IEnumerable values = default)
+ {
+ baseImageDependencies ??= new ChangeTrackingList();
+ values ??= new ChangeTrackingList();
+
+ return new FileTaskStep(
+ StepType.FileTask,
+ baseImageDependencies.ToList(),
+ contextPath,
+ contextAccessToken,
+ additionalBinaryDataProperties: null,
+ taskFilePath,
+ valuesFilePath,
+ values.ToList());
+ }
+
+ /// The properties of a encoded task step.
+ /// List of base image dependencies for a step.
+ /// The URL(absolute or relative) of the source context for the task step.
+ /// The token (git PAT or SAS token of storage account blob) associated with the context for a step.
+ /// Base64 encoded value of the template/definition file content.
+ /// Base64 encoded value of the parameters/values file content.
+ /// The collection of overridable values that can be passed when running a task.
+ /// A new instance for mocking.
+ public static EncodedTaskStep EncodedTaskStep(IEnumerable baseImageDependencies = default, string contextPath = default, string contextAccessToken = default, string encodedTaskContent = default, string encodedValuesContent = default, IEnumerable values = default)
+ {
+ baseImageDependencies ??= new ChangeTrackingList();
+ values ??= new ChangeTrackingList();
+
+ return new EncodedTaskStep(
+ StepType.EncodedTask,
+ baseImageDependencies.ToList(),
+ contextPath,
+ contextAccessToken,
+ additionalBinaryDataProperties: null,
+ encodedTaskContent,
+ encodedValuesContent,
+ values.ToList());
+ }
+
+ /// The properties of a trigger.
+ /// The collection of timer triggers.
+ /// The collection of triggers based on source code repository.
+ /// The trigger based on base image dependencies.
+ /// A new instance for mocking.
+ public static TriggerProperties TriggerProperties(IEnumerable timerTriggers = default, IEnumerable sourceTriggers = default, BaseImageTrigger baseImageTrigger = default)
+ {
+ timerTriggers ??= new ChangeTrackingList();
+ sourceTriggers ??= new ChangeTrackingList();
+
+ return new TriggerProperties(timerTriggers.ToList(), sourceTriggers.ToList(), baseImageTrigger, additionalBinaryDataProperties: null);
+ }
+
+ /// The properties of a source based trigger.
+ /// The properties that describes the source(code) for the task.
+ /// The source event corresponding to the trigger.
+ /// The current status of trigger.
+ /// The name of the trigger.
+ /// A new instance for mocking.
+ public static SourceTrigger SourceTrigger(SourceProperties sourceRepository = default, IEnumerable sourceTriggerEvents = default, ContainerRegistryTaskTriggerStatus? status = default, string name = default)
+ {
+ sourceTriggerEvents ??= new ChangeTrackingList();
+
+ return new SourceTrigger(sourceRepository, sourceTriggerEvents.ToList(), status, name, additionalBinaryDataProperties: null);
+ }
+
+ /// Identity for the resource.
+ /// The current status of task.
+ /// The platform properties against which the run has to happen.
+ /// The dedicated agent pool for the task.
+ /// Run timeout in seconds.
+ /// The properties for updating a task step.
+ /// The properties for updating trigger properties.
+ /// The parameters that describes a set of credentials that will be used when this run is invoked.
+ /// The template that describes the repository and tag information for run log artifact.
+ /// The CPU configuration in terms of number of cores required for the run.
+ /// The ARM resource tags.
+ /// A new instance for mocking.
+ public static TaskPatch TaskPatch(IdentityProperties identity = default, ContainerRegistryTaskStatus? status = default, PlatformUpdateContent platform = default, string agentPoolName = default, int? timeoutInSeconds = default, TaskStepUpdateContent step = default, TriggerUpdateContent trigger = default, ContainerRegistryTaskCredentials credentials = default, string logTemplate = default, int? agentCpu = default, IDictionary tags = default)
+ {
+ tags ??= new ChangeTrackingDictionary();
+
+ return new TaskPatch(identity, status is null && platform is null && agentPoolName is null && timeoutInSeconds is null && step is null && trigger is null && credentials is null && logTemplate is null && agentCpu is null ? default : new TaskPropertiesUpdateParameters(
+ status,
+ platform,
+ new AgentProperties(agentCpu, null),
+ agentPoolName,
+ timeoutInSeconds,
+ step,
+ trigger,
+ credentials,
+ logTemplate,
+ null), tags, additionalBinaryDataProperties: null);
+ }
+
+ /// The properties for updating a docker build step.
+ /// The URL(absolute or relative) of the source context for the task step.
+ /// The token (git PAT or SAS token of storage account blob) associated with the context for a step.
+ /// The fully qualified image names including the repository and tag.
+ /// The value of this property indicates whether the image built should be pushed to the registry or not.
+ /// The value of this property indicates whether the image cache is enabled or not.
+ /// The Docker file path relative to the source context.
+ /// The collection of override arguments to be used when executing this build step.
+ /// The name of the target build stage for the docker build.
+ /// A new instance for mocking.
+ public static DockerBuildStepUpdateContent DockerBuildStepUpdateContent(string contextPath = default, string contextAccessToken = default, IEnumerable imageNames = default, bool? isPushEnabled = default, bool? isCacheDisabled = default, string dockerFilePath = default, IEnumerable arguments = default, string target = default)
+ {
+ imageNames ??= new ChangeTrackingList();
+ arguments ??= new ChangeTrackingList();
+
+ return new DockerBuildStepUpdateContent(
+ StepType.Docker,
+ contextPath,
+ contextAccessToken,
+ additionalBinaryDataProperties: null,
+ imageNames.ToList(),
+ isPushEnabled,
+ isCacheDisabled,
+ dockerFilePath,
+ arguments.ToList(),
+ target);
+ }
+
+ /// The properties of updating a task step.
+ /// The URL(absolute or relative) of the source context for the task step.
+ /// The token (git PAT or SAS token of storage account blob) associated with the context for a step.
+ /// The task template/definition file path relative to the source context.
+ /// The values/parameters file path relative to the source context.
+ /// The collection of overridable values that can be passed when running a task.
+ /// A new instance for mocking.
+ public static FileTaskStepUpdateContent FileTaskStepUpdateContent(string contextPath = default, string contextAccessToken = default, string taskFilePath = default, string valuesFilePath = default, IEnumerable values = default)
+ {
+ values ??= new ChangeTrackingList();
+
+ return new FileTaskStepUpdateContent(
+ StepType.FileTask,
+ contextPath,
+ contextAccessToken,
+ additionalBinaryDataProperties: null,
+ taskFilePath,
+ valuesFilePath,
+ values.ToList());
+ }
+
+ /// The properties for updating encoded task step.
+ /// The URL(absolute or relative) of the source context for the task step.
+ /// The token (git PAT or SAS token of storage account blob) associated with the context for a step.
+ /// Base64 encoded value of the template/definition file content.
+ /// Base64 encoded value of the parameters/values file content.
+ /// The collection of overridable values that can be passed when running a task.
+ /// A new instance for mocking.
+ public static EncodedTaskStepUpdateContent EncodedTaskStepUpdateContent(string contextPath = default, string contextAccessToken = default, string encodedTaskContent = default, string encodedValuesContent = default, IEnumerable values = default)
+ {
+ values ??= new ChangeTrackingList();
+
+ return new EncodedTaskStepUpdateContent(
+ StepType.EncodedTask,
+ contextPath,
+ contextAccessToken,
+ additionalBinaryDataProperties: null,
+ encodedTaskContent,
+ encodedValuesContent,
+ values.ToList());
+ }
+
+ /// The properties for updating triggers.
+ /// The collection of timer triggers.
+ /// The collection of triggers based on source code repository.
+ /// The trigger based on base image dependencies.
+ /// A new instance for mocking.
+ public static TriggerUpdateContent TriggerUpdateContent(IEnumerable timerTriggers = default, IEnumerable sourceTriggers = default, BaseImageTriggerUpdateContent baseImageTrigger = default)
+ {
+ timerTriggers ??= new ChangeTrackingList();
+ sourceTriggers ??= new ChangeTrackingList();
+
+ return new TriggerUpdateContent(timerTriggers.ToList(), sourceTriggers.ToList(), baseImageTrigger, additionalBinaryDataProperties: null);
+ }
+
+ /// The properties for updating a timer trigger.
+ /// The CRON expression for the task schedule.
+ /// The current status of trigger.
+ /// The name of the trigger.
+ /// A new instance for mocking.
+ public static TimerTriggerUpdateContent TimerTriggerUpdateContent(string schedule = default, ContainerRegistryTaskTriggerStatus? status = default, string name = default)
+ {
+ return new TimerTriggerUpdateContent(schedule, status, name, additionalBinaryDataProperties: null);
+ }
+
+ /// The properties for updating a source based trigger.
+ /// The properties that describes the source(code) for the task.
+ /// The source event corresponding to the trigger.
+ /// The current status of trigger.
+ /// The name of the trigger.
+ /// A new instance for mocking.
+ public static SourceTriggerUpdateContent SourceTriggerUpdateContent(SourceUpdateContent sourceRepository = default, IEnumerable sourceTriggerEvents = default, ContainerRegistryTaskTriggerStatus? status = default, string name = default)
+ {
+ sourceTriggerEvents ??= new ChangeTrackingList();
+
+ return new SourceTriggerUpdateContent(sourceRepository, sourceTriggerEvents.ToList(), status, name, additionalBinaryDataProperties: null);
+ }
+
+ /// The properties for updating base image dependency trigger.
+ /// The type of the auto trigger for base image dependency updates.
+ /// The endpoint URL for receiving update triggers.
+ /// Type of Payload body for Base image update triggers.
+ /// The current status of trigger.
+ /// The name of the trigger.
+ /// A new instance for mocking.
+ public static BaseImageTriggerUpdateContent BaseImageTriggerUpdateContent(BaseImageTriggerType? baseImageTriggerType = default, string updateTriggerEndpoint = default, UpdateTriggerPayloadType? updateTriggerPayloadType = default, ContainerRegistryTaskTriggerStatus? status = default, string name = default)
+ {
+ return new BaseImageTriggerUpdateContent(
+ baseImageTriggerType,
+ updateTriggerEndpoint,
+ updateTriggerPayloadType,
+ status,
+ name,
+ additionalBinaryDataProperties: null);
+ }
+
+ /// The properties of a response to source upload request.
+ /// The URL where the client can upload the source.
+ /// The relative path to the source. This is used to submit the subsequent queue build request.
+ /// A new instance for mocking.
+ public static SourceUploadResult SourceUploadResult(string uploadUri = default, string relativePath = default)
+ {
+ return new SourceUploadResult(uploadUri, relativePath, additionalBinaryDataProperties: null);
+ }
+ }
+}
diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/CollectionResults/AgentPoolsGetAllAsyncCollectionResultOfT.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/CollectionResults/AgentPoolsGetAllAsyncCollectionResultOfT.cs
new file mode 100644
index 000000000000..d9ddb4322c38
--- /dev/null
+++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/CollectionResults/AgentPoolsGetAllAsyncCollectionResultOfT.cs
@@ -0,0 +1,85 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager.ContainerRegistryTasks.Models;
+
+namespace Azure.ResourceManager.ContainerRegistryTasks
+{
+ internal partial class AgentPoolsGetAllAsyncCollectionResultOfT : AsyncPageable
+ {
+ private readonly AgentPools _client;
+ private readonly Guid _subscriptionId;
+ private readonly string _resourceGroupName;
+ private readonly string _registryName;
+ private readonly RequestContext _context;
+
+ /// Initializes a new instance of AgentPoolsGetAllAsyncCollectionResultOfT, which is used to iterate over the pages of a collection.
+ /// The AgentPools client used to send requests.
+ /// The ID of the target subscription. The value must be an UUID.
+ /// The name of the resource group. The name is case insensitive.
+ /// The name of the Registry.
+ /// The request options, which can override default behaviors of the client pipeline on a per-call basis.
+ public AgentPoolsGetAllAsyncCollectionResultOfT(AgentPools client, Guid subscriptionId, string resourceGroupName, string registryName, RequestContext context) : base(context?.CancellationToken ?? default)
+ {
+ _client = client;
+ _subscriptionId = subscriptionId;
+ _resourceGroupName = resourceGroupName;
+ _registryName = registryName;
+ _context = context;
+ }
+
+ /// Gets the pages of AgentPoolsGetAllAsyncCollectionResultOfT as an enumerable collection.
+ /// A continuation token indicating where to resume paging.
+ /// The number of items per page.
+ /// The pages of AgentPoolsGetAllAsyncCollectionResultOfT as an enumerable collection.
+ public override async IAsyncEnumerable> AsPages(string continuationToken, int? pageSizeHint)
+ {
+ Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null;
+ while (true)
+ {
+ Response response = await GetNextResponseAsync(pageSizeHint, nextPage).ConfigureAwait(false);
+ if (response is null)
+ {
+ yield break;
+ }
+ AgentPoolListResult result = AgentPoolListResult.FromResponse(response);
+ yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.IsAbsoluteUri == true ? nextPage.AbsoluteUri : nextPage?.OriginalString, response);
+ string nextPageString = result.NextLink;
+ if (string.IsNullOrEmpty(nextPageString))
+ {
+ yield break;
+ }
+ nextPage = new Uri(nextPageString, UriKind.RelativeOrAbsolute);
+ }
+ }
+
+ /// Get next page.
+ /// The number of items per page.
+ /// The next link to use for the next page of results.
+ private async ValueTask GetNextResponseAsync(int? pageSizeHint, Uri nextLink)
+ {
+ HttpMessage message = nextLink != null ? _client.CreateNextGetAllRequest(nextLink, _subscriptionId, _resourceGroupName, _registryName, _context) : _client.CreateGetAllRequest(_subscriptionId, _resourceGroupName, _registryName, _context);
+ using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("AgentPoolCollection.GetAll");
+ scope.Start();
+ try
+ {
+ return await _client.Pipeline.ProcessMessageAsync(message, _context).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ }
+}
diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/CollectionResults/AgentPoolsGetAllCollectionResultOfT.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/CollectionResults/AgentPoolsGetAllCollectionResultOfT.cs
new file mode 100644
index 000000000000..4e47150e8b9b
--- /dev/null
+++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/CollectionResults/AgentPoolsGetAllCollectionResultOfT.cs
@@ -0,0 +1,84 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager.ContainerRegistryTasks.Models;
+
+namespace Azure.ResourceManager.ContainerRegistryTasks
+{
+ internal partial class AgentPoolsGetAllCollectionResultOfT : Pageable
+ {
+ private readonly AgentPools _client;
+ private readonly Guid _subscriptionId;
+ private readonly string _resourceGroupName;
+ private readonly string _registryName;
+ private readonly RequestContext _context;
+
+ /// Initializes a new instance of AgentPoolsGetAllCollectionResultOfT, which is used to iterate over the pages of a collection.
+ /// The AgentPools client used to send requests.
+ /// The ID of the target subscription. The value must be an UUID.
+ /// The name of the resource group. The name is case insensitive.
+ /// The name of the Registry.
+ /// The request options, which can override default behaviors of the client pipeline on a per-call basis.
+ public AgentPoolsGetAllCollectionResultOfT(AgentPools client, Guid subscriptionId, string resourceGroupName, string registryName, RequestContext context) : base(context?.CancellationToken ?? default)
+ {
+ _client = client;
+ _subscriptionId = subscriptionId;
+ _resourceGroupName = resourceGroupName;
+ _registryName = registryName;
+ _context = context;
+ }
+
+ /// Gets the pages of AgentPoolsGetAllCollectionResultOfT as an enumerable collection.
+ /// A continuation token indicating where to resume paging.
+ /// The number of items per page.
+ /// The pages of AgentPoolsGetAllCollectionResultOfT as an enumerable collection.
+ public override IEnumerable> AsPages(string continuationToken, int? pageSizeHint)
+ {
+ Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null;
+ while (true)
+ {
+ Response response = GetNextResponse(pageSizeHint, nextPage);
+ if (response is null)
+ {
+ yield break;
+ }
+ AgentPoolListResult result = AgentPoolListResult.FromResponse(response);
+ yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.IsAbsoluteUri == true ? nextPage.AbsoluteUri : nextPage?.OriginalString, response);
+ string nextPageString = result.NextLink;
+ if (string.IsNullOrEmpty(nextPageString))
+ {
+ yield break;
+ }
+ nextPage = new Uri(nextPageString, UriKind.RelativeOrAbsolute);
+ }
+ }
+
+ /// Get next page.
+ /// The number of items per page.
+ /// The next link to use for the next page of results.
+ private Response GetNextResponse(int? pageSizeHint, Uri nextLink)
+ {
+ HttpMessage message = nextLink != null ? _client.CreateNextGetAllRequest(nextLink, _subscriptionId, _resourceGroupName, _registryName, _context) : _client.CreateGetAllRequest(_subscriptionId, _resourceGroupName, _registryName, _context);
+ using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("AgentPoolCollection.GetAll");
+ scope.Start();
+ try
+ {
+ return _client.Pipeline.ProcessMessage(message, _context);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ }
+}
diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/CollectionResults/RunsGetAllAsyncCollectionResultOfT.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/CollectionResults/RunsGetAllAsyncCollectionResultOfT.cs
new file mode 100644
index 000000000000..f3cd18d90880
--- /dev/null
+++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/CollectionResults/RunsGetAllAsyncCollectionResultOfT.cs
@@ -0,0 +1,91 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager.ContainerRegistryTasks.Models;
+
+namespace Azure.ResourceManager.ContainerRegistryTasks
+{
+ internal partial class RunsGetAllAsyncCollectionResultOfT : AsyncPageable
+ {
+ private readonly Runs _client;
+ private readonly Guid _subscriptionId;
+ private readonly string _resourceGroupName;
+ private readonly string _registryName;
+ private readonly string _filter;
+ private readonly int? _top;
+ private readonly RequestContext _context;
+
+ /// Initializes a new instance of RunsGetAllAsyncCollectionResultOfT, which is used to iterate over the pages of a collection.
+ /// The Runs client used to send requests.
+ /// The ID of the target subscription. The value must be an UUID.
+ /// The name of the resource group. The name is case insensitive.
+ /// The name of the Registry.
+ /// The runs filter to apply on the operation. Arithmetic operators are not supported. The allowed string function is 'contains'. All logical operators except 'Not', 'Has', 'All' are allowed.
+ /// $top is supported for get list of runs, which limits the maximum number of runs to return.
+ /// The request options, which can override default behaviors of the client pipeline on a per-call basis.
+ public RunsGetAllAsyncCollectionResultOfT(Runs client, Guid subscriptionId, string resourceGroupName, string registryName, string filter, int? top, RequestContext context) : base(context?.CancellationToken ?? default)
+ {
+ _client = client;
+ _subscriptionId = subscriptionId;
+ _resourceGroupName = resourceGroupName;
+ _registryName = registryName;
+ _filter = filter;
+ _top = top;
+ _context = context;
+ }
+
+ /// Gets the pages of RunsGetAllAsyncCollectionResultOfT as an enumerable collection.
+ /// A continuation token indicating where to resume paging.
+ /// The number of items per page.
+ /// The pages of RunsGetAllAsyncCollectionResultOfT as an enumerable collection.
+ public override async IAsyncEnumerable> AsPages(string continuationToken, int? pageSizeHint)
+ {
+ Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null;
+ while (true)
+ {
+ Response response = await GetNextResponseAsync(pageSizeHint, nextPage).ConfigureAwait(false);
+ if (response is null)
+ {
+ yield break;
+ }
+ RunListResult result = RunListResult.FromResponse(response);
+ yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.IsAbsoluteUri == true ? nextPage.AbsoluteUri : nextPage?.OriginalString, response);
+ string nextPageString = result.NextLink;
+ if (string.IsNullOrEmpty(nextPageString))
+ {
+ yield break;
+ }
+ nextPage = new Uri(nextPageString, UriKind.RelativeOrAbsolute);
+ }
+ }
+
+ /// Get next page.
+ /// The number of items per page.
+ /// The next link to use for the next page of results.
+ private async ValueTask GetNextResponseAsync(int? pageSizeHint, Uri nextLink)
+ {
+ HttpMessage message = nextLink != null ? _client.CreateNextGetAllRequest(nextLink, _subscriptionId, _resourceGroupName, _registryName, _filter, _top, _context) : _client.CreateGetAllRequest(_subscriptionId, _resourceGroupName, _registryName, _filter, _top, _context);
+ using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("RunCollection.GetAll");
+ scope.Start();
+ try
+ {
+ return await _client.Pipeline.ProcessMessageAsync(message, _context).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ }
+}
diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/CollectionResults/RunsGetAllCollectionResultOfT.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/CollectionResults/RunsGetAllCollectionResultOfT.cs
new file mode 100644
index 000000000000..ecc2f40f1b35
--- /dev/null
+++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/CollectionResults/RunsGetAllCollectionResultOfT.cs
@@ -0,0 +1,90 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager.ContainerRegistryTasks.Models;
+
+namespace Azure.ResourceManager.ContainerRegistryTasks
+{
+ internal partial class RunsGetAllCollectionResultOfT : Pageable
+ {
+ private readonly Runs _client;
+ private readonly Guid _subscriptionId;
+ private readonly string _resourceGroupName;
+ private readonly string _registryName;
+ private readonly string _filter;
+ private readonly int? _top;
+ private readonly RequestContext _context;
+
+ /// Initializes a new instance of RunsGetAllCollectionResultOfT, which is used to iterate over the pages of a collection.
+ /// The Runs client used to send requests.
+ /// The ID of the target subscription. The value must be an UUID.
+ /// The name of the resource group. The name is case insensitive.
+ /// The name of the Registry.
+ /// The runs filter to apply on the operation. Arithmetic operators are not supported. The allowed string function is 'contains'. All logical operators except 'Not', 'Has', 'All' are allowed.
+ /// $top is supported for get list of runs, which limits the maximum number of runs to return.
+ /// The request options, which can override default behaviors of the client pipeline on a per-call basis.
+ public RunsGetAllCollectionResultOfT(Runs client, Guid subscriptionId, string resourceGroupName, string registryName, string filter, int? top, RequestContext context) : base(context?.CancellationToken ?? default)
+ {
+ _client = client;
+ _subscriptionId = subscriptionId;
+ _resourceGroupName = resourceGroupName;
+ _registryName = registryName;
+ _filter = filter;
+ _top = top;
+ _context = context;
+ }
+
+ /// Gets the pages of RunsGetAllCollectionResultOfT as an enumerable collection.
+ /// A continuation token indicating where to resume paging.
+ /// The number of items per page.
+ /// The pages of RunsGetAllCollectionResultOfT as an enumerable collection.
+ public override IEnumerable> AsPages(string continuationToken, int? pageSizeHint)
+ {
+ Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null;
+ while (true)
+ {
+ Response response = GetNextResponse(pageSizeHint, nextPage);
+ if (response is null)
+ {
+ yield break;
+ }
+ RunListResult result = RunListResult.FromResponse(response);
+ yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.IsAbsoluteUri == true ? nextPage.AbsoluteUri : nextPage?.OriginalString, response);
+ string nextPageString = result.NextLink;
+ if (string.IsNullOrEmpty(nextPageString))
+ {
+ yield break;
+ }
+ nextPage = new Uri(nextPageString, UriKind.RelativeOrAbsolute);
+ }
+ }
+
+ /// Get next page.
+ /// The number of items per page.
+ /// The next link to use for the next page of results.
+ private Response GetNextResponse(int? pageSizeHint, Uri nextLink)
+ {
+ HttpMessage message = nextLink != null ? _client.CreateNextGetAllRequest(nextLink, _subscriptionId, _resourceGroupName, _registryName, _filter, _top, _context) : _client.CreateGetAllRequest(_subscriptionId, _resourceGroupName, _registryName, _filter, _top, _context);
+ using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("RunCollection.GetAll");
+ scope.Start();
+ try
+ {
+ return _client.Pipeline.ProcessMessage(message, _context);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ }
+}
diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/CollectionResults/TaskRunsGetAllAsyncCollectionResultOfT.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/CollectionResults/TaskRunsGetAllAsyncCollectionResultOfT.cs
new file mode 100644
index 000000000000..e39a65e737fc
--- /dev/null
+++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/CollectionResults/TaskRunsGetAllAsyncCollectionResultOfT.cs
@@ -0,0 +1,85 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager.ContainerRegistryTasks.Models;
+
+namespace Azure.ResourceManager.ContainerRegistryTasks
+{
+ internal partial class TaskRunsGetAllAsyncCollectionResultOfT : AsyncPageable
+ {
+ private readonly TaskRuns _client;
+ private readonly Guid _subscriptionId;
+ private readonly string _resourceGroupName;
+ private readonly string _registryName;
+ private readonly RequestContext _context;
+
+ /// Initializes a new instance of TaskRunsGetAllAsyncCollectionResultOfT, which is used to iterate over the pages of a collection.
+ /// The TaskRuns client used to send requests.
+ /// The ID of the target subscription. The value must be an UUID.
+ /// The name of the resource group. The name is case insensitive.
+ /// The name of the Registry.
+ /// The request options, which can override default behaviors of the client pipeline on a per-call basis.
+ public TaskRunsGetAllAsyncCollectionResultOfT(TaskRuns client, Guid subscriptionId, string resourceGroupName, string registryName, RequestContext context) : base(context?.CancellationToken ?? default)
+ {
+ _client = client;
+ _subscriptionId = subscriptionId;
+ _resourceGroupName = resourceGroupName;
+ _registryName = registryName;
+ _context = context;
+ }
+
+ /// Gets the pages of TaskRunsGetAllAsyncCollectionResultOfT as an enumerable collection.
+ /// A continuation token indicating where to resume paging.
+ /// The number of items per page.
+ /// The pages of TaskRunsGetAllAsyncCollectionResultOfT as an enumerable collection.
+ public override async IAsyncEnumerable> AsPages(string continuationToken, int? pageSizeHint)
+ {
+ Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null;
+ while (true)
+ {
+ Response response = await GetNextResponseAsync(pageSizeHint, nextPage).ConfigureAwait(false);
+ if (response is null)
+ {
+ yield break;
+ }
+ TaskRunListResult result = TaskRunListResult.FromResponse(response);
+ yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.IsAbsoluteUri == true ? nextPage.AbsoluteUri : nextPage?.OriginalString, response);
+ string nextPageString = result.NextLink;
+ if (string.IsNullOrEmpty(nextPageString))
+ {
+ yield break;
+ }
+ nextPage = new Uri(nextPageString, UriKind.RelativeOrAbsolute);
+ }
+ }
+
+ /// Get next page.
+ /// The number of items per page.
+ /// The next link to use for the next page of results.
+ private async ValueTask GetNextResponseAsync(int? pageSizeHint, Uri nextLink)
+ {
+ HttpMessage message = nextLink != null ? _client.CreateNextGetAllRequest(nextLink, _subscriptionId, _resourceGroupName, _registryName, _context) : _client.CreateGetAllRequest(_subscriptionId, _resourceGroupName, _registryName, _context);
+ using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("TaskRunCollection.GetAll");
+ scope.Start();
+ try
+ {
+ return await _client.Pipeline.ProcessMessageAsync(message, _context).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ }
+}
diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/CollectionResults/TaskRunsGetAllCollectionResultOfT.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/CollectionResults/TaskRunsGetAllCollectionResultOfT.cs
new file mode 100644
index 000000000000..4d0fa17992f6
--- /dev/null
+++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/CollectionResults/TaskRunsGetAllCollectionResultOfT.cs
@@ -0,0 +1,84 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager.ContainerRegistryTasks.Models;
+
+namespace Azure.ResourceManager.ContainerRegistryTasks
+{
+ internal partial class TaskRunsGetAllCollectionResultOfT : Pageable
+ {
+ private readonly TaskRuns _client;
+ private readonly Guid _subscriptionId;
+ private readonly string _resourceGroupName;
+ private readonly string _registryName;
+ private readonly RequestContext _context;
+
+ /// Initializes a new instance of TaskRunsGetAllCollectionResultOfT, which is used to iterate over the pages of a collection.
+ /// The TaskRuns client used to send requests.
+ /// The ID of the target subscription. The value must be an UUID.
+ /// The name of the resource group. The name is case insensitive.
+ /// The name of the Registry.
+ /// The request options, which can override default behaviors of the client pipeline on a per-call basis.
+ public TaskRunsGetAllCollectionResultOfT(TaskRuns client, Guid subscriptionId, string resourceGroupName, string registryName, RequestContext context) : base(context?.CancellationToken ?? default)
+ {
+ _client = client;
+ _subscriptionId = subscriptionId;
+ _resourceGroupName = resourceGroupName;
+ _registryName = registryName;
+ _context = context;
+ }
+
+ /// Gets the pages of TaskRunsGetAllCollectionResultOfT as an enumerable collection.
+ /// A continuation token indicating where to resume paging.
+ /// The number of items per page.
+ /// The pages of TaskRunsGetAllCollectionResultOfT as an enumerable collection.
+ public override IEnumerable> AsPages(string continuationToken, int? pageSizeHint)
+ {
+ Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null;
+ while (true)
+ {
+ Response response = GetNextResponse(pageSizeHint, nextPage);
+ if (response is null)
+ {
+ yield break;
+ }
+ TaskRunListResult result = TaskRunListResult.FromResponse(response);
+ yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.IsAbsoluteUri == true ? nextPage.AbsoluteUri : nextPage?.OriginalString, response);
+ string nextPageString = result.NextLink;
+ if (string.IsNullOrEmpty(nextPageString))
+ {
+ yield break;
+ }
+ nextPage = new Uri(nextPageString, UriKind.RelativeOrAbsolute);
+ }
+ }
+
+ /// Get next page.
+ /// The number of items per page.
+ /// The next link to use for the next page of results.
+ private Response GetNextResponse(int? pageSizeHint, Uri nextLink)
+ {
+ HttpMessage message = nextLink != null ? _client.CreateNextGetAllRequest(nextLink, _subscriptionId, _resourceGroupName, _registryName, _context) : _client.CreateGetAllRequest(_subscriptionId, _resourceGroupName, _registryName, _context);
+ using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("TaskRunCollection.GetAll");
+ scope.Start();
+ try
+ {
+ return _client.Pipeline.ProcessMessage(message, _context);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ }
+}
diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/CollectionResults/TasksGetAllAsyncCollectionResultOfT.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/CollectionResults/TasksGetAllAsyncCollectionResultOfT.cs
new file mode 100644
index 000000000000..bfb0a7b3c6e1
--- /dev/null
+++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/CollectionResults/TasksGetAllAsyncCollectionResultOfT.cs
@@ -0,0 +1,85 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager.ContainerRegistryTasks.Models;
+
+namespace Azure.ResourceManager.ContainerRegistryTasks
+{
+ internal partial class TasksGetAllAsyncCollectionResultOfT : AsyncPageable
+ {
+ private readonly Tasks _client;
+ private readonly Guid _subscriptionId;
+ private readonly string _resourceGroupName;
+ private readonly string _registryName;
+ private readonly RequestContext _context;
+
+ /// Initializes a new instance of TasksGetAllAsyncCollectionResultOfT, which is used to iterate over the pages of a collection.
+ /// The Tasks client used to send requests.
+ /// The ID of the target subscription. The value must be an UUID.
+ /// The name of the resource group. The name is case insensitive.
+ /// The name of the Registry.
+ /// The request options, which can override default behaviors of the client pipeline on a per-call basis.
+ public TasksGetAllAsyncCollectionResultOfT(Tasks client, Guid subscriptionId, string resourceGroupName, string registryName, RequestContext context) : base(context?.CancellationToken ?? default)
+ {
+ _client = client;
+ _subscriptionId = subscriptionId;
+ _resourceGroupName = resourceGroupName;
+ _registryName = registryName;
+ _context = context;
+ }
+
+ /// Gets the pages of TasksGetAllAsyncCollectionResultOfT as an enumerable collection.
+ /// A continuation token indicating where to resume paging.
+ /// The number of items per page.
+ /// The pages of TasksGetAllAsyncCollectionResultOfT as an enumerable collection.
+ public override async IAsyncEnumerable> AsPages(string continuationToken, int? pageSizeHint)
+ {
+ Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null;
+ while (true)
+ {
+ Response response = await GetNextResponseAsync(pageSizeHint, nextPage).ConfigureAwait(false);
+ if (response is null)
+ {
+ yield break;
+ }
+ TaskListResult result = TaskListResult.FromResponse(response);
+ yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.IsAbsoluteUri == true ? nextPage.AbsoluteUri : nextPage?.OriginalString, response);
+ string nextPageString = result.NextLink;
+ if (string.IsNullOrEmpty(nextPageString))
+ {
+ yield break;
+ }
+ nextPage = new Uri(nextPageString, UriKind.RelativeOrAbsolute);
+ }
+ }
+
+ /// Get next page.
+ /// The number of items per page.
+ /// The next link to use for the next page of results.
+ private async ValueTask GetNextResponseAsync(int? pageSizeHint, Uri nextLink)
+ {
+ HttpMessage message = nextLink != null ? _client.CreateNextGetAllRequest(nextLink, _subscriptionId, _resourceGroupName, _registryName, _context) : _client.CreateGetAllRequest(_subscriptionId, _resourceGroupName, _registryName, _context);
+ using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("TaskCollection.GetAll");
+ scope.Start();
+ try
+ {
+ return await _client.Pipeline.ProcessMessageAsync(message, _context).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ }
+}
diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/CollectionResults/TasksGetAllCollectionResultOfT.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/CollectionResults/TasksGetAllCollectionResultOfT.cs
new file mode 100644
index 000000000000..defe3a16d89f
--- /dev/null
+++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/CollectionResults/TasksGetAllCollectionResultOfT.cs
@@ -0,0 +1,84 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager.ContainerRegistryTasks.Models;
+
+namespace Azure.ResourceManager.ContainerRegistryTasks
+{
+ internal partial class TasksGetAllCollectionResultOfT : Pageable
+ {
+ private readonly Tasks _client;
+ private readonly Guid _subscriptionId;
+ private readonly string _resourceGroupName;
+ private readonly string _registryName;
+ private readonly RequestContext _context;
+
+ /// Initializes a new instance of TasksGetAllCollectionResultOfT, which is used to iterate over the pages of a collection.
+ /// The Tasks client used to send requests.
+ /// The ID of the target subscription. The value must be an UUID.
+ /// The name of the resource group. The name is case insensitive.
+ /// The name of the Registry.
+ /// The request options, which can override default behaviors of the client pipeline on a per-call basis.
+ public TasksGetAllCollectionResultOfT(Tasks client, Guid subscriptionId, string resourceGroupName, string registryName, RequestContext context) : base(context?.CancellationToken ?? default)
+ {
+ _client = client;
+ _subscriptionId = subscriptionId;
+ _resourceGroupName = resourceGroupName;
+ _registryName = registryName;
+ _context = context;
+ }
+
+ /// Gets the pages of TasksGetAllCollectionResultOfT as an enumerable collection.
+ /// A continuation token indicating where to resume paging.
+ /// The number of items per page.
+ /// The pages of TasksGetAllCollectionResultOfT as an enumerable collection.
+ public override IEnumerable> AsPages(string continuationToken, int? pageSizeHint)
+ {
+ Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null;
+ while (true)
+ {
+ Response response = GetNextResponse(pageSizeHint, nextPage);
+ if (response is null)
+ {
+ yield break;
+ }
+ TaskListResult result = TaskListResult.FromResponse(response);
+ yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.IsAbsoluteUri == true ? nextPage.AbsoluteUri : nextPage?.OriginalString, response);
+ string nextPageString = result.NextLink;
+ if (string.IsNullOrEmpty(nextPageString))
+ {
+ yield break;
+ }
+ nextPage = new Uri(nextPageString, UriKind.RelativeOrAbsolute);
+ }
+ }
+
+ /// Get next page.
+ /// The number of items per page.
+ /// The next link to use for the next page of results.
+ private Response GetNextResponse(int? pageSizeHint, Uri nextLink)
+ {
+ HttpMessage message = nextLink != null ? _client.CreateNextGetAllRequest(nextLink, _subscriptionId, _resourceGroupName, _registryName, _context) : _client.CreateGetAllRequest(_subscriptionId, _resourceGroupName, _registryName, _context);
+ using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("TaskCollection.GetAll");
+ scope.Start();
+ try
+ {
+ return _client.Pipeline.ProcessMessage(message, _context);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ }
+}
diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/Extensions/ContainerRegistryTasksExtensions.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/Extensions/ContainerRegistryTasksExtensions.cs
new file mode 100644
index 000000000000..fbab91f9821a
--- /dev/null
+++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/Extensions/ContainerRegistryTasksExtensions.cs
@@ -0,0 +1,413 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.ResourceManager;
+using Azure.ResourceManager.ContainerRegistryTasks.Mocking;
+using Azure.ResourceManager.ContainerRegistryTasks.Models;
+using Azure.ResourceManager.Resources;
+
+namespace Azure.ResourceManager.ContainerRegistryTasks
+{
+ /// A class to add extension methods to Azure.ResourceManager.ContainerRegistryTasks.
+ public static partial class ContainerRegistryTasksExtensions
+ {
+ ///
+ private static MockableContainerRegistryTasksArmClient GetMockableContainerRegistryTasksArmClient(ArmClient client)
+ {
+ return client.GetCachedClient(client0 => new MockableContainerRegistryTasksArmClient(client0, ResourceIdentifier.Root));
+ }
+
+ ///
+ private static MockableContainerRegistryTasksResourceGroupResource GetMockableContainerRegistryTasksResourceGroupResource(ResourceGroupResource resourceGroupResource)
+ {
+ return resourceGroupResource.GetCachedClient(client => new MockableContainerRegistryTasksResourceGroupResource(client, resourceGroupResource.Id));
+ }
+
+ ///
+ /// Gets an object representing a along with the instance operations that can be performed on it but with no data.
+ /// -
+ /// Mocking.
+ /// To mock this method, please mock instead.
+ ///
+ ///
+ /// The the method will execute against.
+ /// The resource ID of the resource to get.
+ /// is null.
+ /// Returns a object.
+ public static AgentPoolResource GetAgentPoolResource(this ArmClient client, ResourceIdentifier id)
+ {
+ Argument.AssertNotNull(client, nameof(client));
+
+ return GetMockableContainerRegistryTasksArmClient(client).GetAgentPoolResource(id);
+ }
+
+ ///
+ /// Gets an object representing a along with the instance operations that can be performed on it but with no data.
+ /// -
+ /// Mocking.
+ /// To mock this method, please mock instead.
+ ///
+ ///
+ /// The the method will execute against.
+ /// The resource ID of the resource to get.
+ /// is null.
+ /// Returns a object.
+ public static RunResource GetRunResource(this ArmClient client, ResourceIdentifier id)
+ {
+ Argument.AssertNotNull(client, nameof(client));
+
+ return GetMockableContainerRegistryTasksArmClient(client).GetRunResource(id);
+ }
+
+ ///
+ /// Gets an object representing a along with the instance operations that can be performed on it but with no data.
+ /// -
+ /// Mocking.
+ /// To mock this method, please mock instead.
+ ///
+ ///
+ /// The the method will execute against.
+ /// The resource ID of the resource to get.
+ /// is null.
+ /// Returns a object.
+ public static TaskRunResource GetTaskRunResource(this ArmClient client, ResourceIdentifier id)
+ {
+ Argument.AssertNotNull(client, nameof(client));
+
+ return GetMockableContainerRegistryTasksArmClient(client).GetTaskRunResource(id);
+ }
+
+ ///
+ /// Gets an object representing a along with the instance operations that can be performed on it but with no data.
+ /// -
+ /// Mocking.
+ /// To mock this method, please mock instead.
+ ///
+ ///
+ /// The the method will execute against.
+ /// The resource ID of the resource to get.
+ /// is null.
+ /// Returns a object.
+ public static TaskResource GetTaskResource(this ArmClient client, ResourceIdentifier id)
+ {
+ Argument.AssertNotNull(client, nameof(client));
+
+ return GetMockableContainerRegistryTasksArmClient(client).GetTaskResource(id);
+ }
+
+ ///
+ /// Gets a collection of AgentPools in the
+ /// -
+ /// Mocking.
+ /// To mock this method, please mock instead.
+ ///
+ ///
+ /// The the method will execute against.
+ /// The registryName for the resource.
+ /// is null.
+ /// An object representing collection of AgentPools and their operations over a AgentPoolResource.
+ public static AgentPoolCollection GetAgentPools(this ResourceGroupResource resourceGroupResource, string registryName)
+ {
+ Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource));
+
+ return GetMockableContainerRegistryTasksResourceGroupResource(resourceGroupResource).GetAgentPools(registryName);
+ }
+
+ ///
+ /// Gets the detailed information for a given agent pool.
+ /// -
+ /// Mocking.
+ /// To mock this method, please mock instead.
+ ///
+ ///
+ /// The the method will execute against.
+ /// The registryName for the resource.
+ /// The name of the agent pool.
+ /// The cancellation token to use.
+ /// is null.
+ [ForwardsClientCalls]
+ public static async Task> GetAgentPoolAsync(this ResourceGroupResource resourceGroupResource, string registryName, string agentPoolName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource));
+
+ return await GetMockableContainerRegistryTasksResourceGroupResource(resourceGroupResource).GetAgentPoolAsync(registryName, agentPoolName, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Gets the detailed information for a given agent pool.
+ /// -
+ /// Mocking.
+ /// To mock this method, please mock instead.
+ ///
+ ///
+ /// The the method will execute against.
+ /// The registryName for the resource.
+ /// The name of the agent pool.
+ /// The cancellation token to use.
+ /// is null.
+ [ForwardsClientCalls]
+ public static Response GetAgentPool(this ResourceGroupResource resourceGroupResource, string registryName, string agentPoolName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource));
+
+ return GetMockableContainerRegistryTasksResourceGroupResource(resourceGroupResource).GetAgentPool(registryName, agentPoolName, cancellationToken);
+ }
+
+ ///
+ /// Gets a collection of Runs in the
+ /// -
+ /// Mocking.
+ /// To mock this method, please mock instead.
+ ///
+ ///
+ /// The the method will execute against.
+ /// The registryName for the resource.
+ /// is null.
+ /// An object representing collection of Runs and their operations over a RunResource.
+ public static RunCollection GetRuns(this ResourceGroupResource resourceGroupResource, string registryName)
+ {
+ Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource));
+
+ return GetMockableContainerRegistryTasksResourceGroupResource(resourceGroupResource).GetRuns(registryName);
+ }
+
+ ///
+ /// Gets the detailed information for a given run.
+ /// -
+ /// Mocking.
+ /// To mock this method, please mock instead.
+ ///
+ ///
+ /// The the method will execute against.
+ /// The registryName for the resource.
+ /// The run ID.
+ /// The cancellation token to use.
+ /// is null.
+ [ForwardsClientCalls]
+ public static async Task> GetRunAsync(this ResourceGroupResource resourceGroupResource, string registryName, string runId, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource));
+
+ return await GetMockableContainerRegistryTasksResourceGroupResource(resourceGroupResource).GetRunAsync(registryName, runId, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Gets the detailed information for a given run.
+ /// -
+ /// Mocking.
+ /// To mock this method, please mock instead.
+ ///
+ ///
+ /// The the method will execute against.
+ /// The registryName for the resource.
+ /// The run ID.
+ /// The cancellation token to use.
+ /// is null.
+ [ForwardsClientCalls]
+ public static Response GetRun(this ResourceGroupResource resourceGroupResource, string registryName, string runId, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource));
+
+ return GetMockableContainerRegistryTasksResourceGroupResource(resourceGroupResource).GetRun(registryName, runId, cancellationToken);
+ }
+
+ ///
+ /// Gets a collection of TaskRuns in the
+ /// -
+ /// Mocking.
+ /// To mock this method, please mock instead.
+ ///
+ ///
+ /// The the method will execute against.
+ /// The registryName for the resource.
+ /// is null.
+ /// An object representing collection of TaskRuns and their operations over a TaskRunResource.
+ public static TaskRunCollection GetTaskRuns(this ResourceGroupResource resourceGroupResource, string registryName)
+ {
+ Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource));
+
+ return GetMockableContainerRegistryTasksResourceGroupResource(resourceGroupResource).GetTaskRuns(registryName);
+ }
+
+ ///
+ /// Gets the detailed information for a given task run.
+ /// -
+ /// Mocking.
+ /// To mock this method, please mock instead.
+ ///
+ ///
+ /// The the method will execute against.
+ /// The registryName for the resource.
+ /// The name of the task run.
+ /// The cancellation token to use.
+ /// is null.
+ [ForwardsClientCalls]
+ public static async Task> GetTaskRunAsync(this ResourceGroupResource resourceGroupResource, string registryName, string taskRunName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource));
+
+ return await GetMockableContainerRegistryTasksResourceGroupResource(resourceGroupResource).GetTaskRunAsync(registryName, taskRunName, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Gets the detailed information for a given task run.
+ /// -
+ /// Mocking.
+ /// To mock this method, please mock instead.
+ ///
+ ///
+ /// The the method will execute against.
+ /// The registryName for the resource.
+ /// The name of the task run.
+ /// The cancellation token to use.
+ /// is null.
+ [ForwardsClientCalls]
+ public static Response GetTaskRun(this ResourceGroupResource resourceGroupResource, string registryName, string taskRunName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource));
+
+ return GetMockableContainerRegistryTasksResourceGroupResource(resourceGroupResource).GetTaskRun(registryName, taskRunName, cancellationToken);
+ }
+
+ ///
+ /// Gets a collection of Tasks in the
+ /// -
+ /// Mocking.
+ /// To mock this method, please mock instead.
+ ///
+ ///
+ /// The the method will execute against.
+ /// The registryName for the resource.
+ /// is null.
+ /// An object representing collection of Tasks and their operations over a TaskResource.
+ public static TaskCollection GetTasks(this ResourceGroupResource resourceGroupResource, string registryName)
+ {
+ Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource));
+
+ return GetMockableContainerRegistryTasksResourceGroupResource(resourceGroupResource).GetTasks(registryName);
+ }
+
+ ///
+ /// Get the properties of a specified task.
+ /// -
+ /// Mocking.
+ /// To mock this method, please mock instead.
+ ///
+ ///
+ /// The the method will execute against.
+ /// The registryName for the resource.
+ /// The name of the container registry task.
+ /// The cancellation token to use.
+ /// is null.
+ [ForwardsClientCalls]
+ public static async Task> GetTaskAsync(this ResourceGroupResource resourceGroupResource, string registryName, string taskName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource));
+
+ return await GetMockableContainerRegistryTasksResourceGroupResource(resourceGroupResource).GetTaskAsync(registryName, taskName, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Get the properties of a specified task.
+ /// -
+ /// Mocking.
+ /// To mock this method, please mock instead.
+ ///
+ ///
+ /// The the method will execute against.
+ /// The registryName for the resource.
+ /// The name of the container registry task.
+ /// The cancellation token to use.
+ /// is null.
+ [ForwardsClientCalls]
+ public static Response GetTask(this ResourceGroupResource resourceGroupResource, string registryName, string taskName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource));
+
+ return GetMockableContainerRegistryTasksResourceGroupResource(resourceGroupResource).GetTask(registryName, taskName, cancellationToken);
+ }
+
+ ///
+ /// Schedules a new run based on the request parameters and add it to the run queue.
+ /// -
+ /// Mocking.
+ /// To mock this method, please mock instead.
+ ///
+ ///
+ /// The the method will execute against.
+ /// The name of the container registry.
+ /// The request body.
+ /// The cancellation token to use.
+ /// is null.
+ public static async Task> ScheduleRunAsync(this ResourceGroupResource resourceGroupResource, string registryName, RunContent content, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource));
+
+ return await GetMockableContainerRegistryTasksResourceGroupResource(resourceGroupResource).ScheduleRunAsync(registryName, content, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Schedules a new run based on the request parameters and add it to the run queue.
+ /// -
+ /// Mocking.
+ /// To mock this method, please mock instead.
+ ///
+ ///
+ /// The the method will execute against.
+ /// The name of the container registry.
+ /// The request body.
+ /// The cancellation token to use.
+ /// is null.
+ public static Response ScheduleRun(this ResourceGroupResource resourceGroupResource, string registryName, RunContent content, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource));
+
+ return GetMockableContainerRegistryTasksResourceGroupResource(resourceGroupResource).ScheduleRun(registryName, content, cancellationToken);
+ }
+
+ ///
+ /// Get the upload location for the user to be able to upload the source.
+ /// -
+ /// Mocking.
+ /// To mock this method, please mock instead.
+ ///
+ ///
+ /// The the method will execute against.
+ /// The name of the container registry.
+ /// The cancellation token to use.
+ /// is null.
+ public static async Task> GetBuildSourceUploadUrlAsync(this ResourceGroupResource resourceGroupResource, string registryName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource));
+
+ return await GetMockableContainerRegistryTasksResourceGroupResource(resourceGroupResource).GetBuildSourceUploadUrlAsync(registryName, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Get the upload location for the user to be able to upload the source.
+ /// -
+ /// Mocking.
+ /// To mock this method, please mock instead.
+ ///
+ ///
+ /// The the method will execute against.
+ /// The name of the container registry.
+ /// The cancellation token to use.
+ /// is null.
+ public static Response GetBuildSourceUploadUrl(this ResourceGroupResource resourceGroupResource, string registryName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource));
+
+ return GetMockableContainerRegistryTasksResourceGroupResource(resourceGroupResource).GetBuildSourceUploadUrl(registryName, cancellationToken);
+ }
+ }
+}
diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/Extensions/MockableContainerRegistryTasksArmClient.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/Extensions/MockableContainerRegistryTasksArmClient.cs
new file mode 100644
index 000000000000..d6c5efd06075
--- /dev/null
+++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/Extensions/MockableContainerRegistryTasksArmClient.cs
@@ -0,0 +1,65 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using Azure.Core;
+using Azure.ResourceManager;
+using Azure.ResourceManager.ContainerRegistryTasks;
+
+namespace Azure.ResourceManager.ContainerRegistryTasks.Mocking
+{
+ /// A class to add extension methods to .
+ public partial class MockableContainerRegistryTasksArmClient : ArmResource
+ {
+ /// Initializes a new instance of MockableContainerRegistryTasksArmClient for mocking.
+ protected MockableContainerRegistryTasksArmClient()
+ {
+ }
+
+ /// Initializes a new instance of class.
+ /// The client parameters to use in these operations.
+ /// The identifier of the resource that is the target of operations.
+ internal MockableContainerRegistryTasksArmClient(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ }
+
+ /// Gets an object representing a along with the instance operations that can be performed on it but with no data.
+ /// The resource ID of the resource to get.
+ /// Returns a object.
+ public virtual AgentPoolResource GetAgentPoolResource(ResourceIdentifier id)
+ {
+ AgentPoolResource.ValidateResourceId(id);
+ return new AgentPoolResource(Client, id);
+ }
+
+ /// Gets an object representing a along with the instance operations that can be performed on it but with no data.
+ /// The resource ID of the resource to get.
+ /// Returns a object.
+ public virtual RunResource GetRunResource(ResourceIdentifier id)
+ {
+ RunResource.ValidateResourceId(id);
+ return new RunResource(Client, id);
+ }
+
+ /// Gets an object representing a along with the instance operations that can be performed on it but with no data.
+ /// The resource ID of the resource to get.
+ /// Returns a object.
+ public virtual TaskRunResource GetTaskRunResource(ResourceIdentifier id)
+ {
+ TaskRunResource.ValidateResourceId(id);
+ return new TaskRunResource(Client, id);
+ }
+
+ /// Gets an object representing a along with the instance operations that can be performed on it but with no data.
+ /// The resource ID of the resource to get.
+ /// Returns a object.
+ public virtual TaskResource GetTaskResource(ResourceIdentifier id)
+ {
+ TaskResource.ValidateResourceId(id);
+ return new TaskResource(Client, id);
+ }
+ }
+}
diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/Extensions/MockableContainerRegistryTasksResourceGroupResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/Extensions/MockableContainerRegistryTasksResourceGroupResource.cs
new file mode 100644
index 000000000000..70f47a0bda0f
--- /dev/null
+++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/Extensions/MockableContainerRegistryTasksResourceGroupResource.cs
@@ -0,0 +1,515 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager;
+using Azure.ResourceManager.ContainerRegistryTasks;
+using Azure.ResourceManager.ContainerRegistryTasks.Models;
+using Azure.ResourceManager.Resources;
+
+namespace Azure.ResourceManager.ContainerRegistryTasks.Mocking
+{
+ /// A class to add extension methods to .
+ public partial class MockableContainerRegistryTasksResourceGroupResource : ArmResource
+ {
+ private ClientDiagnostics _registriesClientDiagnostics;
+ private Registries _registriesRestClient;
+
+ /// Initializes a new instance of MockableContainerRegistryTasksResourceGroupResource for mocking.
+ protected MockableContainerRegistryTasksResourceGroupResource()
+ {
+ }
+
+ /// Initializes a new instance of class.
+ /// The client parameters to use in these operations.
+ /// The identifier of the resource that is the target of operations.
+ internal MockableContainerRegistryTasksResourceGroupResource(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ }
+
+ private ClientDiagnostics RegistriesClientDiagnostics => _registriesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ContainerRegistryTasks.Mocking", ProviderConstants.DefaultProviderNamespace, Diagnostics);
+
+ private Registries RegistriesRestClient => _registriesRestClient ??= new Registries(RegistriesClientDiagnostics, Pipeline, Endpoint, "2025-03-01-preview");
+
+ /// Gets a collection of AgentPools in the .
+ /// The registryName for the resource.
+ /// An object representing collection of AgentPools and their operations over a AgentPoolResource.
+ public virtual AgentPoolCollection GetAgentPools(string registryName)
+ {
+ return GetCachedClient(client => new AgentPoolCollection(client, Id, registryName));
+ }
+
+ ///
+ /// Gets the detailed information for a given agent pool.
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}.
+ ///
+ /// -
+ /// Operation Id.
+ /// AgentPools_Get.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-03-01-preview.
+ ///
+ ///
+ ///
+ /// The registryName for the resource.
+ /// The name of the agent pool.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ [ForwardsClientCalls]
+ public virtual async Task> GetAgentPoolAsync(string registryName, string agentPoolName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName));
+
+ return await GetAgentPools(registryName).GetAsync(agentPoolName, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Gets the detailed information for a given agent pool.
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}.
+ ///
+ /// -
+ /// Operation Id.
+ /// AgentPools_Get.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-03-01-preview.
+ ///
+ ///
+ ///
+ /// The registryName for the resource.
+ /// The name of the agent pool.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ [ForwardsClientCalls]
+ public virtual Response GetAgentPool(string registryName, string agentPoolName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName));
+
+ return GetAgentPools(registryName).Get(agentPoolName, cancellationToken);
+ }
+
+ /// Gets a collection of Runs in the .
+ /// The registryName for the resource.
+ /// An object representing collection of Runs and their operations over a RunResource.
+ public virtual RunCollection GetRuns(string registryName)
+ {
+ return GetCachedClient(client => new RunCollection(client, Id, registryName));
+ }
+
+ ///
+ /// Gets the detailed information for a given run.
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs/{runId}.
+ ///
+ /// -
+ /// Operation Id.
+ /// Runs_Get.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-03-01-preview.
+ ///
+ ///
+ ///
+ /// The registryName for the resource.
+ /// The run ID.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ [ForwardsClientCalls]
+ public virtual async Task> GetRunAsync(string registryName, string runId, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(runId, nameof(runId));
+
+ return await GetRuns(registryName).GetAsync(runId, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Gets the detailed information for a given run.
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs/{runId}.
+ ///
+ /// -
+ /// Operation Id.
+ /// Runs_Get.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-03-01-preview.
+ ///
+ ///
+ ///
+ /// The registryName for the resource.
+ /// The run ID.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ [ForwardsClientCalls]
+ public virtual Response GetRun(string registryName, string runId, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(runId, nameof(runId));
+
+ return GetRuns(registryName).Get(runId, cancellationToken);
+ }
+
+ /// Gets a collection of TaskRuns in the .
+ /// The registryName for the resource.
+ /// An object representing collection of TaskRuns and their operations over a TaskRunResource.
+ public virtual TaskRunCollection GetTaskRuns(string registryName)
+ {
+ return GetCachedClient(client => new TaskRunCollection(client, Id, registryName));
+ }
+
+ ///
+ /// Gets the detailed information for a given task run.
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns/{taskRunName}.
+ ///
+ /// -
+ /// Operation Id.
+ /// TaskRuns_Get.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-03-01-preview.
+ ///
+ ///
+ ///
+ /// The registryName for the resource.
+ /// The name of the task run.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ [ForwardsClientCalls]
+ public virtual async Task> GetTaskRunAsync(string registryName, string taskRunName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(taskRunName, nameof(taskRunName));
+
+ return await GetTaskRuns(registryName).GetAsync(taskRunName, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Gets the detailed information for a given task run.
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns/{taskRunName}.
+ ///
+ /// -
+ /// Operation Id.
+ /// TaskRuns_Get.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-03-01-preview.
+ ///
+ ///
+ ///
+ /// The registryName for the resource.
+ /// The name of the task run.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ [ForwardsClientCalls]
+ public virtual Response GetTaskRun(string registryName, string taskRunName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(taskRunName, nameof(taskRunName));
+
+ return GetTaskRuns(registryName).Get(taskRunName, cancellationToken);
+ }
+
+ /// Gets a collection of Tasks in the .
+ /// The registryName for the resource.
+ /// An object representing collection of Tasks and their operations over a TaskResource.
+ public virtual TaskCollection GetTasks(string registryName)
+ {
+ return GetCachedClient(client => new TaskCollection(client, Id, registryName));
+ }
+
+ ///
+ /// Get the properties of a specified task.
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}.
+ ///
+ /// -
+ /// Operation Id.
+ /// Tasks_Get.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-03-01-preview.
+ ///
+ ///
+ ///
+ /// The registryName for the resource.
+ /// The name of the container registry task.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ [ForwardsClientCalls]
+ public virtual async Task> GetTaskAsync(string registryName, string taskName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(taskName, nameof(taskName));
+
+ return await GetTasks(registryName).GetAsync(taskName, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Get the properties of a specified task.
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}.
+ ///
+ /// -
+ /// Operation Id.
+ /// Tasks_Get.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-03-01-preview.
+ ///
+ ///
+ ///
+ /// The registryName for the resource.
+ /// The name of the container registry task.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ [ForwardsClientCalls]
+ public virtual Response GetTask(string registryName, string taskName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(taskName, nameof(taskName));
+
+ return GetTasks(registryName).Get(taskName, cancellationToken);
+ }
+
+ ///
+ /// Schedules a new run based on the request parameters and add it to the run queue.
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scheduleRun.
+ ///
+ /// -
+ /// Operation Id.
+ /// Registries_ScheduleRun.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-03-01-preview.
+ ///
+ ///
+ ///
+ /// The name of the container registry.
+ /// The request body.
+ /// The cancellation token to use.
+ /// or is null.
+ /// is an empty string, and was expected to be non-empty.
+ public virtual async Task> ScheduleRunAsync(string registryName, RunContent content, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(registryName, nameof(registryName));
+ Argument.AssertNotNull(content, nameof(content));
+
+ using DiagnosticScope scope = RegistriesClientDiagnostics.CreateScope("MockableContainerRegistryTasksResourceGroupResource.ScheduleRun");
+ scope.Start();
+ try
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = RegistriesRestClient.CreateScheduleRunRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, registryName, RunContent.ToRequestContent(content), context);
+ Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ Response response = Response.FromValue(RunData.FromResponse(result), result);
+ if (response.Value == null)
+ {
+ throw new RequestFailedException(response.GetRawResponse());
+ }
+ return Response.FromValue(new RunResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Schedules a new run based on the request parameters and add it to the run queue.
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scheduleRun.
+ ///
+ /// -
+ /// Operation Id.
+ /// Registries_ScheduleRun.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-03-01-preview.
+ ///
+ ///
+ ///
+ /// The name of the container registry.
+ /// The request body.
+ /// The cancellation token to use.
+ /// or is null.
+ /// is an empty string, and was expected to be non-empty.
+ public virtual Response ScheduleRun(string registryName, RunContent content, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(registryName, nameof(registryName));
+ Argument.AssertNotNull(content, nameof(content));
+
+ using DiagnosticScope scope = RegistriesClientDiagnostics.CreateScope("MockableContainerRegistryTasksResourceGroupResource.ScheduleRun");
+ scope.Start();
+ try
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = RegistriesRestClient.CreateScheduleRunRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, registryName, RunContent.ToRequestContent(content), context);
+ Response result = Pipeline.ProcessMessage(message, context);
+ Response response = Response.FromValue(RunData.FromResponse(result), result);
+ if (response.Value == null)
+ {
+ throw new RequestFailedException(response.GetRawResponse());
+ }
+ return Response.FromValue(new RunResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get the upload location for the user to be able to upload the source.
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listBuildSourceUploadUrl.
+ ///
+ /// -
+ /// Operation Id.
+ /// Registries_GetBuildSourceUploadUrl.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-03-01-preview.
+ ///
+ ///
+ ///
+ /// The name of the container registry.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ public virtual async Task> GetBuildSourceUploadUrlAsync(string registryName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(registryName, nameof(registryName));
+
+ using DiagnosticScope scope = RegistriesClientDiagnostics.CreateScope("MockableContainerRegistryTasksResourceGroupResource.GetBuildSourceUploadUrl");
+ scope.Start();
+ try
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = RegistriesRestClient.CreateGetBuildSourceUploadUrlRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, registryName, context);
+ Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ Response response = Response.FromValue(SourceUploadResult.FromResponse(result), result);
+ if (response.Value == null)
+ {
+ throw new RequestFailedException(response.GetRawResponse());
+ }
+ return response;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get the upload location for the user to be able to upload the source.
+ ///
+ /// -
+ /// Request Path.
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listBuildSourceUploadUrl.
+ ///
+ /// -
+ /// Operation Id.
+ /// Registries_GetBuildSourceUploadUrl.
+ ///
+ /// -
+ /// Default Api Version.
+ /// 2025-03-01-preview.
+ ///
+ ///
+ ///
+ /// The name of the container registry.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ public virtual Response GetBuildSourceUploadUrl(string registryName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(registryName, nameof(registryName));
+
+ using DiagnosticScope scope = RegistriesClientDiagnostics.CreateScope("MockableContainerRegistryTasksResourceGroupResource.GetBuildSourceUploadUrl");
+ scope.Start();
+ try
+ {
+ RequestContext context = new RequestContext
+ {
+ CancellationToken = cancellationToken
+ };
+ HttpMessage message = RegistriesRestClient.CreateGetBuildSourceUploadUrlRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, registryName, context);
+ Response result = Pipeline.ProcessMessage(message, context);
+ Response response = Response.FromValue(SourceUploadResult.FromResponse(result), result);
+ if (response.Value == null)
+ {
+ throw new RequestFailedException(response.GetRawResponse());
+ }
+ return response;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ }
+}
diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/Internal/Argument.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/Internal/Argument.cs
new file mode 100644
index 000000000000..14e3c8df26b4
--- /dev/null
+++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/Internal/Argument.cs
@@ -0,0 +1,113 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+namespace Azure.ResourceManager.ContainerRegistryTasks
+{
+ internal static partial class Argument
+ {
+ /// The value.
+ /// The name.
+ public static void AssertNotNull(T value, string name)
+ {
+ if (value is null)
+ {
+ throw new ArgumentNullException(name);
+ }
+ }
+
+ /// The value.
+ /// The name.
+ public static void AssertNotNull(T? value, string name)
+ where T : struct
+ {
+ if (!value.HasValue)
+ {
+ throw new ArgumentNullException(name);
+ }
+ }
+
+ /// The value.
+ /// The name.
+ public static void AssertNotNullOrEmpty(IEnumerable value, string name)
+ {
+ if (value is null)
+ {
+ throw new ArgumentNullException(name);
+ }
+ if (value is ICollection collectionOfT && collectionOfT.Count == 0)
+ {
+ throw new ArgumentException("Value cannot be an empty collection.", name);
+ }
+ if (value is ICollection collection && collection.Count == 0)
+ {
+ throw new ArgumentException("Value cannot be an empty collection.", name);
+ }
+ using IEnumerator e = value.GetEnumerator();
+ if (!e.MoveNext())
+ {
+ throw new ArgumentException("Value cannot be an empty collection.", name);
+ }
+ }
+
+ /// The value.
+ /// The name.
+ public static void AssertNotNullOrEmpty(string value, string name)
+ {
+ if (value is null)
+ {
+ throw new ArgumentNullException(name);
+ }
+ if (value.Length == 0)
+ {
+ throw new ArgumentException("Value cannot be an empty string.", name);
+ }
+ }
+
+ /// The value.
+ /// The name.
+ public static void AssertNotNullOrWhiteSpace(string value, string name)
+ {
+ if (value is null)
+ {
+ throw new ArgumentNullException(name);
+ }
+ if (string.IsNullOrWhiteSpace(value))
+ {
+ throw new ArgumentException("Value cannot be empty or contain only white-space characters.", name);
+ }
+ }
+
+ /// The value.
+ /// The minimum value.
+ /// The maximum value.
+ /// The name.
+ public static void AssertInRange(T value, T minimum, T maximum, string name)
+ where T : notnull, IComparable
+ {
+ if (minimum.CompareTo(value) > 0)
+ {
+ throw new ArgumentOutOfRangeException(name, "Value is less than the minimum allowed.");
+ }
+ if (maximum.CompareTo(value) < 0)
+ {
+ throw new ArgumentOutOfRangeException(name, "Value is greater than the maximum allowed.");
+ }
+ }
+
+ /// The value.
+ /// The name.
+ public static string CheckNotNullOrEmpty(string value, string name)
+ {
+ AssertNotNullOrEmpty(value, name);
+ return value;
+ }
+ }
+}
diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/Internal/AsyncPageableWrapper.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/Internal/AsyncPageableWrapper.cs
new file mode 100644
index 000000000000..b806461b7696
--- /dev/null
+++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistryTasks/src/Generated/Internal/AsyncPageableWrapper.cs
@@ -0,0 +1,48 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using Azure;
+
+namespace Azure.ResourceManager.ContainerRegistryTasks
+{
+ internal partial class AsyncPageableWrapper : AsyncPageable
+ {
+ /// The source async pageable value of type AsyncPageable<T>.
+ private AsyncPageable _source;
+ /// The converter function from T to U.
+ private Func _converter;
+
+ /// Initializes a new instance of the AsyncPageableWrapper class.
+ /// The source async pageable value of type AsyncPageable<T>.
+ /// The converter function from T to U.
+ public AsyncPageableWrapper(AsyncPageable source, Func converter)
+ {
+ _source = source;
+ _converter = converter;
+ }
+
+ ///