diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/CacheRuleCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/CacheRuleCollection.cs new file mode 100644 index 000000000000..c3c50558fd1e --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/CacheRuleCollection.cs @@ -0,0 +1,276 @@ +// 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.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.ContainerRegistry +{ + /// + /// 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 GetCacheRules method from an instance of . + /// + public partial class CacheRuleCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _cacheRuleClientDiagnostics; + private readonly CacheRulesRestOperations _cacheRuleRestClient; + + /// Initializes a new instance of the class for mocking. + protected CacheRuleCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal CacheRuleCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _cacheRuleClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerRegistry", CacheRuleResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(CacheRuleResource.ResourceType, out string cacheRuleApiVersion); + _cacheRuleRestClient = new CacheRulesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cacheRuleApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ContainerRegistryResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ContainerRegistryResource.ResourceType), nameof(id)); + } + + /// + /// Creates a cache rule for a container registry with the specified parameters. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules/{cacheRuleName} + /// Operation Id: CacheRules_Create + /// + /// 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 cache rule. + /// The parameters for creating a cache rule. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string cacheRuleName, CacheRuleData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cacheRuleName, nameof(cacheRuleName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _cacheRuleClientDiagnostics.CreateScope("CacheRuleCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _cacheRuleRestClient.CreateAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cacheRuleName, data, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new CacheRuleOperationSource(Client), _cacheRuleClientDiagnostics, Pipeline, _cacheRuleRestClient.CreateCreateRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cacheRuleName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates a cache rule for a container registry with the specified parameters. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules/{cacheRuleName} + /// Operation Id: CacheRules_Create + /// + /// 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 cache rule. + /// The parameters for creating a cache rule. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string cacheRuleName, CacheRuleData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cacheRuleName, nameof(cacheRuleName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _cacheRuleClientDiagnostics.CreateScope("CacheRuleCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _cacheRuleRestClient.Create(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cacheRuleName, data, cancellationToken); + var operation = new ContainerRegistryArmOperation(new CacheRuleOperationSource(Client), _cacheRuleClientDiagnostics, Pipeline, _cacheRuleRestClient.CreateCreateRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cacheRuleName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the properties of the specified cache rule resource. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules/{cacheRuleName} + /// Operation Id: CacheRules_Get + /// + /// The name of the cache rule. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string cacheRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cacheRuleName, nameof(cacheRuleName)); + + using var scope = _cacheRuleClientDiagnostics.CreateScope("CacheRuleCollection.Get"); + scope.Start(); + try + { + var response = await _cacheRuleRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cacheRuleName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new CacheRuleResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the properties of the specified cache rule resource. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules/{cacheRuleName} + /// Operation Id: CacheRules_Get + /// + /// The name of the cache rule. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string cacheRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cacheRuleName, nameof(cacheRuleName)); + + using var scope = _cacheRuleClientDiagnostics.CreateScope("CacheRuleCollection.Get"); + scope.Start(); + try + { + var response = _cacheRuleRestClient.Get(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cacheRuleName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new CacheRuleResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists all cache rule resources for the specified container registry. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules + /// Operation Id: CacheRules_List + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _cacheRuleRestClient.CreateListRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _cacheRuleRestClient.CreateListNextPageRequest(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); + return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CacheRuleResource(Client, CacheRuleData.DeserializeCacheRuleData(e)), _cacheRuleClientDiagnostics, Pipeline, "CacheRuleCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Lists all cache rule resources for the specified container registry. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules + /// Operation Id: CacheRules_List + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _cacheRuleRestClient.CreateListRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _cacheRuleRestClient.CreateListNextPageRequest(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); + return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CacheRuleResource(Client, CacheRuleData.DeserializeCacheRuleData(e)), _cacheRuleClientDiagnostics, Pipeline, "CacheRuleCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules/{cacheRuleName} + /// Operation Id: CacheRules_Get + /// + /// The name of the cache rule. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string cacheRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cacheRuleName, nameof(cacheRuleName)); + + using var scope = _cacheRuleClientDiagnostics.CreateScope("CacheRuleCollection.Exists"); + scope.Start(); + try + { + var response = await _cacheRuleRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cacheRuleName, cancellationToken: cancellationToken).ConfigureAwait(false); + 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}/cacheRules/{cacheRuleName} + /// Operation Id: CacheRules_Get + /// + /// The name of the cache rule. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string cacheRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cacheRuleName, nameof(cacheRuleName)); + + using var scope = _cacheRuleClientDiagnostics.CreateScope("CacheRuleCollection.Exists"); + scope.Start(); + try + { + var response = _cacheRuleRestClient.Get(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cacheRuleName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/CacheRuleData.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/CacheRuleData.cs new file mode 100644 index 000000000000..07d49e6d10f9 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/CacheRuleData.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; +using Azure.ResourceManager.ContainerRegistry.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + /// A class representing the CacheRule data model. + public partial class CacheRuleData : ResourceData + { + /// Initializes a new instance of CacheRuleData. + public CacheRuleData() + { + } + + /// Initializes a new instance of CacheRuleData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The ARM resource ID of the credential store which is associated with the cache rule. + /// Source repository pulled from upstream. + /// + /// Target repository specified in docker pull command. + /// Eg: docker pull myregistry.azurecr.io/{targetRepository}:{tag} + /// + /// The creation date of the cache rule. + /// Provisioning state of the resource. + internal CacheRuleData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ResourceIdentifier credentialSetResourceId, string sourceRepository, string targetRepository, DateTimeOffset? createdOn, ContainerRegistryProvisioningState? provisioningState) : base(id, name, resourceType, systemData) + { + CredentialSetResourceId = credentialSetResourceId; + SourceRepository = sourceRepository; + TargetRepository = targetRepository; + CreatedOn = createdOn; + ProvisioningState = provisioningState; + } + + /// The ARM resource ID of the credential store which is associated with the cache rule. + public ResourceIdentifier CredentialSetResourceId { get; set; } + /// Source repository pulled from upstream. + public string SourceRepository { get; set; } + /// + /// Target repository specified in docker pull command. + /// Eg: docker pull myregistry.azurecr.io/{targetRepository}:{tag} + /// + public string TargetRepository { get; set; } + /// The creation date of the cache rule. + public DateTimeOffset? CreatedOn { get; } + /// Provisioning state of the resource. + public ContainerRegistryProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/CacheRuleResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/CacheRuleResource.cs new file mode 100644 index 000000000000..e9f20ff617c8 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/CacheRuleResource.cs @@ -0,0 +1,250 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.ContainerRegistry.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + /// + /// A Class representing a CacheRule 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 GetCacheRuleResource method. + /// Otherwise you can get one from its parent resource using the GetCacheRule method. + /// + public partial class CacheRuleResource : ArmResource + { + /// Generate the resource identifier of a instance. + public static ResourceIdentifier CreateResourceIdentifier(Guid subscriptionId, string resourceGroupName, string registryName, string cacheRuleName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules/{cacheRuleName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _cacheRuleClientDiagnostics; + private readonly CacheRulesRestOperations _cacheRuleRestClient; + private readonly CacheRuleData _data; + + /// Initializes a new instance of the class for mocking. + protected CacheRuleResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal CacheRuleResource(ArmClient client, CacheRuleData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal CacheRuleResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _cacheRuleClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerRegistry", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string cacheRuleApiVersion); + _cacheRuleRestClient = new CacheRulesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cacheRuleApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.ContainerRegistry/registries/cacheRules"; + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual CacheRuleData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets the properties of the specified cache rule resource. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules/{cacheRuleName} + /// Operation Id: CacheRules_Get + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _cacheRuleClientDiagnostics.CreateScope("CacheRuleResource.Get"); + scope.Start(); + try + { + var response = await _cacheRuleRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new CacheRuleResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the properties of the specified cache rule resource. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules/{cacheRuleName} + /// Operation Id: CacheRules_Get + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _cacheRuleClientDiagnostics.CreateScope("CacheRuleResource.Get"); + scope.Start(); + try + { + var response = _cacheRuleRestClient.Get(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new CacheRuleResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a cache rule resource from a container registry. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules/{cacheRuleName} + /// Operation Id: CacheRules_Delete + /// + /// 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 var scope = _cacheRuleClientDiagnostics.CreateScope("CacheRuleResource.Delete"); + scope.Start(); + try + { + var response = await _cacheRuleRestClient.DeleteAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(_cacheRuleClientDiagnostics, Pipeline, _cacheRuleRestClient.CreateDeleteRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).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 cache rule resource from a container registry. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules/{cacheRuleName} + /// Operation Id: CacheRules_Delete + /// + /// 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 var scope = _cacheRuleClientDiagnostics.CreateScope("CacheRuleResource.Delete"); + scope.Start(); + try + { + var response = _cacheRuleRestClient.Delete(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new ContainerRegistryArmOperation(_cacheRuleClientDiagnostics, Pipeline, _cacheRuleRestClient.CreateDeleteRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates a cache rule for a container registry with the specified parameters. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules/{cacheRuleName} + /// Operation Id: CacheRules_Update + /// + /// 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 a cache rule. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, CacheRulePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _cacheRuleClientDiagnostics.CreateScope("CacheRuleResource.Update"); + scope.Start(); + try + { + var response = await _cacheRuleRestClient.UpdateAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new CacheRuleOperationSource(Client), _cacheRuleClientDiagnostics, Pipeline, _cacheRuleRestClient.CreateUpdateRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates a cache rule for a container registry with the specified parameters. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules/{cacheRuleName} + /// Operation Id: CacheRules_Update + /// + /// 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 a cache rule. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, CacheRulePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _cacheRuleClientDiagnostics.CreateScope("CacheRuleResource.Update"); + scope.Start(); + try + { + var response = _cacheRuleRestClient.Update(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch, cancellationToken); + var operation = new ContainerRegistryArmOperation(new CacheRuleOperationSource(Client), _cacheRuleClientDiagnostics, Pipeline, _cacheRuleRestClient.CreateUpdateRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryCollection.cs index 8a8882f72870..8f3e0419b26b 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryCollection.cs @@ -72,8 +72,8 @@ public virtual async Task> CreateOrUpdat scope.Start(); try { - var response = await _connectedRegistryRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectedRegistryName, data, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(new ConnectedRegistryOperationSource(Client), _connectedRegistryClientDiagnostics, Pipeline, _connectedRegistryRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectedRegistryName, data).Request, response, OperationFinalStateVia.Location); + var response = await _connectedRegistryRestClient.CreateAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, connectedRegistryName, data, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ConnectedRegistryOperationSource(Client), _connectedRegistryClientDiagnostics, Pipeline, _connectedRegistryRestClient.CreateCreateRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, connectedRegistryName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -105,8 +105,8 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil scope.Start(); try { - var response = _connectedRegistryRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectedRegistryName, data, cancellationToken); - var operation = new ContainerRegistryArmOperation(new ConnectedRegistryOperationSource(Client), _connectedRegistryClientDiagnostics, Pipeline, _connectedRegistryRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectedRegistryName, data).Request, response, OperationFinalStateVia.Location); + var response = _connectedRegistryRestClient.Create(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, connectedRegistryName, data, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ConnectedRegistryOperationSource(Client), _connectedRegistryClientDiagnostics, Pipeline, _connectedRegistryRestClient.CreateCreateRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, connectedRegistryName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -135,7 +135,7 @@ public virtual async Task> GetAsync(string c scope.Start(); try { - var response = await _connectedRegistryRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectedRegistryName, cancellationToken).ConfigureAwait(false); + var response = await _connectedRegistryRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, connectedRegistryName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ConnectedRegistryResource(Client, response.Value), response.GetRawResponse()); @@ -164,7 +164,7 @@ public virtual Response Get(string connectedRegistryN scope.Start(); try { - var response = _connectedRegistryRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectedRegistryName, cancellationToken); + var response = _connectedRegistryRestClient.Get(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, connectedRegistryName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ConnectedRegistryResource(Client, response.Value), response.GetRawResponse()); @@ -186,8 +186,8 @@ public virtual Response Get(string connectedRegistryN /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAllAsync(string filter = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _connectedRegistryRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _connectedRegistryRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter); + HttpMessage FirstPageRequest(int? pageSizeHint) => _connectedRegistryRestClient.CreateListRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, filter); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _connectedRegistryRestClient.CreateListNextPageRequest(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, filter); return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ConnectedRegistryResource(Client, ConnectedRegistryData.DeserializeConnectedRegistryData(e)), _connectedRegistryClientDiagnostics, Pipeline, "ConnectedRegistryCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -201,8 +201,8 @@ public virtual AsyncPageable GetAllAsync(string filte /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAll(string filter = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _connectedRegistryRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _connectedRegistryRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter); + HttpMessage FirstPageRequest(int? pageSizeHint) => _connectedRegistryRestClient.CreateListRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, filter); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _connectedRegistryRestClient.CreateListNextPageRequest(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, filter); return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ConnectedRegistryResource(Client, ConnectedRegistryData.DeserializeConnectedRegistryData(e)), _connectedRegistryClientDiagnostics, Pipeline, "ConnectedRegistryCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -223,7 +223,7 @@ public virtual async Task> ExistsAsync(string connectedRegistryNa scope.Start(); try { - var response = await _connectedRegistryRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectedRegistryName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _connectedRegistryRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, connectedRegistryName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -250,7 +250,7 @@ public virtual Response Exists(string connectedRegistryName, CancellationT scope.Start(); try { - var response = _connectedRegistryRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectedRegistryName, cancellationToken: cancellationToken); + var response = _connectedRegistryRestClient.Get(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, connectedRegistryName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryResource.cs index 93098df89ab0..7e965a081ea2 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryResource.cs @@ -26,7 +26,7 @@ namespace Azure.ResourceManager.ContainerRegistry public partial class ConnectedRegistryResource : ArmResource { /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName) + public static ResourceIdentifier CreateResourceIdentifier(Guid subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName) { var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName}"; return new ResourceIdentifier(resourceId); @@ -99,7 +99,7 @@ public virtual async Task> GetAsync(Cancella scope.Start(); try { - var response = await _connectedRegistryRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _connectedRegistryRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ConnectedRegistryResource(Client, response.Value), response.GetRawResponse()); @@ -123,7 +123,7 @@ public virtual Response Get(CancellationToken cancell scope.Start(); try { - var response = _connectedRegistryRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var response = _connectedRegistryRestClient.Get(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ConnectedRegistryResource(Client, response.Value), response.GetRawResponse()); @@ -148,8 +148,8 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell scope.Start(); try { - var response = await _connectedRegistryRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(_connectedRegistryClientDiagnostics, Pipeline, _connectedRegistryRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _connectedRegistryRestClient.DeleteAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(_connectedRegistryClientDiagnostics, Pipeline, _connectedRegistryRestClient.CreateDeleteRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -174,8 +174,8 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel scope.Start(); try { - var response = _connectedRegistryRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new ContainerRegistryArmOperation(_connectedRegistryClientDiagnostics, Pipeline, _connectedRegistryRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _connectedRegistryRestClient.Delete(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new ContainerRegistryArmOperation(_connectedRegistryClientDiagnostics, Pipeline, _connectedRegistryRestClient.CreateDeleteRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -204,8 +204,8 @@ public virtual async Task> UpdateAsync(W scope.Start(); try { - var response = await _connectedRegistryRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(new ConnectedRegistryOperationSource(Client), _connectedRegistryClientDiagnostics, Pipeline, _connectedRegistryRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + var response = await _connectedRegistryRestClient.UpdateAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ConnectedRegistryOperationSource(Client), _connectedRegistryClientDiagnostics, Pipeline, _connectedRegistryRestClient.CreateUpdateRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -234,8 +234,8 @@ public virtual ArmOperation Update(WaitUntil waitUnti scope.Start(); try { - var response = _connectedRegistryRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken); - var operation = new ContainerRegistryArmOperation(new ConnectedRegistryOperationSource(Client), _connectedRegistryClientDiagnostics, Pipeline, _connectedRegistryRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + var response = _connectedRegistryRestClient.Update(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ConnectedRegistryOperationSource(Client), _connectedRegistryClientDiagnostics, Pipeline, _connectedRegistryRestClient.CreateUpdateRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -260,8 +260,8 @@ public virtual async Task DeactivateAsync(WaitUntil waitUntil, Can scope.Start(); try { - var response = await _connectedRegistryRestClient.DeactivateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(_connectedRegistryClientDiagnostics, Pipeline, _connectedRegistryRestClient.CreateDeactivateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _connectedRegistryRestClient.DeactivateAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(_connectedRegistryClientDiagnostics, Pipeline, _connectedRegistryRestClient.CreateDeactivateRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -286,8 +286,8 @@ public virtual ArmOperation Deactivate(WaitUntil waitUntil, CancellationToken ca scope.Start(); try { - var response = _connectedRegistryRestClient.Deactivate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new ContainerRegistryArmOperation(_connectedRegistryClientDiagnostics, Pipeline, _connectedRegistryRestClient.CreateDeactivateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _connectedRegistryRestClient.Deactivate(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new ContainerRegistryArmOperation(_connectedRegistryClientDiagnostics, Pipeline, _connectedRegistryRestClient.CreateDeactivateRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryAgentPoolCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryAgentPoolCollection.cs index 5bfc1ac960b4..d2728b195c2f 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryAgentPoolCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryAgentPoolCollection.cs @@ -72,8 +72,8 @@ public virtual async Task> Crea scope.Start(); try { - var response = await _containerRegistryAgentPoolAgentPoolsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, data, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryAgentPoolOperationSource(Client), _containerRegistryAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerRegistryAgentPoolAgentPoolsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, data).Request, response, OperationFinalStateVia.Location); + var response = await _containerRegistryAgentPoolAgentPoolsRestClient.CreateAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, agentPoolName, data, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryAgentPoolOperationSource(Client), _containerRegistryAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerRegistryAgentPoolAgentPoolsRestClient.CreateCreateRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, agentPoolName, data).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -105,8 +105,8 @@ public virtual ArmOperation CreateOrUpdate(W scope.Start(); try { - var response = _containerRegistryAgentPoolAgentPoolsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, data, cancellationToken); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryAgentPoolOperationSource(Client), _containerRegistryAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerRegistryAgentPoolAgentPoolsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, data).Request, response, OperationFinalStateVia.Location); + var response = _containerRegistryAgentPoolAgentPoolsRestClient.Create(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, agentPoolName, data, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryAgentPoolOperationSource(Client), _containerRegistryAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerRegistryAgentPoolAgentPoolsRestClient.CreateCreateRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, agentPoolName, data).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -135,7 +135,7 @@ public virtual async Task> GetAsync scope.Start(); try { - var response = await _containerRegistryAgentPoolAgentPoolsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryAgentPoolAgentPoolsRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, agentPoolName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ContainerRegistryAgentPoolResource(Client, response.Value), response.GetRawResponse()); @@ -164,7 +164,7 @@ public virtual Response Get(string agentPool scope.Start(); try { - var response = _containerRegistryAgentPoolAgentPoolsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, cancellationToken); + var response = _containerRegistryAgentPoolAgentPoolsRestClient.Get(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, agentPoolName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ContainerRegistryAgentPoolResource(Client, response.Value), response.GetRawResponse()); @@ -185,8 +185,8 @@ public virtual Response Get(string agentPool /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryAgentPoolAgentPoolsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryAgentPoolAgentPoolsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryAgentPoolAgentPoolsRestClient.CreateListRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryAgentPoolAgentPoolsRestClient.CreateListNextPageRequest(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryAgentPoolResource(Client, ContainerRegistryAgentPoolData.DeserializeContainerRegistryAgentPoolData(e)), _containerRegistryAgentPoolAgentPoolsClientDiagnostics, Pipeline, "ContainerRegistryAgentPoolCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -199,8 +199,8 @@ public virtual AsyncPageable GetAllAsync(Can /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryAgentPoolAgentPoolsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryAgentPoolAgentPoolsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryAgentPoolAgentPoolsRestClient.CreateListRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryAgentPoolAgentPoolsRestClient.CreateListNextPageRequest(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryAgentPoolResource(Client, ContainerRegistryAgentPoolData.DeserializeContainerRegistryAgentPoolData(e)), _containerRegistryAgentPoolAgentPoolsClientDiagnostics, Pipeline, "ContainerRegistryAgentPoolCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -221,7 +221,7 @@ public virtual async Task> ExistsAsync(string agentPoolName, Canc scope.Start(); try { - var response = await _containerRegistryAgentPoolAgentPoolsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryAgentPoolAgentPoolsRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, agentPoolName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -248,7 +248,7 @@ public virtual Response Exists(string agentPoolName, CancellationToken can scope.Start(); try { - var response = _containerRegistryAgentPoolAgentPoolsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, cancellationToken: cancellationToken); + var response = _containerRegistryAgentPoolAgentPoolsRestClient.Get(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, agentPoolName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryAgentPoolResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryAgentPoolResource.cs index 031d1a70dd0a..798917a422df 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryAgentPoolResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryAgentPoolResource.cs @@ -27,7 +27,7 @@ namespace Azure.ResourceManager.ContainerRegistry public partial class ContainerRegistryAgentPoolResource : ArmResource { /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string agentPoolName) + public static ResourceIdentifier CreateResourceIdentifier(Guid subscriptionId, string resourceGroupName, string registryName, string agentPoolName) { var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}"; return new ResourceIdentifier(resourceId); @@ -100,7 +100,7 @@ public virtual async Task> GetAsync scope.Start(); try { - var response = await _containerRegistryAgentPoolAgentPoolsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryAgentPoolAgentPoolsRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ContainerRegistryAgentPoolResource(Client, response.Value), response.GetRawResponse()); @@ -124,7 +124,7 @@ public virtual Response Get(CancellationToke scope.Start(); try { - var response = _containerRegistryAgentPoolAgentPoolsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var response = _containerRegistryAgentPoolAgentPoolsRestClient.Get(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ContainerRegistryAgentPoolResource(Client, response.Value), response.GetRawResponse()); @@ -149,8 +149,8 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell scope.Start(); try { - var response = await _containerRegistryAgentPoolAgentPoolsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(_containerRegistryAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerRegistryAgentPoolAgentPoolsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _containerRegistryAgentPoolAgentPoolsRestClient.DeleteAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(_containerRegistryAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerRegistryAgentPoolAgentPoolsRestClient.CreateDeleteRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -175,8 +175,8 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel scope.Start(); try { - var response = _containerRegistryAgentPoolAgentPoolsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new ContainerRegistryArmOperation(_containerRegistryAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerRegistryAgentPoolAgentPoolsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _containerRegistryAgentPoolAgentPoolsRestClient.Delete(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new ContainerRegistryArmOperation(_containerRegistryAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerRegistryAgentPoolAgentPoolsRestClient.CreateDeleteRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -205,8 +205,8 @@ public virtual async Task> Upda scope.Start(); try { - var response = await _containerRegistryAgentPoolAgentPoolsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryAgentPoolOperationSource(Client), _containerRegistryAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerRegistryAgentPoolAgentPoolsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + var response = await _containerRegistryAgentPoolAgentPoolsRestClient.UpdateAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryAgentPoolOperationSource(Client), _containerRegistryAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerRegistryAgentPoolAgentPoolsRestClient.CreateUpdateRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -235,8 +235,8 @@ public virtual ArmOperation Update(WaitUntil scope.Start(); try { - var response = _containerRegistryAgentPoolAgentPoolsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryAgentPoolOperationSource(Client), _containerRegistryAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerRegistryAgentPoolAgentPoolsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + var response = _containerRegistryAgentPoolAgentPoolsRestClient.Update(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryAgentPoolOperationSource(Client), _containerRegistryAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerRegistryAgentPoolAgentPoolsRestClient.CreateUpdateRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -260,7 +260,7 @@ public virtual async Task> GetQu scope.Start(); try { - var response = await _containerRegistryAgentPoolAgentPoolsRestClient.GetQueueStatusAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryAgentPoolAgentPoolsRestClient.GetQueueStatusAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); return response; } catch (Exception e) @@ -282,7 +282,7 @@ public virtual Response GetQueueStatus(Ca scope.Start(); try { - var response = _containerRegistryAgentPoolAgentPoolsRestClient.GetQueueStatus(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var response = _containerRegistryAgentPoolAgentPoolsRestClient.GetQueueStatus(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); return response; } catch (Exception e) @@ -315,7 +315,7 @@ public virtual async Task> AddTagAs var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues[key] = value; await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _containerRegistryAgentPoolAgentPoolsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var originalResponse = await _containerRegistryAgentPoolAgentPoolsRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); return Response.FromValue(new ContainerRegistryAgentPoolResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else @@ -361,7 +361,7 @@ public virtual Response AddTag(string key, s var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues[key] = value; GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _containerRegistryAgentPoolAgentPoolsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var originalResponse = _containerRegistryAgentPoolAgentPoolsRestClient.Get(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); return Response.FromValue(new ContainerRegistryAgentPoolResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else @@ -406,7 +406,7 @@ public virtual async Task> SetTagsA var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.ReplaceWith(tags); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _containerRegistryAgentPoolAgentPoolsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var originalResponse = await _containerRegistryAgentPoolAgentPoolsRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); return Response.FromValue(new ContainerRegistryAgentPoolResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else @@ -447,7 +447,7 @@ public virtual Response SetTags(IDictionary< var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues.ReplaceWith(tags); GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _containerRegistryAgentPoolAgentPoolsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var originalResponse = _containerRegistryAgentPoolAgentPoolsRestClient.Get(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); return Response.FromValue(new ContainerRegistryAgentPoolResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else @@ -487,7 +487,7 @@ public virtual async Task> RemoveTa var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.Remove(key); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _containerRegistryAgentPoolAgentPoolsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var originalResponse = await _containerRegistryAgentPoolAgentPoolsRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); return Response.FromValue(new ContainerRegistryAgentPoolResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else @@ -531,7 +531,7 @@ public virtual Response RemoveTag(string key var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues.Remove(key); GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _containerRegistryAgentPoolAgentPoolsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var originalResponse = _containerRegistryAgentPoolAgentPoolsRestClient.Get(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); return Response.FromValue(new ContainerRegistryAgentPoolResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCollection.cs index 991cabd8bcb4..98b724079139 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCollection.cs @@ -21,13 +21,15 @@ namespace Azure.ResourceManager.ContainerRegistry { /// /// 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 GetContainerRegistries method from an instance of . + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetContainerRegistries method from an instance of . /// public partial class ContainerRegistryCollection : ArmCollection, IEnumerable, IAsyncEnumerable { private readonly ClientDiagnostics _containerRegistryRegistriesClientDiagnostics; private readonly RegistriesRestOperations _containerRegistryRegistriesRestClient; + private readonly Guid _subscriptionId; + private readonly string _resourceGroupName; /// Initializes a new instance of the class for mocking. protected ContainerRegistryCollection() @@ -37,8 +39,14 @@ protected ContainerRegistryCollection() /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The identifier of the parent resource that is the target of operations. - internal ContainerRegistryCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// is null. + /// is an empty string, and was expected to be non-empty. + internal ContainerRegistryCollection(ArmClient client, ResourceIdentifier id, Guid subscriptionId, string resourceGroupName) : base(client, id) { + _subscriptionId = subscriptionId; + _resourceGroupName = resourceGroupName; _containerRegistryRegistriesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerRegistry", ContainerRegistryResource.ResourceType.Namespace, Diagnostics); TryGetApiVersion(ContainerRegistryResource.ResourceType, out string containerRegistryRegistriesApiVersion); _containerRegistryRegistriesRestClient = new RegistriesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerRegistryRegistriesApiVersion); @@ -49,8 +57,8 @@ internal ContainerRegistryCollection(ArmClient client, ResourceIdentifier id) : internal static void ValidateResourceId(ResourceIdentifier id) { - if (id.ResourceType != ResourceGroupResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); + if (id.ResourceType != TenantResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, TenantResource.ResourceType), nameof(id)); } /// @@ -73,8 +81,8 @@ public virtual async Task> CreateOrUpdat scope.Start(); try { - var response = await _containerRegistryRegistriesRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, registryName, data, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryOperationSource(Client), _containerRegistryRegistriesClientDiagnostics, Pipeline, _containerRegistryRegistriesRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, registryName, data).Request, response, OperationFinalStateVia.Location); + var response = await _containerRegistryRegistriesRestClient.CreateAsync(Guid.Parse(_subscriptionId), _resourceGroupName, registryName, data, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryOperationSource(Client), _containerRegistryRegistriesClientDiagnostics, Pipeline, _containerRegistryRegistriesRestClient.CreateCreateRequest(Guid.Parse(_subscriptionId), _resourceGroupName, registryName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -106,8 +114,8 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil scope.Start(); try { - var response = _containerRegistryRegistriesRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, registryName, data, cancellationToken); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryOperationSource(Client), _containerRegistryRegistriesClientDiagnostics, Pipeline, _containerRegistryRegistriesRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, registryName, data).Request, response, OperationFinalStateVia.Location); + var response = _containerRegistryRegistriesRestClient.Create(Guid.Parse(_subscriptionId), _resourceGroupName, registryName, data, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryOperationSource(Client), _containerRegistryRegistriesClientDiagnostics, Pipeline, _containerRegistryRegistriesRestClient.CreateCreateRequest(Guid.Parse(_subscriptionId), _resourceGroupName, registryName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -136,7 +144,7 @@ public virtual async Task> GetAsync(string r scope.Start(); try { - var response = await _containerRegistryRegistriesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, registryName, cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryRegistriesRestClient.GetAsync(Guid.Parse(_subscriptionId), _resourceGroupName, registryName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ContainerRegistryResource(Client, response.Value), response.GetRawResponse()); @@ -165,7 +173,7 @@ public virtual Response Get(string registryName, Canc scope.Start(); try { - var response = _containerRegistryRegistriesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, registryName, cancellationToken); + var response = _containerRegistryRegistriesRestClient.Get(Guid.Parse(_subscriptionId), _resourceGroupName, registryName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ContainerRegistryResource(Client, response.Value), response.GetRawResponse()); @@ -186,8 +194,8 @@ public virtual Response Get(string registryName, Canc /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryRegistriesRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryRegistriesRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryRegistriesRestClient.CreateListByResourceGroupRequest(Guid.Parse(_subscriptionId), _resourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryRegistriesRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Guid.Parse(_subscriptionId), _resourceGroupName); return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryResource(Client, ContainerRegistryData.DeserializeContainerRegistryData(e)), _containerRegistryRegistriesClientDiagnostics, Pipeline, "ContainerRegistryCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -200,8 +208,8 @@ public virtual AsyncPageable GetAllAsync(Cancellation /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryRegistriesRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryRegistriesRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryRegistriesRestClient.CreateListByResourceGroupRequest(Guid.Parse(_subscriptionId), _resourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryRegistriesRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Guid.Parse(_subscriptionId), _resourceGroupName); return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryResource(Client, ContainerRegistryData.DeserializeContainerRegistryData(e)), _containerRegistryRegistriesClientDiagnostics, Pipeline, "ContainerRegistryCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -222,7 +230,7 @@ public virtual async Task> ExistsAsync(string registryName, Cance scope.Start(); try { - var response = await _containerRegistryRegistriesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, registryName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryRegistriesRestClient.GetAsync(Guid.Parse(_subscriptionId), _resourceGroupName, registryName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -249,7 +257,7 @@ public virtual Response Exists(string registryName, CancellationToken canc scope.Start(); try { - var response = _containerRegistryRegistriesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, registryName, cancellationToken: cancellationToken); + var response = _containerRegistryRegistriesRestClient.Get(Guid.Parse(_subscriptionId), _resourceGroupName, registryName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunCollection.cs index e9f3e0fa682b..5b532272809b 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunCollection.cs @@ -72,8 +72,8 @@ public virtual async Task> Cr scope.Start(); try { - var response = await _containerRegistryPipelineRunPipelineRunsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pipelineRunName, data, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryPipelineRunOperationSource(Client), _containerRegistryPipelineRunPipelineRunsClientDiagnostics, Pipeline, _containerRegistryPipelineRunPipelineRunsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pipelineRunName, data).Request, response, OperationFinalStateVia.Location); + var response = await _containerRegistryPipelineRunPipelineRunsRestClient.CreateAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, pipelineRunName, data, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryPipelineRunOperationSource(Client), _containerRegistryPipelineRunPipelineRunsClientDiagnostics, Pipeline, _containerRegistryPipelineRunPipelineRunsRestClient.CreateCreateRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, pipelineRunName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -105,8 +105,8 @@ public virtual ArmOperation CreateOrUpdate scope.Start(); try { - var response = _containerRegistryPipelineRunPipelineRunsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pipelineRunName, data, cancellationToken); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryPipelineRunOperationSource(Client), _containerRegistryPipelineRunPipelineRunsClientDiagnostics, Pipeline, _containerRegistryPipelineRunPipelineRunsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pipelineRunName, data).Request, response, OperationFinalStateVia.Location); + var response = _containerRegistryPipelineRunPipelineRunsRestClient.Create(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, pipelineRunName, data, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryPipelineRunOperationSource(Client), _containerRegistryPipelineRunPipelineRunsClientDiagnostics, Pipeline, _containerRegistryPipelineRunPipelineRunsRestClient.CreateCreateRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, pipelineRunName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -135,7 +135,7 @@ public virtual async Task> GetAsy scope.Start(); try { - var response = await _containerRegistryPipelineRunPipelineRunsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pipelineRunName, cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryPipelineRunPipelineRunsRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, pipelineRunName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ContainerRegistryPipelineRunResource(Client, response.Value), response.GetRawResponse()); @@ -164,7 +164,7 @@ public virtual Response Get(string pipelin scope.Start(); try { - var response = _containerRegistryPipelineRunPipelineRunsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pipelineRunName, cancellationToken); + var response = _containerRegistryPipelineRunPipelineRunsRestClient.Get(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, pipelineRunName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ContainerRegistryPipelineRunResource(Client, response.Value), response.GetRawResponse()); @@ -185,8 +185,8 @@ public virtual Response Get(string pipelin /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryPipelineRunPipelineRunsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryPipelineRunPipelineRunsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryPipelineRunPipelineRunsRestClient.CreateListRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryPipelineRunPipelineRunsRestClient.CreateListNextPageRequest(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryPipelineRunResource(Client, ContainerRegistryPipelineRunData.DeserializeContainerRegistryPipelineRunData(e)), _containerRegistryPipelineRunPipelineRunsClientDiagnostics, Pipeline, "ContainerRegistryPipelineRunCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -199,8 +199,8 @@ public virtual AsyncPageable GetAllAsync(C /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryPipelineRunPipelineRunsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryPipelineRunPipelineRunsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryPipelineRunPipelineRunsRestClient.CreateListRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryPipelineRunPipelineRunsRestClient.CreateListNextPageRequest(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryPipelineRunResource(Client, ContainerRegistryPipelineRunData.DeserializeContainerRegistryPipelineRunData(e)), _containerRegistryPipelineRunPipelineRunsClientDiagnostics, Pipeline, "ContainerRegistryPipelineRunCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -221,7 +221,7 @@ public virtual async Task> ExistsAsync(string pipelineRunName, Ca scope.Start(); try { - var response = await _containerRegistryPipelineRunPipelineRunsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pipelineRunName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryPipelineRunPipelineRunsRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, pipelineRunName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -248,7 +248,7 @@ public virtual Response Exists(string pipelineRunName, CancellationToken c scope.Start(); try { - var response = _containerRegistryPipelineRunPipelineRunsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pipelineRunName, cancellationToken: cancellationToken); + var response = _containerRegistryPipelineRunPipelineRunsRestClient.Get(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, pipelineRunName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunResource.cs index eb92233428e8..6fa6f1947aaf 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunResource.cs @@ -25,7 +25,7 @@ namespace Azure.ResourceManager.ContainerRegistry public partial class ContainerRegistryPipelineRunResource : ArmResource { /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string pipelineRunName) + public static ResourceIdentifier CreateResourceIdentifier(Guid subscriptionId, string resourceGroupName, string registryName, string pipelineRunName) { var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName}"; return new ResourceIdentifier(resourceId); @@ -98,7 +98,7 @@ public virtual async Task> GetAsy scope.Start(); try { - var response = await _containerRegistryPipelineRunPipelineRunsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryPipelineRunPipelineRunsRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ContainerRegistryPipelineRunResource(Client, response.Value), response.GetRawResponse()); @@ -122,7 +122,7 @@ public virtual Response Get(CancellationTo scope.Start(); try { - var response = _containerRegistryPipelineRunPipelineRunsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var response = _containerRegistryPipelineRunPipelineRunsRestClient.Get(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ContainerRegistryPipelineRunResource(Client, response.Value), response.GetRawResponse()); @@ -147,8 +147,8 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell scope.Start(); try { - var response = await _containerRegistryPipelineRunPipelineRunsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(_containerRegistryPipelineRunPipelineRunsClientDiagnostics, Pipeline, _containerRegistryPipelineRunPipelineRunsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _containerRegistryPipelineRunPipelineRunsRestClient.DeleteAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(_containerRegistryPipelineRunPipelineRunsClientDiagnostics, Pipeline, _containerRegistryPipelineRunPipelineRunsRestClient.CreateDeleteRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -173,8 +173,8 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel scope.Start(); try { - var response = _containerRegistryPipelineRunPipelineRunsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new ContainerRegistryArmOperation(_containerRegistryPipelineRunPipelineRunsClientDiagnostics, Pipeline, _containerRegistryPipelineRunPipelineRunsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _containerRegistryPipelineRunPipelineRunsRestClient.Delete(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new ContainerRegistryArmOperation(_containerRegistryPipelineRunPipelineRunsClientDiagnostics, Pipeline, _containerRegistryPipelineRunPipelineRunsRestClient.CreateDeleteRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -203,8 +203,8 @@ public virtual async Task> Up scope.Start(); try { - var response = await _containerRegistryPipelineRunPipelineRunsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryPipelineRunOperationSource(Client), _containerRegistryPipelineRunPipelineRunsClientDiagnostics, Pipeline, _containerRegistryPipelineRunPipelineRunsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + var response = await _containerRegistryPipelineRunPipelineRunsRestClient.CreateAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryPipelineRunOperationSource(Client), _containerRegistryPipelineRunPipelineRunsClientDiagnostics, Pipeline, _containerRegistryPipelineRunPipelineRunsRestClient.CreateCreateRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -233,8 +233,8 @@ public virtual ArmOperation Update(WaitUnt scope.Start(); try { - var response = _containerRegistryPipelineRunPipelineRunsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryPipelineRunOperationSource(Client), _containerRegistryPipelineRunPipelineRunsClientDiagnostics, Pipeline, _containerRegistryPipelineRunPipelineRunsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + var response = _containerRegistryPipelineRunPipelineRunsRestClient.Create(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryPipelineRunOperationSource(Client), _containerRegistryPipelineRunPipelineRunsClientDiagnostics, Pipeline, _containerRegistryPipelineRunPipelineRunsRestClient.CreateCreateRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateEndpointConnectionCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateEndpointConnectionCollection.cs index 13efe9905481..9efa13b5c37b 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateEndpointConnectionCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateEndpointConnectionCollection.cs @@ -72,8 +72,8 @@ public virtual async Task(new ContainerRegistryPrivateEndpointConnectionOperationSource(Client), _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, data).Request, response, OperationFinalStateVia.Location); + var response = await _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateOrUpdateAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, privateEndpointConnectionName, data, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryPrivateEndpointConnectionOperationSource(Client), _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateCreateOrUpdateRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, privateEndpointConnectionName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -105,8 +105,8 @@ public virtual ArmOperation scope.Start(); try { - var response = _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, data, cancellationToken); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryPrivateEndpointConnectionOperationSource(Client), _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, data).Request, response, OperationFinalStateVia.Location); + var response = _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateOrUpdate(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, privateEndpointConnectionName, data, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryPrivateEndpointConnectionOperationSource(Client), _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateCreateOrUpdateRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, privateEndpointConnectionName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -135,7 +135,7 @@ public virtual async Task Get( scope.Start(); try { - var response = _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken); + var response = _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Get(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, privateEndpointConnectionName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ContainerRegistryPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); @@ -185,8 +185,8 @@ public virtual Response Get( /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateListRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateListNextPageRequest(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryPrivateEndpointConnectionResource(Client, ContainerRegistryPrivateEndpointConnectionData.DeserializeContainerRegistryPrivateEndpointConnectionData(e)), _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, "ContainerRegistryPrivateEndpointConnectionCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -199,8 +199,8 @@ public virtual AsyncPageable /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateListRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateListNextPageRequest(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryPrivateEndpointConnectionResource(Client, ContainerRegistryPrivateEndpointConnectionData.DeserializeContainerRegistryPrivateEndpointConnectionData(e)), _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, "ContainerRegistryPrivateEndpointConnectionCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -221,7 +221,7 @@ public virtual async Task> ExistsAsync(string privateEndpointConn scope.Start(); try { - var response = await _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, privateEndpointConnectionName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -248,7 +248,7 @@ public virtual Response Exists(string privateEndpointConnectionName, Cance scope.Start(); try { - var response = _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken: cancellationToken); + var response = _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Get(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, privateEndpointConnectionName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateEndpointConnectionResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateEndpointConnectionResource.cs index aaa2ad39c98e..682ff92ed418 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateEndpointConnectionResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateEndpointConnectionResource.cs @@ -25,7 +25,7 @@ namespace Azure.ResourceManager.ContainerRegistry public partial class ContainerRegistryPrivateEndpointConnectionResource : ArmResource { /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string privateEndpointConnectionName) + public static ResourceIdentifier CreateResourceIdentifier(Guid subscriptionId, string resourceGroupName, string registryName, string privateEndpointConnectionName) { var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/privateEndpointConnections/{privateEndpointConnectionName}"; return new ResourceIdentifier(resourceId); @@ -98,7 +98,7 @@ public virtual async Task Get( scope.Start(); try { - var response = _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var response = _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Get(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ContainerRegistryPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); @@ -147,8 +147,8 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell scope.Start(); try { - var response = await _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(_containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.DeleteAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(_containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateDeleteRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -173,8 +173,8 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel scope.Start(); try { - var response = _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new ContainerRegistryArmOperation(_containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Delete(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new ContainerRegistryArmOperation(_containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateDeleteRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -203,8 +203,8 @@ public virtual async Task(new ContainerRegistryPrivateEndpointConnectionOperationSource(Client), _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + var response = await _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateOrUpdateAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryPrivateEndpointConnectionOperationSource(Client), _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateCreateOrUpdateRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -233,8 +233,8 @@ public virtual ArmOperation scope.Start(); try { - var response = _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryPrivateEndpointConnectionOperationSource(Client), _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + var response = _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateOrUpdate(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryPrivateEndpointConnectionOperationSource(Client), _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateCreateOrUpdateRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateLinkResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateLinkResource.cs index ca56a7cc7fa7..7fb0bfb14407 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateLinkResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateLinkResource.cs @@ -25,7 +25,7 @@ namespace Azure.ResourceManager.ContainerRegistry public partial class ContainerRegistryPrivateLinkResource : ArmResource { /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string groupName) + public static ResourceIdentifier CreateResourceIdentifier(Guid subscriptionId, string resourceGroupName, string registryName, string groupName) { var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/privateLinkResources/{groupName}"; return new ResourceIdentifier(resourceId); @@ -98,7 +98,7 @@ public virtual async Task> GetAsy scope.Start(); try { - var response = await _containerRegistryPrivateLinkResourceRegistriesRestClient.GetPrivateLinkResourceAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryPrivateLinkResourceRegistriesRestClient.GetPrivateLinkResourceAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ContainerRegistryPrivateLinkResource(Client, response.Value), response.GetRawResponse()); @@ -122,7 +122,7 @@ public virtual Response Get(CancellationTo scope.Start(); try { - var response = _containerRegistryPrivateLinkResourceRegistriesRestClient.GetPrivateLinkResource(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var response = _containerRegistryPrivateLinkResourceRegistriesRestClient.GetPrivateLinkResource(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ContainerRegistryPrivateLinkResource(Client, response.Value), response.GetRawResponse()); diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateLinkResourceCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateLinkResourceCollection.cs index 518ff5bdd8c4..199b7fa54891 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateLinkResourceCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateLinkResourceCollection.cs @@ -69,7 +69,7 @@ public virtual async Task> GetAsy scope.Start(); try { - var response = await _containerRegistryPrivateLinkResourceRegistriesRestClient.GetPrivateLinkResourceAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, groupName, cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryPrivateLinkResourceRegistriesRestClient.GetPrivateLinkResourceAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, groupName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ContainerRegistryPrivateLinkResource(Client, response.Value), response.GetRawResponse()); @@ -98,7 +98,7 @@ public virtual Response Get(string groupNa scope.Start(); try { - var response = _containerRegistryPrivateLinkResourceRegistriesRestClient.GetPrivateLinkResource(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, groupName, cancellationToken); + var response = _containerRegistryPrivateLinkResourceRegistriesRestClient.GetPrivateLinkResource(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, groupName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ContainerRegistryPrivateLinkResource(Client, response.Value), response.GetRawResponse()); @@ -119,8 +119,8 @@ public virtual Response Get(string groupNa /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryPrivateLinkResourceRegistriesRestClient.CreateListPrivateLinkResourcesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryPrivateLinkResourceRegistriesRestClient.CreateListPrivateLinkResourcesNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryPrivateLinkResourceRegistriesRestClient.CreateListPrivateLinkResourcesRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryPrivateLinkResourceRegistriesRestClient.CreateListPrivateLinkResourcesNextPageRequest(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryPrivateLinkResource(Client, ContainerRegistryPrivateLinkResourceData.DeserializeContainerRegistryPrivateLinkResourceData(e)), _containerRegistryPrivateLinkResourceRegistriesClientDiagnostics, Pipeline, "ContainerRegistryPrivateLinkResourceCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -133,8 +133,8 @@ public virtual AsyncPageable GetAllAsync(C /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryPrivateLinkResourceRegistriesRestClient.CreateListPrivateLinkResourcesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryPrivateLinkResourceRegistriesRestClient.CreateListPrivateLinkResourcesNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryPrivateLinkResourceRegistriesRestClient.CreateListPrivateLinkResourcesRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryPrivateLinkResourceRegistriesRestClient.CreateListPrivateLinkResourcesNextPageRequest(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryPrivateLinkResource(Client, ContainerRegistryPrivateLinkResourceData.DeserializeContainerRegistryPrivateLinkResourceData(e)), _containerRegistryPrivateLinkResourceRegistriesClientDiagnostics, Pipeline, "ContainerRegistryPrivateLinkResourceCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -155,7 +155,7 @@ public virtual async Task> ExistsAsync(string groupName, Cancella scope.Start(); try { - var response = await _containerRegistryPrivateLinkResourceRegistriesRestClient.GetPrivateLinkResourceAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, groupName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryPrivateLinkResourceRegistriesRestClient.GetPrivateLinkResourceAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, groupName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -182,7 +182,7 @@ public virtual Response Exists(string groupName, CancellationToken cancell scope.Start(); try { - var response = _containerRegistryPrivateLinkResourceRegistriesRestClient.GetPrivateLinkResource(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, groupName, cancellationToken: cancellationToken); + var response = _containerRegistryPrivateLinkResourceRegistriesRestClient.GetPrivateLinkResource(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, groupName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryReplicationCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryReplicationCollection.cs index a38e2b00cf40..79638e94b5a6 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryReplicationCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryReplicationCollection.cs @@ -72,8 +72,8 @@ public virtual async Task> Cr scope.Start(); try { - var response = await _containerRegistryReplicationReplicationsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicationName, data, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryReplicationOperationSource(Client), _containerRegistryReplicationReplicationsClientDiagnostics, Pipeline, _containerRegistryReplicationReplicationsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicationName, data).Request, response, OperationFinalStateVia.Location); + var response = await _containerRegistryReplicationReplicationsRestClient.CreateAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, replicationName, data, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryReplicationOperationSource(Client), _containerRegistryReplicationReplicationsClientDiagnostics, Pipeline, _containerRegistryReplicationReplicationsRestClient.CreateCreateRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, replicationName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -105,8 +105,8 @@ public virtual ArmOperation CreateOrUpdate scope.Start(); try { - var response = _containerRegistryReplicationReplicationsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicationName, data, cancellationToken); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryReplicationOperationSource(Client), _containerRegistryReplicationReplicationsClientDiagnostics, Pipeline, _containerRegistryReplicationReplicationsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicationName, data).Request, response, OperationFinalStateVia.Location); + var response = _containerRegistryReplicationReplicationsRestClient.Create(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, replicationName, data, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryReplicationOperationSource(Client), _containerRegistryReplicationReplicationsClientDiagnostics, Pipeline, _containerRegistryReplicationReplicationsRestClient.CreateCreateRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, replicationName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -135,7 +135,7 @@ public virtual async Task> GetAsy scope.Start(); try { - var response = await _containerRegistryReplicationReplicationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicationName, cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryReplicationReplicationsRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, replicationName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ContainerRegistryReplicationResource(Client, response.Value), response.GetRawResponse()); @@ -164,7 +164,7 @@ public virtual Response Get(string replica scope.Start(); try { - var response = _containerRegistryReplicationReplicationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicationName, cancellationToken); + var response = _containerRegistryReplicationReplicationsRestClient.Get(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, replicationName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ContainerRegistryReplicationResource(Client, response.Value), response.GetRawResponse()); @@ -185,8 +185,8 @@ public virtual Response Get(string replica /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryReplicationReplicationsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryReplicationReplicationsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryReplicationReplicationsRestClient.CreateListRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryReplicationReplicationsRestClient.CreateListNextPageRequest(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryReplicationResource(Client, ContainerRegistryReplicationData.DeserializeContainerRegistryReplicationData(e)), _containerRegistryReplicationReplicationsClientDiagnostics, Pipeline, "ContainerRegistryReplicationCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -199,8 +199,8 @@ public virtual AsyncPageable GetAllAsync(C /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryReplicationReplicationsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryReplicationReplicationsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryReplicationReplicationsRestClient.CreateListRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryReplicationReplicationsRestClient.CreateListNextPageRequest(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryReplicationResource(Client, ContainerRegistryReplicationData.DeserializeContainerRegistryReplicationData(e)), _containerRegistryReplicationReplicationsClientDiagnostics, Pipeline, "ContainerRegistryReplicationCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -221,7 +221,7 @@ public virtual async Task> ExistsAsync(string replicationName, Ca scope.Start(); try { - var response = await _containerRegistryReplicationReplicationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicationName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryReplicationReplicationsRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, replicationName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -248,7 +248,7 @@ public virtual Response Exists(string replicationName, CancellationToken c scope.Start(); try { - var response = _containerRegistryReplicationReplicationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicationName, cancellationToken: cancellationToken); + var response = _containerRegistryReplicationReplicationsRestClient.Get(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, replicationName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryReplicationResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryReplicationResource.cs index 3afe6c68df06..34ac570f553e 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryReplicationResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryReplicationResource.cs @@ -27,7 +27,7 @@ namespace Azure.ResourceManager.ContainerRegistry public partial class ContainerRegistryReplicationResource : ArmResource { /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string replicationName) + public static ResourceIdentifier CreateResourceIdentifier(Guid subscriptionId, string resourceGroupName, string registryName, string replicationName) { var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}"; return new ResourceIdentifier(resourceId); @@ -100,7 +100,7 @@ public virtual async Task> GetAsy scope.Start(); try { - var response = await _containerRegistryReplicationReplicationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryReplicationReplicationsRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ContainerRegistryReplicationResource(Client, response.Value), response.GetRawResponse()); @@ -124,7 +124,7 @@ public virtual Response Get(CancellationTo scope.Start(); try { - var response = _containerRegistryReplicationReplicationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var response = _containerRegistryReplicationReplicationsRestClient.Get(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ContainerRegistryReplicationResource(Client, response.Value), response.GetRawResponse()); @@ -149,8 +149,8 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell scope.Start(); try { - var response = await _containerRegistryReplicationReplicationsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(_containerRegistryReplicationReplicationsClientDiagnostics, Pipeline, _containerRegistryReplicationReplicationsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _containerRegistryReplicationReplicationsRestClient.DeleteAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(_containerRegistryReplicationReplicationsClientDiagnostics, Pipeline, _containerRegistryReplicationReplicationsRestClient.CreateDeleteRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -175,8 +175,8 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel scope.Start(); try { - var response = _containerRegistryReplicationReplicationsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new ContainerRegistryArmOperation(_containerRegistryReplicationReplicationsClientDiagnostics, Pipeline, _containerRegistryReplicationReplicationsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _containerRegistryReplicationReplicationsRestClient.Delete(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new ContainerRegistryArmOperation(_containerRegistryReplicationReplicationsClientDiagnostics, Pipeline, _containerRegistryReplicationReplicationsRestClient.CreateDeleteRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -205,8 +205,8 @@ public virtual async Task> Up scope.Start(); try { - var response = await _containerRegistryReplicationReplicationsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryReplicationOperationSource(Client), _containerRegistryReplicationReplicationsClientDiagnostics, Pipeline, _containerRegistryReplicationReplicationsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + var response = await _containerRegistryReplicationReplicationsRestClient.UpdateAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryReplicationOperationSource(Client), _containerRegistryReplicationReplicationsClientDiagnostics, Pipeline, _containerRegistryReplicationReplicationsRestClient.CreateUpdateRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -235,8 +235,8 @@ public virtual ArmOperation Update(WaitUnt scope.Start(); try { - var response = _containerRegistryReplicationReplicationsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryReplicationOperationSource(Client), _containerRegistryReplicationReplicationsClientDiagnostics, Pipeline, _containerRegistryReplicationReplicationsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + var response = _containerRegistryReplicationReplicationsRestClient.Update(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryReplicationOperationSource(Client), _containerRegistryReplicationReplicationsClientDiagnostics, Pipeline, _containerRegistryReplicationReplicationsRestClient.CreateUpdateRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -271,7 +271,7 @@ public virtual async Task> AddTag var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues[key] = value; await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _containerRegistryReplicationReplicationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var originalResponse = await _containerRegistryReplicationReplicationsRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); return Response.FromValue(new ContainerRegistryReplicationResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else @@ -317,7 +317,7 @@ public virtual Response AddTag(string key, var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues[key] = value; GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _containerRegistryReplicationReplicationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var originalResponse = _containerRegistryReplicationReplicationsRestClient.Get(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); return Response.FromValue(new ContainerRegistryReplicationResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else @@ -362,7 +362,7 @@ public virtual async Task> SetTag var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.ReplaceWith(tags); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _containerRegistryReplicationReplicationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var originalResponse = await _containerRegistryReplicationReplicationsRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); return Response.FromValue(new ContainerRegistryReplicationResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else @@ -403,7 +403,7 @@ public virtual Response SetTags(IDictionar var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues.ReplaceWith(tags); GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _containerRegistryReplicationReplicationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var originalResponse = _containerRegistryReplicationReplicationsRestClient.Get(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); return Response.FromValue(new ContainerRegistryReplicationResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else @@ -443,7 +443,7 @@ public virtual async Task> Remove var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.Remove(key); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _containerRegistryReplicationReplicationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var originalResponse = await _containerRegistryReplicationReplicationsRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); return Response.FromValue(new ContainerRegistryReplicationResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else @@ -487,7 +487,7 @@ public virtual Response RemoveTag(string k var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues.Remove(key); GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _containerRegistryReplicationReplicationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var originalResponse = _containerRegistryReplicationReplicationsRestClient.Get(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); return Response.FromValue(new ContainerRegistryReplicationResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryResource.cs index 8220d5449625..daa93bf89368 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryResource.cs @@ -23,12 +23,12 @@ namespace Azure.ResourceManager.ContainerRegistry /// A Class representing a ContainerRegistry 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 GetContainerRegistryResource method. - /// Otherwise you can get one from its parent resource using the GetContainerRegistry method. + /// Otherwise you can get one from its parent resource using the GetContainerRegistry method. /// public partial class ContainerRegistryResource : ArmResource { /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName) + public static ResourceIdentifier CreateResourceIdentifier(Guid subscriptionId, string resourceGroupName, string registryName) { var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}"; return new ResourceIdentifier(resourceId); @@ -97,6 +97,43 @@ internal static void ValidateResourceId(ResourceIdentifier id) throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); } + /// Gets a collection of CacheRuleResources in the ContainerRegistry. + /// An object representing collection of CacheRuleResources and their operations over a CacheRuleResource. + public virtual CacheRuleCollection GetCacheRules() + { + return GetCachedClient(Client => new CacheRuleCollection(Client, Id)); + } + + /// + /// Gets the properties of the specified cache rule resource. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules/{cacheRuleName} + /// Operation Id: CacheRules_Get + /// + /// The name of the cache rule. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual async Task> GetCacheRuleAsync(string cacheRuleName, CancellationToken cancellationToken = default) + { + return await GetCacheRules().GetAsync(cacheRuleName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the properties of the specified cache rule resource. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules/{cacheRuleName} + /// Operation Id: CacheRules_Get + /// + /// The name of the cache rule. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual Response GetCacheRule(string cacheRuleName, CancellationToken cancellationToken = default) + { + return GetCacheRules().Get(cacheRuleName, cancellationToken); + } + /// Gets a collection of ConnectedRegistryResources in the ContainerRegistry. /// An object representing collection of ConnectedRegistryResources and their operations over a ConnectedRegistryResource. public virtual ConnectedRegistryCollection GetConnectedRegistries() @@ -134,6 +171,43 @@ public virtual Response GetConnectedRegistry(string c return GetConnectedRegistries().Get(connectedRegistryName, cancellationToken); } + /// Gets a collection of CredentialSetResources in the ContainerRegistry. + /// An object representing collection of CredentialSetResources and their operations over a CredentialSetResource. + public virtual CredentialSetCollection GetCredentialSets() + { + return GetCachedClient(Client => new CredentialSetCollection(Client, Id)); + } + + /// + /// Gets the properties of the specified credential set resource. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets/{credentialSetName} + /// Operation Id: CredentialSets_Get + /// + /// The name of the credential set. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual async Task> GetCredentialSetAsync(string credentialSetName, CancellationToken cancellationToken = default) + { + return await GetCredentialSets().GetAsync(credentialSetName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the properties of the specified credential set resource. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets/{credentialSetName} + /// Operation Id: CredentialSets_Get + /// + /// The name of the credential set. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual Response GetCredentialSet(string credentialSetName, CancellationToken cancellationToken = default) + { + return GetCredentialSets().Get(credentialSetName, cancellationToken); + } + /// Gets a collection of ExportPipelineResources in the ContainerRegistry. /// An object representing collection of ExportPipelineResources and their operations over a ExportPipelineResource. public virtual ExportPipelineCollection GetExportPipelines() @@ -627,7 +701,7 @@ public virtual async Task> GetAsync(Cancella scope.Start(); try { - var response = await _containerRegistryRegistriesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryRegistriesRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ContainerRegistryResource(Client, response.Value), response.GetRawResponse()); @@ -651,7 +725,7 @@ public virtual Response Get(CancellationToken cancell scope.Start(); try { - var response = _containerRegistryRegistriesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var response = _containerRegistryRegistriesRestClient.Get(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ContainerRegistryResource(Client, response.Value), response.GetRawResponse()); @@ -676,8 +750,8 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell scope.Start(); try { - var response = await _containerRegistryRegistriesRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(_containerRegistryRegistriesClientDiagnostics, Pipeline, _containerRegistryRegistriesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _containerRegistryRegistriesRestClient.DeleteAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(_containerRegistryRegistriesClientDiagnostics, Pipeline, _containerRegistryRegistriesRestClient.CreateDeleteRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -702,8 +776,8 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel scope.Start(); try { - var response = _containerRegistryRegistriesRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new ContainerRegistryArmOperation(_containerRegistryRegistriesClientDiagnostics, Pipeline, _containerRegistryRegistriesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _containerRegistryRegistriesRestClient.Delete(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken); + var operation = new ContainerRegistryArmOperation(_containerRegistryRegistriesClientDiagnostics, Pipeline, _containerRegistryRegistriesRestClient.CreateDeleteRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -732,8 +806,8 @@ public virtual async Task> UpdateAsync(W scope.Start(); try { - var response = await _containerRegistryRegistriesRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryOperationSource(Client), _containerRegistryRegistriesClientDiagnostics, Pipeline, _containerRegistryRegistriesRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + var response = await _containerRegistryRegistriesRestClient.UpdateAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryOperationSource(Client), _containerRegistryRegistriesClientDiagnostics, Pipeline, _containerRegistryRegistriesRestClient.CreateUpdateRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -762,8 +836,8 @@ public virtual ArmOperation Update(WaitUntil waitUnti scope.Start(); try { - var response = _containerRegistryRegistriesRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryOperationSource(Client), _containerRegistryRegistriesClientDiagnostics, Pipeline, _containerRegistryRegistriesRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + var response = _containerRegistryRegistriesRestClient.Update(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, patch, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryOperationSource(Client), _containerRegistryRegistriesClientDiagnostics, Pipeline, _containerRegistryRegistriesRestClient.CreateUpdateRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -792,8 +866,8 @@ public virtual async Task ImportImageAsync(WaitUntil waitUntil, Co scope.Start(); try { - var response = await _containerRegistryRegistriesRestClient.ImportImageAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(_containerRegistryRegistriesClientDiagnostics, Pipeline, _containerRegistryRegistriesRestClient.CreateImportImageRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = await _containerRegistryRegistriesRestClient.ImportImageAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(_containerRegistryRegistriesClientDiagnostics, Pipeline, _containerRegistryRegistriesRestClient.CreateImportImageRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -822,8 +896,8 @@ public virtual ArmOperation ImportImage(WaitUntil waitUntil, ContainerRegistryIm scope.Start(); try { - var response = _containerRegistryRegistriesRestClient.ImportImage(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); - var operation = new ContainerRegistryArmOperation(_containerRegistryRegistriesClientDiagnostics, Pipeline, _containerRegistryRegistriesRestClient.CreateImportImageRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = _containerRegistryRegistriesRestClient.ImportImage(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, content, cancellationToken); + var operation = new ContainerRegistryArmOperation(_containerRegistryRegistriesClientDiagnostics, Pipeline, _containerRegistryRegistriesRestClient.CreateImportImageRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -844,7 +918,7 @@ public virtual ArmOperation ImportImage(WaitUntil waitUntil, ContainerRegistryIm /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetUsagesAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryRegistriesRestClient.CreateListUsagesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryRegistriesRestClient.CreateListUsagesRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); return PageableHelpers.CreateAsyncPageable(FirstPageRequest, null, ContainerRegistryUsage.DeserializeContainerRegistryUsage, _containerRegistryRegistriesClientDiagnostics, Pipeline, "ContainerRegistryResource.GetUsages", "value", null, cancellationToken); } @@ -857,7 +931,7 @@ public virtual AsyncPageable GetUsagesAsync(Cancellation /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetUsages(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryRegistriesRestClient.CreateListUsagesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryRegistriesRestClient.CreateListUsagesRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); return PageableHelpers.CreatePageable(FirstPageRequest, null, ContainerRegistryUsage.DeserializeContainerRegistryUsage, _containerRegistryRegistriesClientDiagnostics, Pipeline, "ContainerRegistryResource.GetUsages", "value", null, cancellationToken); } @@ -873,7 +947,7 @@ public virtual async Task> GetC scope.Start(); try { - var response = await _containerRegistryRegistriesRestClient.ListCredentialsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryRegistriesRestClient.ListCredentialsAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); return response; } catch (Exception e) @@ -895,7 +969,7 @@ public virtual Response GetCredentials(C scope.Start(); try { - var response = _containerRegistryRegistriesRestClient.ListCredentials(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var response = _containerRegistryRegistriesRestClient.ListCredentials(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken); return response; } catch (Exception e) @@ -921,7 +995,7 @@ public virtual async Task> Rege scope.Start(); try { - var response = await _containerRegistryRegistriesRestClient.RegenerateCredentialAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryRegistriesRestClient.RegenerateCredentialAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); return response; } catch (Exception e) @@ -947,7 +1021,7 @@ public virtual Response RegenerateCreden scope.Start(); try { - var response = _containerRegistryRegistriesRestClient.RegenerateCredential(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); + var response = _containerRegistryRegistriesRestClient.RegenerateCredential(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, content, cancellationToken); return response; } catch (Exception e) @@ -974,8 +1048,8 @@ public virtual async Task(new ContainerRegistryGenerateCredentialsResultOperationSource(), _containerRegistryRegistriesClientDiagnostics, Pipeline, _containerRegistryRegistriesRestClient.CreateGenerateCredentialsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = await _containerRegistryRegistriesRestClient.GenerateCredentialsAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryGenerateCredentialsResultOperationSource(), _containerRegistryRegistriesClientDiagnostics, Pipeline, _containerRegistryRegistriesRestClient.CreateGenerateCredentialsRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -1004,8 +1078,8 @@ public virtual ArmOperation Generate scope.Start(); try { - var response = _containerRegistryRegistriesRestClient.GenerateCredentials(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryGenerateCredentialsResultOperationSource(), _containerRegistryRegistriesClientDiagnostics, Pipeline, _containerRegistryRegistriesRestClient.CreateGenerateCredentialsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = _containerRegistryRegistriesRestClient.GenerateCredentials(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, content, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryGenerateCredentialsResultOperationSource(), _containerRegistryRegistriesClientDiagnostics, Pipeline, _containerRegistryRegistriesRestClient.CreateGenerateCredentialsRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -1034,8 +1108,8 @@ public virtual async Task> ScheduleRu scope.Start(); try { - var response = await _schedulesRestClient.ScheduleRunAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryRunOperationSource(Client), _schedulesClientDiagnostics, Pipeline, _schedulesRestClient.CreateScheduleRunRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = await _schedulesRestClient.ScheduleRunAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryRunOperationSource(Client), _schedulesClientDiagnostics, Pipeline, _schedulesRestClient.CreateScheduleRunRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -1064,8 +1138,8 @@ public virtual ArmOperation ScheduleRun(WaitUntil scope.Start(); try { - var response = _schedulesRestClient.ScheduleRun(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryRunOperationSource(Client), _schedulesClientDiagnostics, Pipeline, _schedulesRestClient.CreateScheduleRunRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = _schedulesRestClient.ScheduleRun(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, content, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryRunOperationSource(Client), _schedulesClientDiagnostics, Pipeline, _schedulesRestClient.CreateScheduleRunRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -1089,7 +1163,7 @@ public virtual async Task> GetBuildSourceUpload scope.Start(); try { - var response = await _buildsRestClient.GetBuildSourceUploadUrlAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _buildsRestClient.GetBuildSourceUploadUrlAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); return response; } catch (Exception e) @@ -1111,7 +1185,7 @@ public virtual Response GetBuildSourceUploadUrl(Cancella scope.Start(); try { - var response = _buildsRestClient.GetBuildSourceUploadUrl(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var response = _buildsRestClient.GetBuildSourceUploadUrl(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken); return response; } catch (Exception e) @@ -1144,7 +1218,7 @@ public virtual async Task> AddTagAsync(strin var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues[key] = value; await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _containerRegistryRegistriesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var originalResponse = await _containerRegistryRegistriesRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); return Response.FromValue(new ContainerRegistryResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else @@ -1190,7 +1264,7 @@ public virtual Response AddTag(string key, string val var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues[key] = value; GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _containerRegistryRegistriesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var originalResponse = _containerRegistryRegistriesRestClient.Get(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken); return Response.FromValue(new ContainerRegistryResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else @@ -1235,7 +1309,7 @@ public virtual async Task> SetTagsAsync(IDic var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.ReplaceWith(tags); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _containerRegistryRegistriesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var originalResponse = await _containerRegistryRegistriesRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); return Response.FromValue(new ContainerRegistryResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else @@ -1276,7 +1350,7 @@ public virtual Response SetTags(IDictionary> RemoveTagAsync(st var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.Remove(key); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _containerRegistryRegistriesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var originalResponse = await _containerRegistryRegistriesRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); return Response.FromValue(new ContainerRegistryResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else @@ -1360,7 +1434,7 @@ public virtual Response RemoveTag(string key, Cancell var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues.Remove(key); GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _containerRegistryRegistriesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var originalResponse = _containerRegistryRegistriesRestClient.Get(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken); return Response.FromValue(new ContainerRegistryResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryRunCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryRunCollection.cs index 7b1c2d1559e4..adc161b8032c 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryRunCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryRunCollection.cs @@ -69,7 +69,7 @@ public virtual async Task> GetAsync(strin scope.Start(); try { - var response = await _containerRegistryRunRunsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, runId, cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryRunRunsRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, runId, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ContainerRegistryRunResource(Client, response.Value), response.GetRawResponse()); @@ -98,7 +98,7 @@ public virtual Response Get(string runId, Cancella scope.Start(); try { - var response = _containerRegistryRunRunsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, runId, cancellationToken); + var response = _containerRegistryRunRunsRestClient.Get(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, runId, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ContainerRegistryRunResource(Client, response.Value), response.GetRawResponse()); @@ -121,8 +121,8 @@ public virtual Response Get(string runId, Cancella /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAllAsync(string filter = null, int? top = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryRunRunsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter, top); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryRunRunsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter, top); + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryRunRunsRestClient.CreateListRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, filter, top); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryRunRunsRestClient.CreateListNextPageRequest(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, filter, top); return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryRunResource(Client, ContainerRegistryRunData.DeserializeContainerRegistryRunData(e)), _containerRegistryRunRunsClientDiagnostics, Pipeline, "ContainerRegistryRunCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -137,8 +137,8 @@ public virtual AsyncPageable GetAllAsync(string fi /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAll(string filter = null, int? top = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryRunRunsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter, top); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryRunRunsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter, top); + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryRunRunsRestClient.CreateListRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, filter, top); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryRunRunsRestClient.CreateListNextPageRequest(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, filter, top); return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryRunResource(Client, ContainerRegistryRunData.DeserializeContainerRegistryRunData(e)), _containerRegistryRunRunsClientDiagnostics, Pipeline, "ContainerRegistryRunCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -159,7 +159,7 @@ public virtual async Task> ExistsAsync(string runId, Cancellation scope.Start(); try { - var response = await _containerRegistryRunRunsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, runId, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryRunRunsRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, runId, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -186,7 +186,7 @@ public virtual Response Exists(string runId, CancellationToken cancellatio scope.Start(); try { - var response = _containerRegistryRunRunsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, runId, cancellationToken: cancellationToken); + var response = _containerRegistryRunRunsRestClient.Get(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, runId, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryRunResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryRunResource.cs index 611d46f5801a..fa150ff64564 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryRunResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryRunResource.cs @@ -26,7 +26,7 @@ namespace Azure.ResourceManager.ContainerRegistry public partial class ContainerRegistryRunResource : ArmResource { /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string runId) + public static ResourceIdentifier CreateResourceIdentifier(Guid subscriptionId, string resourceGroupName, string registryName, string runId) { var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs/{runId}"; return new ResourceIdentifier(resourceId); @@ -99,7 +99,7 @@ public virtual async Task> GetAsync(Cance scope.Start(); try { - var response = await _containerRegistryRunRunsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryRunRunsRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ContainerRegistryRunResource(Client, response.Value), response.GetRawResponse()); @@ -123,7 +123,7 @@ public virtual Response Get(CancellationToken canc scope.Start(); try { - var response = _containerRegistryRunRunsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var response = _containerRegistryRunRunsRestClient.Get(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ContainerRegistryRunResource(Client, response.Value), response.GetRawResponse()); @@ -152,8 +152,8 @@ public virtual async Task> UpdateAsyn scope.Start(); try { - var response = await _containerRegistryRunRunsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryRunOperationSource(Client), _containerRegistryRunRunsClientDiagnostics, Pipeline, _containerRegistryRunRunsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + var response = await _containerRegistryRunRunsRestClient.UpdateAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryRunOperationSource(Client), _containerRegistryRunRunsClientDiagnostics, Pipeline, _containerRegistryRunRunsRestClient.CreateUpdateRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -182,8 +182,8 @@ public virtual ArmOperation Update(WaitUntil waitU scope.Start(); try { - var response = _containerRegistryRunRunsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryRunOperationSource(Client), _containerRegistryRunRunsClientDiagnostics, Pipeline, _containerRegistryRunRunsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + var response = _containerRegistryRunRunsRestClient.Update(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryRunOperationSource(Client), _containerRegistryRunRunsClientDiagnostics, Pipeline, _containerRegistryRunRunsRestClient.CreateUpdateRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -207,7 +207,7 @@ public virtual async Task> GetLogSasU scope.Start(); try { - var response = await _containerRegistryRunRunsRestClient.GetLogSasUrlAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryRunRunsRestClient.GetLogSasUrlAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); return response; } catch (Exception e) @@ -229,7 +229,7 @@ public virtual Response GetLogSasUrl(Cancellat scope.Start(); try { - var response = _containerRegistryRunRunsRestClient.GetLogSasUrl(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var response = _containerRegistryRunRunsRestClient.GetLogSasUrl(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); return response; } catch (Exception e) @@ -252,8 +252,8 @@ public virtual async Task CancelAsync(WaitUntil waitUntil, Cancell scope.Start(); try { - var response = await _containerRegistryRunRunsRestClient.CancelAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(_containerRegistryRunRunsClientDiagnostics, Pipeline, _containerRegistryRunRunsRestClient.CreateCancelRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _containerRegistryRunRunsRestClient.CancelAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(_containerRegistryRunRunsClientDiagnostics, Pipeline, _containerRegistryRunRunsRestClient.CreateCancelRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -278,8 +278,8 @@ public virtual ArmOperation Cancel(WaitUntil waitUntil, CancellationToken cancel scope.Start(); try { - var response = _containerRegistryRunRunsRestClient.Cancel(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new ContainerRegistryArmOperation(_containerRegistryRunRunsClientDiagnostics, Pipeline, _containerRegistryRunRunsRestClient.CreateCancelRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _containerRegistryRunRunsRestClient.Cancel(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new ContainerRegistryArmOperation(_containerRegistryRunRunsClientDiagnostics, Pipeline, _containerRegistryRunRunsRestClient.CreateCancelRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTaskCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTaskCollection.cs index bcc640b32c18..f9a4b2969afa 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTaskCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTaskCollection.cs @@ -72,8 +72,8 @@ public virtual async Task> CreateOrU scope.Start(); try { - var response = await _containerRegistryTaskTasksRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, taskName, data, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryTaskOperationSource(Client), _containerRegistryTaskTasksClientDiagnostics, Pipeline, _containerRegistryTaskTasksRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, taskName, data).Request, response, OperationFinalStateVia.Location); + var response = await _containerRegistryTaskTasksRestClient.CreateAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, taskName, data, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryTaskOperationSource(Client), _containerRegistryTaskTasksClientDiagnostics, Pipeline, _containerRegistryTaskTasksRestClient.CreateCreateRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, taskName, data).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -105,8 +105,8 @@ public virtual ArmOperation CreateOrUpdate(WaitUn scope.Start(); try { - var response = _containerRegistryTaskTasksRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, taskName, data, cancellationToken); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryTaskOperationSource(Client), _containerRegistryTaskTasksClientDiagnostics, Pipeline, _containerRegistryTaskTasksRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, taskName, data).Request, response, OperationFinalStateVia.Location); + var response = _containerRegistryTaskTasksRestClient.Create(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, taskName, data, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryTaskOperationSource(Client), _containerRegistryTaskTasksClientDiagnostics, Pipeline, _containerRegistryTaskTasksRestClient.CreateCreateRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, taskName, data).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -135,7 +135,7 @@ public virtual async Task> GetAsync(stri scope.Start(); try { - var response = await _containerRegistryTaskTasksRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, taskName, cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryTaskTasksRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, taskName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ContainerRegistryTaskResource(Client, response.Value), response.GetRawResponse()); @@ -164,7 +164,7 @@ public virtual Response Get(string taskName, Canc scope.Start(); try { - var response = _containerRegistryTaskTasksRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, taskName, cancellationToken); + var response = _containerRegistryTaskTasksRestClient.Get(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, taskName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ContainerRegistryTaskResource(Client, response.Value), response.GetRawResponse()); @@ -185,8 +185,8 @@ public virtual Response Get(string taskName, Canc /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryTaskTasksRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryTaskTasksRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryTaskTasksRestClient.CreateListRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryTaskTasksRestClient.CreateListNextPageRequest(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryTaskResource(Client, ContainerRegistryTaskData.DeserializeContainerRegistryTaskData(e)), _containerRegistryTaskTasksClientDiagnostics, Pipeline, "ContainerRegistryTaskCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -199,8 +199,8 @@ public virtual AsyncPageable GetAllAsync(Cancella /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryTaskTasksRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryTaskTasksRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryTaskTasksRestClient.CreateListRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryTaskTasksRestClient.CreateListNextPageRequest(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryTaskResource(Client, ContainerRegistryTaskData.DeserializeContainerRegistryTaskData(e)), _containerRegistryTaskTasksClientDiagnostics, Pipeline, "ContainerRegistryTaskCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -221,7 +221,7 @@ public virtual async Task> ExistsAsync(string taskName, Cancellat scope.Start(); try { - var response = await _containerRegistryTaskTasksRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, taskName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryTaskTasksRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, taskName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -248,7 +248,7 @@ public virtual Response Exists(string taskName, CancellationToken cancella scope.Start(); try { - var response = _containerRegistryTaskTasksRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, taskName, cancellationToken: cancellationToken); + var response = _containerRegistryTaskTasksRestClient.Get(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, taskName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTaskResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTaskResource.cs index 9a9dc6111e32..3f91c56d0bed 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTaskResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTaskResource.cs @@ -27,7 +27,7 @@ namespace Azure.ResourceManager.ContainerRegistry public partial class ContainerRegistryTaskResource : ArmResource { /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string taskName) + public static ResourceIdentifier CreateResourceIdentifier(Guid subscriptionId, string resourceGroupName, string registryName, string taskName) { var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}"; return new ResourceIdentifier(resourceId); @@ -100,7 +100,7 @@ public virtual async Task> GetAsync(Canc scope.Start(); try { - var response = await _containerRegistryTaskTasksRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryTaskTasksRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ContainerRegistryTaskResource(Client, response.Value), response.GetRawResponse()); @@ -124,7 +124,7 @@ public virtual Response Get(CancellationToken can scope.Start(); try { - var response = _containerRegistryTaskTasksRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var response = _containerRegistryTaskTasksRestClient.Get(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ContainerRegistryTaskResource(Client, response.Value), response.GetRawResponse()); @@ -149,8 +149,8 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell scope.Start(); try { - var response = await _containerRegistryTaskTasksRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(_containerRegistryTaskTasksClientDiagnostics, Pipeline, _containerRegistryTaskTasksRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _containerRegistryTaskTasksRestClient.DeleteAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(_containerRegistryTaskTasksClientDiagnostics, Pipeline, _containerRegistryTaskTasksRestClient.CreateDeleteRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -175,8 +175,8 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel scope.Start(); try { - var response = _containerRegistryTaskTasksRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new ContainerRegistryArmOperation(_containerRegistryTaskTasksClientDiagnostics, Pipeline, _containerRegistryTaskTasksRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _containerRegistryTaskTasksRestClient.Delete(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new ContainerRegistryArmOperation(_containerRegistryTaskTasksClientDiagnostics, Pipeline, _containerRegistryTaskTasksRestClient.CreateDeleteRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -205,8 +205,8 @@ public virtual async Task> UpdateAsy scope.Start(); try { - var response = await _containerRegistryTaskTasksRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryTaskOperationSource(Client), _containerRegistryTaskTasksClientDiagnostics, Pipeline, _containerRegistryTaskTasksRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + var response = await _containerRegistryTaskTasksRestClient.UpdateAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryTaskOperationSource(Client), _containerRegistryTaskTasksClientDiagnostics, Pipeline, _containerRegistryTaskTasksRestClient.CreateUpdateRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -235,8 +235,8 @@ public virtual ArmOperation Update(WaitUntil wait scope.Start(); try { - var response = _containerRegistryTaskTasksRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryTaskOperationSource(Client), _containerRegistryTaskTasksClientDiagnostics, Pipeline, _containerRegistryTaskTasksRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + var response = _containerRegistryTaskTasksRestClient.Update(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryTaskOperationSource(Client), _containerRegistryTaskTasksClientDiagnostics, Pipeline, _containerRegistryTaskTasksRestClient.CreateUpdateRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -260,7 +260,7 @@ public virtual async Task> GetDetailsAsy scope.Start(); try { - var response = await _containerRegistryTaskTasksRestClient.GetDetailsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryTaskTasksRestClient.GetDetailsAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); return Response.FromValue(new ContainerRegistryTaskResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -282,7 +282,7 @@ public virtual Response GetDetails(CancellationTo scope.Start(); try { - var response = _containerRegistryTaskTasksRestClient.GetDetails(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var response = _containerRegistryTaskTasksRestClient.GetDetails(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); return Response.FromValue(new ContainerRegistryTaskResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -315,7 +315,7 @@ public virtual async Task> AddTagAsync(s var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues[key] = value; await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _containerRegistryTaskTasksRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var originalResponse = await _containerRegistryTaskTasksRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); return Response.FromValue(new ContainerRegistryTaskResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else @@ -361,7 +361,7 @@ public virtual Response AddTag(string key, string var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues[key] = value; GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _containerRegistryTaskTasksRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var originalResponse = _containerRegistryTaskTasksRestClient.Get(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); return Response.FromValue(new ContainerRegistryTaskResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else @@ -406,7 +406,7 @@ public virtual async Task> SetTagsAsync( var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.ReplaceWith(tags); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _containerRegistryTaskTasksRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var originalResponse = await _containerRegistryTaskTasksRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); return Response.FromValue(new ContainerRegistryTaskResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else @@ -447,7 +447,7 @@ public virtual Response SetTags(IDictionary> RemoveTagAsyn var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.Remove(key); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _containerRegistryTaskTasksRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var originalResponse = await _containerRegistryTaskTasksRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); return Response.FromValue(new ContainerRegistryTaskResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else @@ -531,7 +531,7 @@ public virtual Response RemoveTag(string key, Can var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues.Remove(key); GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _containerRegistryTaskTasksRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var originalResponse = _containerRegistryTaskTasksRestClient.Get(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); return Response.FromValue(new ContainerRegistryTaskResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTaskRunCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTaskRunCollection.cs index 68738323129b..2f48deec73f7 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTaskRunCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTaskRunCollection.cs @@ -72,8 +72,8 @@ public virtual async Task> Create scope.Start(); try { - var response = await _containerRegistryTaskRunTaskRunsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, taskRunName, data, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryTaskRunOperationSource(Client), _containerRegistryTaskRunTaskRunsClientDiagnostics, Pipeline, _containerRegistryTaskRunTaskRunsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, taskRunName, data).Request, response, OperationFinalStateVia.Location); + var response = await _containerRegistryTaskRunTaskRunsRestClient.CreateAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, taskRunName, data, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryTaskRunOperationSource(Client), _containerRegistryTaskRunTaskRunsClientDiagnostics, Pipeline, _containerRegistryTaskRunTaskRunsRestClient.CreateCreateRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, taskRunName, data).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -105,8 +105,8 @@ public virtual ArmOperation CreateOrUpdate(Wai scope.Start(); try { - var response = _containerRegistryTaskRunTaskRunsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, taskRunName, data, cancellationToken); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryTaskRunOperationSource(Client), _containerRegistryTaskRunTaskRunsClientDiagnostics, Pipeline, _containerRegistryTaskRunTaskRunsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, taskRunName, data).Request, response, OperationFinalStateVia.Location); + var response = _containerRegistryTaskRunTaskRunsRestClient.Create(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, taskRunName, data, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryTaskRunOperationSource(Client), _containerRegistryTaskRunTaskRunsClientDiagnostics, Pipeline, _containerRegistryTaskRunTaskRunsRestClient.CreateCreateRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, taskRunName, data).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -135,7 +135,7 @@ public virtual async Task> GetAsync(s scope.Start(); try { - var response = await _containerRegistryTaskRunTaskRunsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, taskRunName, cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryTaskRunTaskRunsRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, taskRunName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ContainerRegistryTaskRunResource(Client, response.Value), response.GetRawResponse()); @@ -164,7 +164,7 @@ public virtual Response Get(string taskRunName scope.Start(); try { - var response = _containerRegistryTaskRunTaskRunsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, taskRunName, cancellationToken); + var response = _containerRegistryTaskRunTaskRunsRestClient.Get(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, taskRunName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ContainerRegistryTaskRunResource(Client, response.Value), response.GetRawResponse()); @@ -185,8 +185,8 @@ public virtual Response Get(string taskRunName /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryTaskRunTaskRunsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryTaskRunTaskRunsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryTaskRunTaskRunsRestClient.CreateListRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryTaskRunTaskRunsRestClient.CreateListNextPageRequest(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryTaskRunResource(Client, ContainerRegistryTaskRunData.DeserializeContainerRegistryTaskRunData(e)), _containerRegistryTaskRunTaskRunsClientDiagnostics, Pipeline, "ContainerRegistryTaskRunCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -199,8 +199,8 @@ public virtual AsyncPageable GetAllAsync(Cance /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryTaskRunTaskRunsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryTaskRunTaskRunsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryTaskRunTaskRunsRestClient.CreateListRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryTaskRunTaskRunsRestClient.CreateListNextPageRequest(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryTaskRunResource(Client, ContainerRegistryTaskRunData.DeserializeContainerRegistryTaskRunData(e)), _containerRegistryTaskRunTaskRunsClientDiagnostics, Pipeline, "ContainerRegistryTaskRunCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -221,7 +221,7 @@ public virtual async Task> ExistsAsync(string taskRunName, Cancel scope.Start(); try { - var response = await _containerRegistryTaskRunTaskRunsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, taskRunName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryTaskRunTaskRunsRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, taskRunName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -248,7 +248,7 @@ public virtual Response Exists(string taskRunName, CancellationToken cance scope.Start(); try { - var response = _containerRegistryTaskRunTaskRunsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, taskRunName, cancellationToken: cancellationToken); + var response = _containerRegistryTaskRunTaskRunsRestClient.Get(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, taskRunName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTaskRunResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTaskRunResource.cs index d03802a6ecd1..d5c250242560 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTaskRunResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTaskRunResource.cs @@ -26,7 +26,7 @@ namespace Azure.ResourceManager.ContainerRegistry public partial class ContainerRegistryTaskRunResource : ArmResource { /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string taskRunName) + public static ResourceIdentifier CreateResourceIdentifier(Guid subscriptionId, string resourceGroupName, string registryName, string taskRunName) { var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns/{taskRunName}"; return new ResourceIdentifier(resourceId); @@ -99,7 +99,7 @@ public virtual async Task> GetAsync(C scope.Start(); try { - var response = await _containerRegistryTaskRunTaskRunsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryTaskRunTaskRunsRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ContainerRegistryTaskRunResource(Client, response.Value), response.GetRawResponse()); @@ -123,7 +123,7 @@ public virtual Response Get(CancellationToken scope.Start(); try { - var response = _containerRegistryTaskRunTaskRunsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var response = _containerRegistryTaskRunTaskRunsRestClient.Get(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ContainerRegistryTaskRunResource(Client, response.Value), response.GetRawResponse()); @@ -148,8 +148,8 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell scope.Start(); try { - var response = await _containerRegistryTaskRunTaskRunsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(_containerRegistryTaskRunTaskRunsClientDiagnostics, Pipeline, _containerRegistryTaskRunTaskRunsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _containerRegistryTaskRunTaskRunsRestClient.DeleteAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(_containerRegistryTaskRunTaskRunsClientDiagnostics, Pipeline, _containerRegistryTaskRunTaskRunsRestClient.CreateDeleteRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -174,8 +174,8 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel scope.Start(); try { - var response = _containerRegistryTaskRunTaskRunsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new ContainerRegistryArmOperation(_containerRegistryTaskRunTaskRunsClientDiagnostics, Pipeline, _containerRegistryTaskRunTaskRunsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _containerRegistryTaskRunTaskRunsRestClient.Delete(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new ContainerRegistryArmOperation(_containerRegistryTaskRunTaskRunsClientDiagnostics, Pipeline, _containerRegistryTaskRunTaskRunsRestClient.CreateDeleteRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -204,8 +204,8 @@ public virtual async Task> Update scope.Start(); try { - var response = await _containerRegistryTaskRunTaskRunsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryTaskRunOperationSource(Client), _containerRegistryTaskRunTaskRunsClientDiagnostics, Pipeline, _containerRegistryTaskRunTaskRunsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + var response = await _containerRegistryTaskRunTaskRunsRestClient.UpdateAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryTaskRunOperationSource(Client), _containerRegistryTaskRunTaskRunsClientDiagnostics, Pipeline, _containerRegistryTaskRunTaskRunsRestClient.CreateUpdateRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -234,8 +234,8 @@ public virtual ArmOperation Update(WaitUntil w scope.Start(); try { - var response = _containerRegistryTaskRunTaskRunsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryTaskRunOperationSource(Client), _containerRegistryTaskRunTaskRunsClientDiagnostics, Pipeline, _containerRegistryTaskRunTaskRunsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + var response = _containerRegistryTaskRunTaskRunsRestClient.Update(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryTaskRunOperationSource(Client), _containerRegistryTaskRunTaskRunsClientDiagnostics, Pipeline, _containerRegistryTaskRunTaskRunsRestClient.CreateUpdateRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -259,7 +259,7 @@ public virtual async Task> GetDetails scope.Start(); try { - var response = await _containerRegistryTaskRunTaskRunsRestClient.GetDetailsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryTaskRunTaskRunsRestClient.GetDetailsAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); return Response.FromValue(new ContainerRegistryTaskRunResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -281,7 +281,7 @@ public virtual Response GetDetails(Cancellatio scope.Start(); try { - var response = _containerRegistryTaskRunTaskRunsRestClient.GetDetails(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var response = _containerRegistryTaskRunTaskRunsRestClient.GetDetails(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); return Response.FromValue(new ContainerRegistryTaskRunResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTokenCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTokenCollection.cs index b7081f627f23..7892126bdb61 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTokenCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTokenCollection.cs @@ -72,8 +72,8 @@ public virtual async Task> CreateOr scope.Start(); try { - var response = await _containerRegistryTokenTokensRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, tokenName, data, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryTokenOperationSource(Client), _containerRegistryTokenTokensClientDiagnostics, Pipeline, _containerRegistryTokenTokensRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, tokenName, data).Request, response, OperationFinalStateVia.Location); + var response = await _containerRegistryTokenTokensRestClient.CreateAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, tokenName, data, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryTokenOperationSource(Client), _containerRegistryTokenTokensClientDiagnostics, Pipeline, _containerRegistryTokenTokensRestClient.CreateCreateRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, tokenName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -105,8 +105,8 @@ public virtual ArmOperation CreateOrUpdate(WaitU scope.Start(); try { - var response = _containerRegistryTokenTokensRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, tokenName, data, cancellationToken); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryTokenOperationSource(Client), _containerRegistryTokenTokensClientDiagnostics, Pipeline, _containerRegistryTokenTokensRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, tokenName, data).Request, response, OperationFinalStateVia.Location); + var response = _containerRegistryTokenTokensRestClient.Create(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, tokenName, data, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryTokenOperationSource(Client), _containerRegistryTokenTokensClientDiagnostics, Pipeline, _containerRegistryTokenTokensRestClient.CreateCreateRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, tokenName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -135,7 +135,7 @@ public virtual async Task> GetAsync(str scope.Start(); try { - var response = await _containerRegistryTokenTokensRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, tokenName, cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryTokenTokensRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, tokenName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ContainerRegistryTokenResource(Client, response.Value), response.GetRawResponse()); @@ -164,7 +164,7 @@ public virtual Response Get(string tokenName, Ca scope.Start(); try { - var response = _containerRegistryTokenTokensRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, tokenName, cancellationToken); + var response = _containerRegistryTokenTokensRestClient.Get(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, tokenName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ContainerRegistryTokenResource(Client, response.Value), response.GetRawResponse()); @@ -185,8 +185,8 @@ public virtual Response Get(string tokenName, Ca /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryTokenTokensRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryTokenTokensRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryTokenTokensRestClient.CreateListRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryTokenTokensRestClient.CreateListNextPageRequest(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryTokenResource(Client, ContainerRegistryTokenData.DeserializeContainerRegistryTokenData(e)), _containerRegistryTokenTokensClientDiagnostics, Pipeline, "ContainerRegistryTokenCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -199,8 +199,8 @@ public virtual AsyncPageable GetAllAsync(Cancell /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryTokenTokensRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryTokenTokensRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryTokenTokensRestClient.CreateListRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryTokenTokensRestClient.CreateListNextPageRequest(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryTokenResource(Client, ContainerRegistryTokenData.DeserializeContainerRegistryTokenData(e)), _containerRegistryTokenTokensClientDiagnostics, Pipeline, "ContainerRegistryTokenCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -221,7 +221,7 @@ public virtual async Task> ExistsAsync(string tokenName, Cancella scope.Start(); try { - var response = await _containerRegistryTokenTokensRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, tokenName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryTokenTokensRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, tokenName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -248,7 +248,7 @@ public virtual Response Exists(string tokenName, CancellationToken cancell scope.Start(); try { - var response = _containerRegistryTokenTokensRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, tokenName, cancellationToken: cancellationToken); + var response = _containerRegistryTokenTokensRestClient.Get(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, tokenName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTokenResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTokenResource.cs index 79646a73e363..7017b7edf783 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTokenResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTokenResource.cs @@ -26,7 +26,7 @@ namespace Azure.ResourceManager.ContainerRegistry public partial class ContainerRegistryTokenResource : ArmResource { /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string tokenName) + public static ResourceIdentifier CreateResourceIdentifier(Guid subscriptionId, string resourceGroupName, string registryName, string tokenName) { var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tokens/{tokenName}"; return new ResourceIdentifier(resourceId); @@ -99,7 +99,7 @@ public virtual async Task> GetAsync(Can scope.Start(); try { - var response = await _containerRegistryTokenTokensRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryTokenTokensRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ContainerRegistryTokenResource(Client, response.Value), response.GetRawResponse()); @@ -123,7 +123,7 @@ public virtual Response Get(CancellationToken ca scope.Start(); try { - var response = _containerRegistryTokenTokensRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var response = _containerRegistryTokenTokensRestClient.Get(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ContainerRegistryTokenResource(Client, response.Value), response.GetRawResponse()); @@ -148,8 +148,8 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell scope.Start(); try { - var response = await _containerRegistryTokenTokensRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(_containerRegistryTokenTokensClientDiagnostics, Pipeline, _containerRegistryTokenTokensRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _containerRegistryTokenTokensRestClient.DeleteAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(_containerRegistryTokenTokensClientDiagnostics, Pipeline, _containerRegistryTokenTokensRestClient.CreateDeleteRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -174,8 +174,8 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel scope.Start(); try { - var response = _containerRegistryTokenTokensRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new ContainerRegistryArmOperation(_containerRegistryTokenTokensClientDiagnostics, Pipeline, _containerRegistryTokenTokensRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _containerRegistryTokenTokensRestClient.Delete(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new ContainerRegistryArmOperation(_containerRegistryTokenTokensClientDiagnostics, Pipeline, _containerRegistryTokenTokensRestClient.CreateDeleteRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -204,8 +204,8 @@ public virtual async Task> UpdateAs scope.Start(); try { - var response = await _containerRegistryTokenTokensRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryTokenOperationSource(Client), _containerRegistryTokenTokensClientDiagnostics, Pipeline, _containerRegistryTokenTokensRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + var response = await _containerRegistryTokenTokensRestClient.UpdateAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryTokenOperationSource(Client), _containerRegistryTokenTokensClientDiagnostics, Pipeline, _containerRegistryTokenTokensRestClient.CreateUpdateRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -234,8 +234,8 @@ public virtual ArmOperation Update(WaitUntil wai scope.Start(); try { - var response = _containerRegistryTokenTokensRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryTokenOperationSource(Client), _containerRegistryTokenTokensClientDiagnostics, Pipeline, _containerRegistryTokenTokensRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + var response = _containerRegistryTokenTokensRestClient.Update(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryTokenOperationSource(Client), _containerRegistryTokenTokensClientDiagnostics, Pipeline, _containerRegistryTokenTokensRestClient.CreateUpdateRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryWebhookCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryWebhookCollection.cs index c56ff8ddb19d..c3e8e7f6d761 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryWebhookCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryWebhookCollection.cs @@ -73,8 +73,8 @@ public virtual async Task> Create scope.Start(); try { - var response = await _containerRegistryWebhookWebhooksRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, webhookName, content, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryWebhookOperationSource(Client), _containerRegistryWebhookWebhooksClientDiagnostics, Pipeline, _containerRegistryWebhookWebhooksRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, webhookName, content).Request, response, OperationFinalStateVia.Location); + var response = await _containerRegistryWebhookWebhooksRestClient.CreateAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, webhookName, content, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryWebhookOperationSource(Client), _containerRegistryWebhookWebhooksClientDiagnostics, Pipeline, _containerRegistryWebhookWebhooksRestClient.CreateCreateRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, webhookName, content).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -106,8 +106,8 @@ public virtual ArmOperation CreateOrUpdate(Wai scope.Start(); try { - var response = _containerRegistryWebhookWebhooksRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, webhookName, content, cancellationToken); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryWebhookOperationSource(Client), _containerRegistryWebhookWebhooksClientDiagnostics, Pipeline, _containerRegistryWebhookWebhooksRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, webhookName, content).Request, response, OperationFinalStateVia.Location); + var response = _containerRegistryWebhookWebhooksRestClient.Create(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, webhookName, content, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryWebhookOperationSource(Client), _containerRegistryWebhookWebhooksClientDiagnostics, Pipeline, _containerRegistryWebhookWebhooksRestClient.CreateCreateRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, webhookName, content).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -136,7 +136,7 @@ public virtual async Task> GetAsync(s scope.Start(); try { - var response = await _containerRegistryWebhookWebhooksRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, webhookName, cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryWebhookWebhooksRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, webhookName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ContainerRegistryWebhookResource(Client, response.Value), response.GetRawResponse()); @@ -165,7 +165,7 @@ public virtual Response Get(string webhookName scope.Start(); try { - var response = _containerRegistryWebhookWebhooksRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, webhookName, cancellationToken); + var response = _containerRegistryWebhookWebhooksRestClient.Get(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, webhookName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ContainerRegistryWebhookResource(Client, response.Value), response.GetRawResponse()); @@ -186,8 +186,8 @@ public virtual Response Get(string webhookName /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryWebhookWebhooksRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryWebhookWebhooksRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryWebhookWebhooksRestClient.CreateListRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryWebhookWebhooksRestClient.CreateListNextPageRequest(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryWebhookResource(Client, ContainerRegistryWebhookData.DeserializeContainerRegistryWebhookData(e)), _containerRegistryWebhookWebhooksClientDiagnostics, Pipeline, "ContainerRegistryWebhookCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -200,8 +200,8 @@ public virtual AsyncPageable GetAllAsync(Cance /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryWebhookWebhooksRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryWebhookWebhooksRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryWebhookWebhooksRestClient.CreateListRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryWebhookWebhooksRestClient.CreateListNextPageRequest(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryWebhookResource(Client, ContainerRegistryWebhookData.DeserializeContainerRegistryWebhookData(e)), _containerRegistryWebhookWebhooksClientDiagnostics, Pipeline, "ContainerRegistryWebhookCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -222,7 +222,7 @@ public virtual async Task> ExistsAsync(string webhookName, Cancel scope.Start(); try { - var response = await _containerRegistryWebhookWebhooksRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, webhookName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryWebhookWebhooksRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, webhookName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -249,7 +249,7 @@ public virtual Response Exists(string webhookName, CancellationToken cance scope.Start(); try { - var response = _containerRegistryWebhookWebhooksRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, webhookName, cancellationToken: cancellationToken); + var response = _containerRegistryWebhookWebhooksRestClient.Get(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, webhookName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryWebhookResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryWebhookResource.cs index 67a9ab827212..fd0769f6c9df 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryWebhookResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryWebhookResource.cs @@ -27,7 +27,7 @@ namespace Azure.ResourceManager.ContainerRegistry public partial class ContainerRegistryWebhookResource : ArmResource { /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string webhookName) + public static ResourceIdentifier CreateResourceIdentifier(Guid subscriptionId, string resourceGroupName, string registryName, string webhookName) { var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}"; return new ResourceIdentifier(resourceId); @@ -100,7 +100,7 @@ public virtual async Task> GetAsync(C scope.Start(); try { - var response = await _containerRegistryWebhookWebhooksRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryWebhookWebhooksRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ContainerRegistryWebhookResource(Client, response.Value), response.GetRawResponse()); @@ -124,7 +124,7 @@ public virtual Response Get(CancellationToken scope.Start(); try { - var response = _containerRegistryWebhookWebhooksRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var response = _containerRegistryWebhookWebhooksRestClient.Get(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ContainerRegistryWebhookResource(Client, response.Value), response.GetRawResponse()); @@ -149,8 +149,8 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell scope.Start(); try { - var response = await _containerRegistryWebhookWebhooksRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(_containerRegistryWebhookWebhooksClientDiagnostics, Pipeline, _containerRegistryWebhookWebhooksRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _containerRegistryWebhookWebhooksRestClient.DeleteAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(_containerRegistryWebhookWebhooksClientDiagnostics, Pipeline, _containerRegistryWebhookWebhooksRestClient.CreateDeleteRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -175,8 +175,8 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel scope.Start(); try { - var response = _containerRegistryWebhookWebhooksRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new ContainerRegistryArmOperation(_containerRegistryWebhookWebhooksClientDiagnostics, Pipeline, _containerRegistryWebhookWebhooksRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _containerRegistryWebhookWebhooksRestClient.Delete(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new ContainerRegistryArmOperation(_containerRegistryWebhookWebhooksClientDiagnostics, Pipeline, _containerRegistryWebhookWebhooksRestClient.CreateDeleteRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -205,8 +205,8 @@ public virtual async Task> Update scope.Start(); try { - var response = await _containerRegistryWebhookWebhooksRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryWebhookOperationSource(Client), _containerRegistryWebhookWebhooksClientDiagnostics, Pipeline, _containerRegistryWebhookWebhooksRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + var response = await _containerRegistryWebhookWebhooksRestClient.UpdateAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryWebhookOperationSource(Client), _containerRegistryWebhookWebhooksClientDiagnostics, Pipeline, _containerRegistryWebhookWebhooksRestClient.CreateUpdateRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -235,8 +235,8 @@ public virtual ArmOperation Update(WaitUntil w scope.Start(); try { - var response = _containerRegistryWebhookWebhooksRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken); - var operation = new ContainerRegistryArmOperation(new ContainerRegistryWebhookOperationSource(Client), _containerRegistryWebhookWebhooksClientDiagnostics, Pipeline, _containerRegistryWebhookWebhooksRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + var response = _containerRegistryWebhookWebhooksRestClient.Update(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ContainerRegistryWebhookOperationSource(Client), _containerRegistryWebhookWebhooksClientDiagnostics, Pipeline, _containerRegistryWebhookWebhooksRestClient.CreateUpdateRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -260,7 +260,7 @@ public virtual async Task> PingAsync scope.Start(); try { - var response = await _containerRegistryWebhookWebhooksRestClient.PingAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryWebhookWebhooksRestClient.PingAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); return response; } catch (Exception e) @@ -282,7 +282,7 @@ public virtual Response Ping(CancellationToke scope.Start(); try { - var response = _containerRegistryWebhookWebhooksRestClient.Ping(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var response = _containerRegistryWebhookWebhooksRestClient.Ping(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); return response; } catch (Exception e) @@ -301,8 +301,8 @@ public virtual Response Ping(CancellationToke /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetEventsAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryWebhookWebhooksRestClient.CreateListEventsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryWebhookWebhooksRestClient.CreateListEventsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryWebhookWebhooksRestClient.CreateListEventsRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryWebhookWebhooksRestClient.CreateListEventsNextPageRequest(nextLink, Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ContainerRegistryWebhookEvent.DeserializeContainerRegistryWebhookEvent, _containerRegistryWebhookWebhooksClientDiagnostics, Pipeline, "ContainerRegistryWebhookResource.GetEvents", "value", "nextLink", cancellationToken); } @@ -315,8 +315,8 @@ public virtual AsyncPageable GetEventsAsync(Cance /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetEvents(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryWebhookWebhooksRestClient.CreateListEventsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryWebhookWebhooksRestClient.CreateListEventsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerRegistryWebhookWebhooksRestClient.CreateListEventsRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerRegistryWebhookWebhooksRestClient.CreateListEventsNextPageRequest(nextLink, Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ContainerRegistryWebhookEvent.DeserializeContainerRegistryWebhookEvent, _containerRegistryWebhookWebhooksClientDiagnostics, Pipeline, "ContainerRegistryWebhookResource.GetEvents", "value", "nextLink", cancellationToken); } @@ -332,7 +332,7 @@ public virtual async Task> GetC scope.Start(); try { - var response = await _containerRegistryWebhookWebhooksRestClient.GetCallbackConfigAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryWebhookWebhooksRestClient.GetCallbackConfigAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); return response; } catch (Exception e) @@ -354,7 +354,7 @@ public virtual Response GetCallbackConfi scope.Start(); try { - var response = _containerRegistryWebhookWebhooksRestClient.GetCallbackConfig(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var response = _containerRegistryWebhookWebhooksRestClient.GetCallbackConfig(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); return response; } catch (Exception e) @@ -387,7 +387,7 @@ public virtual async Task> AddTagAsyn var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues[key] = value; await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _containerRegistryWebhookWebhooksRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var originalResponse = await _containerRegistryWebhookWebhooksRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); return Response.FromValue(new ContainerRegistryWebhookResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else @@ -433,7 +433,7 @@ public virtual Response AddTag(string key, str var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues[key] = value; GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _containerRegistryWebhookWebhooksRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var originalResponse = _containerRegistryWebhookWebhooksRestClient.Get(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); return Response.FromValue(new ContainerRegistryWebhookResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else @@ -478,7 +478,7 @@ public virtual async Task> SetTagsAsy var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.ReplaceWith(tags); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _containerRegistryWebhookWebhooksRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var originalResponse = await _containerRegistryWebhookWebhooksRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); return Response.FromValue(new ContainerRegistryWebhookResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else @@ -519,7 +519,7 @@ public virtual Response SetTags(IDictionary> RemoveTagA var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.Remove(key); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _containerRegistryWebhookWebhooksRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var originalResponse = await _containerRegistryWebhookWebhooksRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); return Response.FromValue(new ContainerRegistryWebhookResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else @@ -603,7 +603,7 @@ public virtual Response RemoveTag(string key, var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues.Remove(key); GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _containerRegistryWebhookWebhooksRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var originalResponse = _containerRegistryWebhookWebhooksRestClient.Get(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); return Response.FromValue(new ContainerRegistryWebhookResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/CredentialSetCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/CredentialSetCollection.cs new file mode 100644 index 000000000000..d9719bda0a82 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/CredentialSetCollection.cs @@ -0,0 +1,276 @@ +// 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.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.ContainerRegistry +{ + /// + /// 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 GetCredentialSets method from an instance of . + /// + public partial class CredentialSetCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _credentialSetClientDiagnostics; + private readonly CredentialSetsRestOperations _credentialSetRestClient; + + /// Initializes a new instance of the class for mocking. + protected CredentialSetCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal CredentialSetCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _credentialSetClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerRegistry", CredentialSetResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(CredentialSetResource.ResourceType, out string credentialSetApiVersion); + _credentialSetRestClient = new CredentialSetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, credentialSetApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ContainerRegistryResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ContainerRegistryResource.ResourceType), nameof(id)); + } + + /// + /// Creates a credential set for a container registry with the specified parameters. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets/{credentialSetName} + /// Operation Id: CredentialSets_Create + /// + /// 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 credential set. + /// The parameters for creating a credential set. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string credentialSetName, CredentialSetData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(credentialSetName, nameof(credentialSetName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _credentialSetClientDiagnostics.CreateScope("CredentialSetCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _credentialSetRestClient.CreateAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, credentialSetName, data, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new CredentialSetOperationSource(Client), _credentialSetClientDiagnostics, Pipeline, _credentialSetRestClient.CreateCreateRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, credentialSetName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates a credential set for a container registry with the specified parameters. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets/{credentialSetName} + /// Operation Id: CredentialSets_Create + /// + /// 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 credential set. + /// The parameters for creating a credential set. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string credentialSetName, CredentialSetData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(credentialSetName, nameof(credentialSetName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _credentialSetClientDiagnostics.CreateScope("CredentialSetCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _credentialSetRestClient.Create(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, credentialSetName, data, cancellationToken); + var operation = new ContainerRegistryArmOperation(new CredentialSetOperationSource(Client), _credentialSetClientDiagnostics, Pipeline, _credentialSetRestClient.CreateCreateRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, credentialSetName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the properties of the specified credential set resource. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets/{credentialSetName} + /// Operation Id: CredentialSets_Get + /// + /// The name of the credential set. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string credentialSetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(credentialSetName, nameof(credentialSetName)); + + using var scope = _credentialSetClientDiagnostics.CreateScope("CredentialSetCollection.Get"); + scope.Start(); + try + { + var response = await _credentialSetRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, credentialSetName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new CredentialSetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the properties of the specified credential set resource. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets/{credentialSetName} + /// Operation Id: CredentialSets_Get + /// + /// The name of the credential set. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string credentialSetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(credentialSetName, nameof(credentialSetName)); + + using var scope = _credentialSetClientDiagnostics.CreateScope("CredentialSetCollection.Get"); + scope.Start(); + try + { + var response = _credentialSetRestClient.Get(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, credentialSetName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new CredentialSetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists all credential set resources for the specified container registry. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets + /// Operation Id: CredentialSets_List + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _credentialSetRestClient.CreateListRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _credentialSetRestClient.CreateListNextPageRequest(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); + return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CredentialSetResource(Client, CredentialSetData.DeserializeCredentialSetData(e)), _credentialSetClientDiagnostics, Pipeline, "CredentialSetCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Lists all credential set resources for the specified container registry. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets + /// Operation Id: CredentialSets_List + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _credentialSetRestClient.CreateListRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _credentialSetRestClient.CreateListNextPageRequest(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); + return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CredentialSetResource(Client, CredentialSetData.DeserializeCredentialSetData(e)), _credentialSetClientDiagnostics, Pipeline, "CredentialSetCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets/{credentialSetName} + /// Operation Id: CredentialSets_Get + /// + /// The name of the credential set. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string credentialSetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(credentialSetName, nameof(credentialSetName)); + + using var scope = _credentialSetClientDiagnostics.CreateScope("CredentialSetCollection.Exists"); + scope.Start(); + try + { + var response = await _credentialSetRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, credentialSetName, cancellationToken: cancellationToken).ConfigureAwait(false); + 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}/credentialSets/{credentialSetName} + /// Operation Id: CredentialSets_Get + /// + /// The name of the credential set. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string credentialSetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(credentialSetName, nameof(credentialSetName)); + + using var scope = _credentialSetClientDiagnostics.CreateScope("CredentialSetCollection.Exists"); + scope.Start(); + try + { + var response = _credentialSetRestClient.Get(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, credentialSetName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/CredentialSetData.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/CredentialSetData.cs new file mode 100644 index 000000000000..eb2283176947 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/CredentialSetData.cs @@ -0,0 +1,61 @@ +// 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.ContainerRegistry.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + /// A class representing the CredentialSet data model. + public partial class CredentialSetData : ResourceData + { + /// Initializes a new instance of CredentialSetData. + public CredentialSetData() + { + AuthCredentials = new ChangeTrackingList(); + } + + /// Initializes a new instance of CredentialSetData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Identities associated with the resource. This is used to access the KeyVault secrets. + /// The credentials are stored for this upstream or login server. + /// + /// List of authentication credentials stored for an upstream. + /// Usually consists of a primary and an optional secondary credential. + /// + /// The creation date of credential store resource. + /// Provisioning state of the resource. + internal CredentialSetData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ManagedServiceIdentity identity, string loginServer, IList authCredentials, DateTimeOffset? createdOn, ContainerRegistryProvisioningState? provisioningState) : base(id, name, resourceType, systemData) + { + Identity = identity; + LoginServer = loginServer; + AuthCredentials = authCredentials; + CreatedOn = createdOn; + ProvisioningState = provisioningState; + } + + /// Identities associated with the resource. This is used to access the KeyVault secrets. + public ManagedServiceIdentity Identity { get; set; } + /// The credentials are stored for this upstream or login server. + public string LoginServer { get; set; } + /// + /// List of authentication credentials stored for an upstream. + /// Usually consists of a primary and an optional secondary credential. + /// + public IList AuthCredentials { get; } + /// The creation date of credential store resource. + public DateTimeOffset? CreatedOn { get; } + /// Provisioning state of the resource. + public ContainerRegistryProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/CredentialSetResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/CredentialSetResource.cs new file mode 100644 index 000000000000..ae0e5848c334 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/CredentialSetResource.cs @@ -0,0 +1,250 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.ContainerRegistry.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + /// + /// A Class representing a CredentialSet 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 GetCredentialSetResource method. + /// Otherwise you can get one from its parent resource using the GetCredentialSet method. + /// + public partial class CredentialSetResource : ArmResource + { + /// Generate the resource identifier of a instance. + public static ResourceIdentifier CreateResourceIdentifier(Guid subscriptionId, string resourceGroupName, string registryName, string credentialSetName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets/{credentialSetName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _credentialSetClientDiagnostics; + private readonly CredentialSetsRestOperations _credentialSetRestClient; + private readonly CredentialSetData _data; + + /// Initializes a new instance of the class for mocking. + protected CredentialSetResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal CredentialSetResource(ArmClient client, CredentialSetData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal CredentialSetResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _credentialSetClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerRegistry", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string credentialSetApiVersion); + _credentialSetRestClient = new CredentialSetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, credentialSetApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.ContainerRegistry/registries/credentialSets"; + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual CredentialSetData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets the properties of the specified credential set resource. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets/{credentialSetName} + /// Operation Id: CredentialSets_Get + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _credentialSetClientDiagnostics.CreateScope("CredentialSetResource.Get"); + scope.Start(); + try + { + var response = await _credentialSetRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new CredentialSetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the properties of the specified credential set resource. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets/{credentialSetName} + /// Operation Id: CredentialSets_Get + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _credentialSetClientDiagnostics.CreateScope("CredentialSetResource.Get"); + scope.Start(); + try + { + var response = _credentialSetRestClient.Get(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new CredentialSetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a credential set from a container registry. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets/{credentialSetName} + /// Operation Id: CredentialSets_Delete + /// + /// 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 var scope = _credentialSetClientDiagnostics.CreateScope("CredentialSetResource.Delete"); + scope.Start(); + try + { + var response = await _credentialSetRestClient.DeleteAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(_credentialSetClientDiagnostics, Pipeline, _credentialSetRestClient.CreateDeleteRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).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 credential set from a container registry. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets/{credentialSetName} + /// Operation Id: CredentialSets_Delete + /// + /// 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 var scope = _credentialSetClientDiagnostics.CreateScope("CredentialSetResource.Delete"); + scope.Start(); + try + { + var response = _credentialSetRestClient.Delete(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new ContainerRegistryArmOperation(_credentialSetClientDiagnostics, Pipeline, _credentialSetRestClient.CreateDeleteRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates a credential set for a container registry with the specified parameters. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets/{credentialSetName} + /// Operation Id: CredentialSets_Update + /// + /// 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 a credential set. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, CredentialSetPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _credentialSetClientDiagnostics.CreateScope("CredentialSetResource.Update"); + scope.Start(); + try + { + var response = await _credentialSetRestClient.UpdateAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new CredentialSetOperationSource(Client), _credentialSetClientDiagnostics, Pipeline, _credentialSetRestClient.CreateUpdateRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates a credential set for a container registry with the specified parameters. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets/{credentialSetName} + /// Operation Id: CredentialSets_Update + /// + /// 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 a credential set. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, CredentialSetPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _credentialSetClientDiagnostics.CreateScope("CredentialSetResource.Update"); + scope.Start(); + try + { + var response = _credentialSetRestClient.Update(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch, cancellationToken); + var operation = new ContainerRegistryArmOperation(new CredentialSetOperationSource(Client), _credentialSetClientDiagnostics, Pipeline, _credentialSetRestClient.CreateUpdateRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ExportPipelineCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ExportPipelineCollection.cs index e645566b4c8d..ac4e5426a33a 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ExportPipelineCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ExportPipelineCollection.cs @@ -72,8 +72,8 @@ public virtual async Task> CreateOrUpdateAs scope.Start(); try { - var response = await _exportPipelineRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, exportPipelineName, data, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(new ExportPipelineOperationSource(Client), _exportPipelineClientDiagnostics, Pipeline, _exportPipelineRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, exportPipelineName, data).Request, response, OperationFinalStateVia.Location); + var response = await _exportPipelineRestClient.CreateAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, exportPipelineName, data, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ExportPipelineOperationSource(Client), _exportPipelineClientDiagnostics, Pipeline, _exportPipelineRestClient.CreateCreateRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, exportPipelineName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -105,8 +105,8 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wai scope.Start(); try { - var response = _exportPipelineRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, exportPipelineName, data, cancellationToken); - var operation = new ContainerRegistryArmOperation(new ExportPipelineOperationSource(Client), _exportPipelineClientDiagnostics, Pipeline, _exportPipelineRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, exportPipelineName, data).Request, response, OperationFinalStateVia.Location); + var response = _exportPipelineRestClient.Create(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, exportPipelineName, data, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ExportPipelineOperationSource(Client), _exportPipelineClientDiagnostics, Pipeline, _exportPipelineRestClient.CreateCreateRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, exportPipelineName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -135,7 +135,7 @@ public virtual async Task> GetAsync(string expo scope.Start(); try { - var response = await _exportPipelineRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, exportPipelineName, cancellationToken).ConfigureAwait(false); + var response = await _exportPipelineRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, exportPipelineName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ExportPipelineResource(Client, response.Value), response.GetRawResponse()); @@ -164,7 +164,7 @@ public virtual Response Get(string exportPipelineName, C scope.Start(); try { - var response = _exportPipelineRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, exportPipelineName, cancellationToken); + var response = _exportPipelineRestClient.Get(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, exportPipelineName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ExportPipelineResource(Client, response.Value), response.GetRawResponse()); @@ -185,8 +185,8 @@ public virtual Response Get(string exportPipelineName, C /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _exportPipelineRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _exportPipelineRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage FirstPageRequest(int? pageSizeHint) => _exportPipelineRestClient.CreateListRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _exportPipelineRestClient.CreateListNextPageRequest(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ExportPipelineResource(Client, ExportPipelineData.DeserializeExportPipelineData(e)), _exportPipelineClientDiagnostics, Pipeline, "ExportPipelineCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -199,8 +199,8 @@ public virtual AsyncPageable GetAllAsync(CancellationTok /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _exportPipelineRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _exportPipelineRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage FirstPageRequest(int? pageSizeHint) => _exportPipelineRestClient.CreateListRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _exportPipelineRestClient.CreateListNextPageRequest(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ExportPipelineResource(Client, ExportPipelineData.DeserializeExportPipelineData(e)), _exportPipelineClientDiagnostics, Pipeline, "ExportPipelineCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -221,7 +221,7 @@ public virtual async Task> ExistsAsync(string exportPipelineName, scope.Start(); try { - var response = await _exportPipelineRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, exportPipelineName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _exportPipelineRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, exportPipelineName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -248,7 +248,7 @@ public virtual Response Exists(string exportPipelineName, CancellationToke scope.Start(); try { - var response = _exportPipelineRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, exportPipelineName, cancellationToken: cancellationToken); + var response = _exportPipelineRestClient.Get(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, exportPipelineName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ExportPipelineResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ExportPipelineResource.cs index 4851c90308e2..0959349e99f9 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ExportPipelineResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ExportPipelineResource.cs @@ -25,7 +25,7 @@ namespace Azure.ResourceManager.ContainerRegistry public partial class ExportPipelineResource : ArmResource { /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string exportPipelineName) + public static ResourceIdentifier CreateResourceIdentifier(Guid subscriptionId, string resourceGroupName, string registryName, string exportPipelineName) { var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName}"; return new ResourceIdentifier(resourceId); @@ -98,7 +98,7 @@ public virtual async Task> GetAsync(Cancellatio scope.Start(); try { - var response = await _exportPipelineRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _exportPipelineRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ExportPipelineResource(Client, response.Value), response.GetRawResponse()); @@ -122,7 +122,7 @@ public virtual Response Get(CancellationToken cancellati scope.Start(); try { - var response = _exportPipelineRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var response = _exportPipelineRestClient.Get(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ExportPipelineResource(Client, response.Value), response.GetRawResponse()); @@ -147,8 +147,8 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell scope.Start(); try { - var response = await _exportPipelineRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(_exportPipelineClientDiagnostics, Pipeline, _exportPipelineRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _exportPipelineRestClient.DeleteAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(_exportPipelineClientDiagnostics, Pipeline, _exportPipelineRestClient.CreateDeleteRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -173,8 +173,8 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel scope.Start(); try { - var response = _exportPipelineRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new ContainerRegistryArmOperation(_exportPipelineClientDiagnostics, Pipeline, _exportPipelineRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _exportPipelineRestClient.Delete(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new ContainerRegistryArmOperation(_exportPipelineClientDiagnostics, Pipeline, _exportPipelineRestClient.CreateDeleteRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -203,8 +203,8 @@ public virtual async Task> UpdateAsync(Wait scope.Start(); try { - var response = await _exportPipelineRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(new ExportPipelineOperationSource(Client), _exportPipelineClientDiagnostics, Pipeline, _exportPipelineRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + var response = await _exportPipelineRestClient.CreateAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ExportPipelineOperationSource(Client), _exportPipelineClientDiagnostics, Pipeline, _exportPipelineRestClient.CreateCreateRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -233,8 +233,8 @@ public virtual ArmOperation Update(WaitUntil waitUntil, scope.Start(); try { - var response = _exportPipelineRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); - var operation = new ContainerRegistryArmOperation(new ExportPipelineOperationSource(Client), _exportPipelineClientDiagnostics, Pipeline, _exportPipelineRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + var response = _exportPipelineRestClient.Create(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ExportPipelineOperationSource(Client), _exportPipelineClientDiagnostics, Pipeline, _exportPipelineRestClient.CreateCreateRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/ContainerRegistryExtensions.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/ContainerRegistryExtensions.cs index 5e56da20c441..45009f65f2c9 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/ContainerRegistryExtensions.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/ContainerRegistryExtensions.cs @@ -19,29 +19,80 @@ namespace Azure.ResourceManager.ContainerRegistry /// A class to add extension methods to Azure.ResourceManager.ContainerRegistry. public static partial class ContainerRegistryExtensions { - private static SubscriptionResourceExtensionClient GetExtensionClient(SubscriptionResource subscriptionResource) + private static TenantResourceExtensionClient GetExtensionClient(TenantResource tenantResource) { - return subscriptionResource.GetCachedClient((client) => + return tenantResource.GetCachedClient((client) => { - return new SubscriptionResourceExtensionClient(client, subscriptionResource.Id); + return new TenantResourceExtensionClient(client, tenantResource.Id); } ); } + /// Gets a collection of ContainerRegistryResources in the TenantResource. + /// The instance the method will execute against. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// is an empty string, and was expected to be non-empty. + /// is null. + /// An object representing collection of ContainerRegistryResources and their operations over a ContainerRegistryResource. + public static ContainerRegistryCollection GetContainerRegistries(this TenantResource tenantResource, Guid subscriptionId, string resourceGroupName) + { + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + return GetExtensionClient(tenantResource).GetContainerRegistries(subscriptionId, resourceGroupName); + } + + /// + /// Gets the properties of the specified container registry. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName} + /// Operation Id: Registries_Get + /// + /// The instance the method will execute against. + /// 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 container registry. + /// The cancellation token to use. + /// or is an empty string, and was expected to be non-empty. + /// or is null. + [ForwardsClientCalls] + public static async Task> GetContainerRegistryAsync(this TenantResource tenantResource, Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + { + return await tenantResource.GetContainerRegistries(subscriptionId, resourceGroupName).GetAsync(registryName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the properties of the specified container registry. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName} + /// Operation Id: Registries_Get + /// + /// The instance the method will execute against. + /// 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 container registry. + /// The cancellation token to use. + /// or is an empty string, and was expected to be non-empty. + /// or is null. + [ForwardsClientCalls] + public static Response GetContainerRegistry(this TenantResource tenantResource, Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + { + return tenantResource.GetContainerRegistries(subscriptionId, resourceGroupName).Get(registryName, cancellationToken); + } + /// /// Checks whether the container registry name is available for use. The name must contain only alphanumeric characters, be globally unique, and between 5 and 50 characters in length. /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/checkNameAvailability /// Operation Id: Registries_CheckNameAvailability /// - /// The instance the method will execute against. + /// The instance the method will execute against. + /// The ID of the target subscription. The value must be an UUID. /// The object containing information for the availability request. /// The cancellation token to use. /// is null. - public static async Task> CheckContainerRegistryNameAvailabilityAsync(this SubscriptionResource subscriptionResource, ContainerRegistryNameAvailabilityContent content, CancellationToken cancellationToken = default) + public static async Task> CheckContainerRegistryNameAvailabilityAsync(this TenantResource tenantResource, Guid subscriptionId, ContainerRegistryNameAvailabilityContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(content, nameof(content)); - return await GetExtensionClient(subscriptionResource).CheckContainerRegistryNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); + return await GetExtensionClient(tenantResource).CheckContainerRegistryNameAvailabilityAsync(subscriptionId, content, cancellationToken).ConfigureAwait(false); } /// @@ -49,15 +100,16 @@ public static async Task> CheckCo /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/checkNameAvailability /// Operation Id: Registries_CheckNameAvailability /// - /// The instance the method will execute against. + /// The instance the method will execute against. + /// The ID of the target subscription. The value must be an UUID. /// The object containing information for the availability request. /// The cancellation token to use. /// is null. - public static Response CheckContainerRegistryNameAvailability(this SubscriptionResource subscriptionResource, ContainerRegistryNameAvailabilityContent content, CancellationToken cancellationToken = default) + public static Response CheckContainerRegistryNameAvailability(this TenantResource tenantResource, Guid subscriptionId, ContainerRegistryNameAvailabilityContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(content, nameof(content)); - return GetExtensionClient(subscriptionResource).CheckContainerRegistryNameAvailability(content, cancellationToken); + return GetExtensionClient(tenantResource).CheckContainerRegistryNameAvailability(subscriptionId, content, cancellationToken); } /// @@ -65,12 +117,12 @@ public static Response CheckContainerRegis /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/registries /// Operation Id: Registries_List /// - /// The instance the method will execute against. + /// The instance the method will execute against. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetContainerRegistriesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + public static AsyncPageable GetContainerRegistriesAsync(this TenantResource tenantResource, CancellationToken cancellationToken = default) { - return GetExtensionClient(subscriptionResource).GetContainerRegistriesAsync(cancellationToken); + return GetExtensionClient(tenantResource).GetContainerRegistriesAsync(cancellationToken); } /// @@ -78,62 +130,32 @@ public static AsyncPageable GetContainerRegistriesAsy /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/registries /// Operation Id: Registries_List /// - /// The instance the method will execute against. + /// The instance the method will execute against. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetContainerRegistries(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + public static Pageable GetContainerRegistries(this TenantResource tenantResource, CancellationToken cancellationToken = default) { - return GetExtensionClient(subscriptionResource).GetContainerRegistries(cancellationToken); + return GetExtensionClient(tenantResource).GetContainerRegistries(cancellationToken); } - private static ResourceGroupResourceExtensionClient GetExtensionClient(ResourceGroupResource resourceGroupResource) + #region CacheRuleResource + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static CacheRuleResource GetCacheRuleResource(this ArmClient client, ResourceIdentifier id) { - return resourceGroupResource.GetCachedClient((client) => + return client.GetResourceClient(() => { - return new ResourceGroupResourceExtensionClient(client, resourceGroupResource.Id); + CacheRuleResource.ValidateResourceId(id); + return new CacheRuleResource(client, id); } ); } - - /// Gets a collection of ContainerRegistryResources in the ResourceGroupResource. - /// The instance the method will execute against. - /// An object representing collection of ContainerRegistryResources and their operations over a ContainerRegistryResource. - public static ContainerRegistryCollection GetContainerRegistries(this ResourceGroupResource resourceGroupResource) - { - return GetExtensionClient(resourceGroupResource).GetContainerRegistries(); - } - - /// - /// Gets the properties of the specified container registry. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName} - /// Operation Id: Registries_Get - /// - /// The instance the method will execute against. - /// The name of the container registry. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static async Task> GetContainerRegistryAsync(this ResourceGroupResource resourceGroupResource, string registryName, CancellationToken cancellationToken = default) - { - return await resourceGroupResource.GetContainerRegistries().GetAsync(registryName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets the properties of the specified container registry. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName} - /// Operation Id: Registries_Get - /// - /// The instance the method will execute against. - /// The name of the container registry. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static Response GetContainerRegistry(this ResourceGroupResource resourceGroupResource, string registryName, CancellationToken cancellationToken = default) - { - return resourceGroupResource.GetContainerRegistries().Get(registryName, cancellationToken); - } + #endregion #region ConnectedRegistryResource /// @@ -154,6 +176,25 @@ public static ConnectedRegistryResource GetConnectedRegistryResource(this ArmCli } #endregion + #region CredentialSetResource + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static CredentialSetResource GetCredentialSetResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + CredentialSetResource.ValidateResourceId(id); + return new CredentialSetResource(client, id); + } + ); + } + #endregion + #region ExportPipelineResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs deleted file mode 100644 index d33b5d4a11ee..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.ContainerRegistry -{ - /// A class to add extension methods to ResourceGroupResource. - internal partial class ResourceGroupResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ResourceGroupResourceExtensionClient() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of ContainerRegistryResources in the ResourceGroupResource. - /// An object representing collection of ContainerRegistryResources and their operations over a ContainerRegistryResource. - public virtual ContainerRegistryCollection GetContainerRegistries() - { - return GetCachedClient(Client => new ContainerRegistryCollection(Client, Id)); - } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/TenantResourceExtensionClient.cs similarity index 62% rename from sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs rename to sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/TenantResourceExtensionClient.cs index 698f672bc79d..d04c17e8e85f 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/TenantResourceExtensionClient.cs @@ -16,24 +16,28 @@ namespace Azure.ResourceManager.ContainerRegistry { - /// A class to add extension methods to SubscriptionResource. - internal partial class SubscriptionResourceExtensionClient : ArmResource + /// A class to add extension methods to TenantResource. + internal partial class TenantResourceExtensionClient : ArmResource { + private ClientDiagnostics _registriesClientDiagnostics; + private RegistriesRestOperations _registriesRestClient; private ClientDiagnostics _containerRegistryRegistriesClientDiagnostics; private RegistriesRestOperations _containerRegistryRegistriesRestClient; - /// Initializes a new instance of the class for mocking. - protected SubscriptionResourceExtensionClient() + /// Initializes a new instance of the class for mocking. + protected TenantResourceExtensionClient() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The identifier of the resource that is the target of operations. - internal SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) + internal TenantResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) { } + private ClientDiagnostics RegistriesClientDiagnostics => _registriesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ContainerRegistry", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private RegistriesRestOperations RegistriesRestClient => _registriesRestClient ??= new RegistriesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); private ClientDiagnostics ContainerRegistryRegistriesClientDiagnostics => _containerRegistryRegistriesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ContainerRegistry", ContainerRegistryResource.ResourceType.Namespace, Diagnostics); private RegistriesRestOperations ContainerRegistryRegistriesRestClient => _containerRegistryRegistriesRestClient ??= new RegistriesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(ContainerRegistryResource.ResourceType)); @@ -43,20 +47,30 @@ private string GetApiVersionOrNull(ResourceType resourceType) return apiVersion; } + /// Gets a collection of ContainerRegistryResources in the TenantResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// An object representing collection of ContainerRegistryResources and their operations over a ContainerRegistryResource. + public virtual ContainerRegistryCollection GetContainerRegistries(Guid subscriptionId, string resourceGroupName) + { + return new ContainerRegistryCollection(Client, Id, subscriptionId, resourceGroupName); + } + /// /// Checks whether the container registry name is available for use. The name must contain only alphanumeric characters, be globally unique, and between 5 and 50 characters in length. /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/checkNameAvailability /// Operation Id: Registries_CheckNameAvailability /// + /// The ID of the target subscription. The value must be an UUID. /// The object containing information for the availability request. /// The cancellation token to use. - public virtual async Task> CheckContainerRegistryNameAvailabilityAsync(ContainerRegistryNameAvailabilityContent content, CancellationToken cancellationToken = default) + public virtual async Task> CheckContainerRegistryNameAvailabilityAsync(Guid subscriptionId, ContainerRegistryNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = ContainerRegistryRegistriesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckContainerRegistryNameAvailability"); + using var scope = RegistriesClientDiagnostics.CreateScope("TenantResourceExtensionClient.CheckContainerRegistryNameAvailability"); scope.Start(); try { - var response = await ContainerRegistryRegistriesRestClient.CheckNameAvailabilityAsync(Id.SubscriptionId, content, cancellationToken).ConfigureAwait(false); + var response = await RegistriesRestClient.CheckNameAvailabilityAsync(subscriptionId, content, cancellationToken).ConfigureAwait(false); return response; } catch (Exception e) @@ -71,15 +85,16 @@ public virtual async Task> CheckC /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/checkNameAvailability /// Operation Id: Registries_CheckNameAvailability /// + /// The ID of the target subscription. The value must be an UUID. /// The object containing information for the availability request. /// The cancellation token to use. - public virtual Response CheckContainerRegistryNameAvailability(ContainerRegistryNameAvailabilityContent content, CancellationToken cancellationToken = default) + public virtual Response CheckContainerRegistryNameAvailability(Guid subscriptionId, ContainerRegistryNameAvailabilityContent content, CancellationToken cancellationToken = default) { - using var scope = ContainerRegistryRegistriesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.CheckContainerRegistryNameAvailability"); + using var scope = RegistriesClientDiagnostics.CreateScope("TenantResourceExtensionClient.CheckContainerRegistryNameAvailability"); scope.Start(); try { - var response = ContainerRegistryRegistriesRestClient.CheckNameAvailability(Id.SubscriptionId, content, cancellationToken); + var response = RegistriesRestClient.CheckNameAvailability(subscriptionId, content, cancellationToken); return response; } catch (Exception e) @@ -98,9 +113,9 @@ public virtual Response CheckContainerRegi /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetContainerRegistriesAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => ContainerRegistryRegistriesRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ContainerRegistryRegistriesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryResource(Client, ContainerRegistryData.DeserializeContainerRegistryData(e)), ContainerRegistryRegistriesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetContainerRegistries", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => ContainerRegistryRegistriesRestClient.CreateListRequest(Guid.Parse(_subscriptionId)); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ContainerRegistryRegistriesRestClient.CreateListNextPageRequest(nextLink, Guid.Parse(_subscriptionId)); + return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryResource(Client, ContainerRegistryData.DeserializeContainerRegistryData(e)), ContainerRegistryRegistriesClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetContainerRegistries", "value", "nextLink", cancellationToken); } /// @@ -112,9 +127,9 @@ public virtual AsyncPageable GetContainerRegistriesAs /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetContainerRegistries(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => ContainerRegistryRegistriesRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ContainerRegistryRegistriesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryResource(Client, ContainerRegistryData.DeserializeContainerRegistryData(e)), ContainerRegistryRegistriesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetContainerRegistries", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => ContainerRegistryRegistriesRestClient.CreateListRequest(Guid.Parse(_subscriptionId)); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ContainerRegistryRegistriesRestClient.CreateListNextPageRequest(nextLink, Guid.Parse(_subscriptionId)); + return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerRegistryResource(Client, ContainerRegistryData.DeserializeContainerRegistryData(e)), ContainerRegistryRegistriesClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetContainerRegistries", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ImportPipelineCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ImportPipelineCollection.cs index 8e4061414b70..636ccd92639c 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ImportPipelineCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ImportPipelineCollection.cs @@ -72,8 +72,8 @@ public virtual async Task> CreateOrUpdateAs scope.Start(); try { - var response = await _importPipelineRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, importPipelineName, data, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(new ImportPipelineOperationSource(Client), _importPipelineClientDiagnostics, Pipeline, _importPipelineRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, importPipelineName, data).Request, response, OperationFinalStateVia.Location); + var response = await _importPipelineRestClient.CreateAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, importPipelineName, data, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ImportPipelineOperationSource(Client), _importPipelineClientDiagnostics, Pipeline, _importPipelineRestClient.CreateCreateRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, importPipelineName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -105,8 +105,8 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wai scope.Start(); try { - var response = _importPipelineRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, importPipelineName, data, cancellationToken); - var operation = new ContainerRegistryArmOperation(new ImportPipelineOperationSource(Client), _importPipelineClientDiagnostics, Pipeline, _importPipelineRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, importPipelineName, data).Request, response, OperationFinalStateVia.Location); + var response = _importPipelineRestClient.Create(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, importPipelineName, data, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ImportPipelineOperationSource(Client), _importPipelineClientDiagnostics, Pipeline, _importPipelineRestClient.CreateCreateRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, importPipelineName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -135,7 +135,7 @@ public virtual async Task> GetAsync(string impo scope.Start(); try { - var response = await _importPipelineRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, importPipelineName, cancellationToken).ConfigureAwait(false); + var response = await _importPipelineRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, importPipelineName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ImportPipelineResource(Client, response.Value), response.GetRawResponse()); @@ -164,7 +164,7 @@ public virtual Response Get(string importPipelineName, C scope.Start(); try { - var response = _importPipelineRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, importPipelineName, cancellationToken); + var response = _importPipelineRestClient.Get(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, importPipelineName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ImportPipelineResource(Client, response.Value), response.GetRawResponse()); @@ -185,8 +185,8 @@ public virtual Response Get(string importPipelineName, C /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _importPipelineRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _importPipelineRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage FirstPageRequest(int? pageSizeHint) => _importPipelineRestClient.CreateListRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _importPipelineRestClient.CreateListNextPageRequest(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ImportPipelineResource(Client, ImportPipelineData.DeserializeImportPipelineData(e)), _importPipelineClientDiagnostics, Pipeline, "ImportPipelineCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -199,8 +199,8 @@ public virtual AsyncPageable GetAllAsync(CancellationTok /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _importPipelineRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _importPipelineRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage FirstPageRequest(int? pageSizeHint) => _importPipelineRestClient.CreateListRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _importPipelineRestClient.CreateListNextPageRequest(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ImportPipelineResource(Client, ImportPipelineData.DeserializeImportPipelineData(e)), _importPipelineClientDiagnostics, Pipeline, "ImportPipelineCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -221,7 +221,7 @@ public virtual async Task> ExistsAsync(string importPipelineName, scope.Start(); try { - var response = await _importPipelineRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, importPipelineName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _importPipelineRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, importPipelineName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -248,7 +248,7 @@ public virtual Response Exists(string importPipelineName, CancellationToke scope.Start(); try { - var response = _importPipelineRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, importPipelineName, cancellationToken: cancellationToken); + var response = _importPipelineRestClient.Get(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, importPipelineName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ImportPipelineResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ImportPipelineResource.cs index 8c18ae50ebaa..bd2335d76294 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ImportPipelineResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ImportPipelineResource.cs @@ -25,7 +25,7 @@ namespace Azure.ResourceManager.ContainerRegistry public partial class ImportPipelineResource : ArmResource { /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string importPipelineName) + public static ResourceIdentifier CreateResourceIdentifier(Guid subscriptionId, string resourceGroupName, string registryName, string importPipelineName) { var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName}"; return new ResourceIdentifier(resourceId); @@ -98,7 +98,7 @@ public virtual async Task> GetAsync(Cancellatio scope.Start(); try { - var response = await _importPipelineRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _importPipelineRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ImportPipelineResource(Client, response.Value), response.GetRawResponse()); @@ -122,7 +122,7 @@ public virtual Response Get(CancellationToken cancellati scope.Start(); try { - var response = _importPipelineRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var response = _importPipelineRestClient.Get(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ImportPipelineResource(Client, response.Value), response.GetRawResponse()); @@ -147,8 +147,8 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell scope.Start(); try { - var response = await _importPipelineRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(_importPipelineClientDiagnostics, Pipeline, _importPipelineRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _importPipelineRestClient.DeleteAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(_importPipelineClientDiagnostics, Pipeline, _importPipelineRestClient.CreateDeleteRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -173,8 +173,8 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel scope.Start(); try { - var response = _importPipelineRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new ContainerRegistryArmOperation(_importPipelineClientDiagnostics, Pipeline, _importPipelineRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _importPipelineRestClient.Delete(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new ContainerRegistryArmOperation(_importPipelineClientDiagnostics, Pipeline, _importPipelineRestClient.CreateDeleteRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -203,8 +203,8 @@ public virtual async Task> UpdateAsync(Wait scope.Start(); try { - var response = await _importPipelineRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(new ImportPipelineOperationSource(Client), _importPipelineClientDiagnostics, Pipeline, _importPipelineRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + var response = await _importPipelineRestClient.CreateAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ImportPipelineOperationSource(Client), _importPipelineClientDiagnostics, Pipeline, _importPipelineRestClient.CreateCreateRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -233,8 +233,8 @@ public virtual ArmOperation Update(WaitUntil waitUntil, scope.Start(); try { - var response = _importPipelineRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); - var operation = new ContainerRegistryArmOperation(new ImportPipelineOperationSource(Client), _importPipelineClientDiagnostics, Pipeline, _importPipelineRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + var response = _importPipelineRestClient.Create(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ImportPipelineOperationSource(Client), _importPipelineClientDiagnostics, Pipeline, _importPipelineRestClient.CreateCreateRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/CacheRuleOperationSource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/CacheRuleOperationSource.cs new file mode 100644 index 000000000000..7d57a7cbb0f6 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/CacheRuleOperationSource.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.ContainerRegistry +{ + internal class CacheRuleOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal CacheRuleOperationSource(ArmClient client) + { + _client = client; + } + + CacheRuleResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = CacheRuleData.DeserializeCacheRuleData(document.RootElement); + return new CacheRuleResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = CacheRuleData.DeserializeCacheRuleData(document.RootElement); + return new CacheRuleResource(_client, data); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/CredentialSetOperationSource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/CredentialSetOperationSource.cs new file mode 100644 index 000000000000..526cb0827cb5 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/CredentialSetOperationSource.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.ContainerRegistry +{ + internal class CredentialSetOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal CredentialSetOperationSource(ArmClient client) + { + _client = client; + } + + CredentialSetResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = CredentialSetData.DeserializeCredentialSetData(document.RootElement); + return new CredentialSetResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = CredentialSetData.DeserializeCredentialSetData(document.RootElement); + return new CredentialSetResource(_client, data); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/AuthCredential.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/AuthCredential.Serialization.cs new file mode 100644 index 000000000000..b57c6cc9586a --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/AuthCredential.Serialization.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + public partial class AuthCredential : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"); + writer.WriteStringValue(Name.Value.ToString()); + } + if (Optional.IsDefined(UsernameSecretIdentifier)) + { + writer.WritePropertyName("usernameSecretIdentifier"); + writer.WriteStringValue(UsernameSecretIdentifier); + } + if (Optional.IsDefined(PasswordSecretIdentifier)) + { + writer.WritePropertyName("passwordSecretIdentifier"); + writer.WriteStringValue(PasswordSecretIdentifier); + } + writer.WriteEndObject(); + } + + internal static AuthCredential DeserializeAuthCredential(JsonElement element) + { + Optional name = default; + Optional usernameSecretIdentifier = default; + Optional passwordSecretIdentifier = default; + Optional credentialHealth = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + name = new CredentialName(property.Value.GetString()); + continue; + } + if (property.NameEquals("usernameSecretIdentifier")) + { + usernameSecretIdentifier = property.Value.GetString(); + continue; + } + if (property.NameEquals("passwordSecretIdentifier")) + { + passwordSecretIdentifier = property.Value.GetString(); + continue; + } + if (property.NameEquals("credentialHealth")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + credentialHealth = CredentialHealth.DeserializeCredentialHealth(property.Value); + continue; + } + } + return new AuthCredential(Optional.ToNullable(name), usernameSecretIdentifier.Value, passwordSecretIdentifier.Value, credentialHealth.Value); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/AuthCredential.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/AuthCredential.cs new file mode 100644 index 000000000000..6f9fb58440b4 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/AuthCredential.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// Authentication credential stored for an upstream. + public partial class AuthCredential + { + /// Initializes a new instance of AuthCredential. + public AuthCredential() + { + } + + /// Initializes a new instance of AuthCredential. + /// The name of the credential. + /// KeyVault Secret URI for accessing the username. + /// KeyVault Secret URI for accessing the password. + /// This provides data pertaining to the health of the auth credential. + internal AuthCredential(CredentialName? name, string usernameSecretIdentifier, string passwordSecretIdentifier, CredentialHealth credentialHealth) + { + Name = name; + UsernameSecretIdentifier = usernameSecretIdentifier; + PasswordSecretIdentifier = passwordSecretIdentifier; + CredentialHealth = credentialHealth; + } + + /// The name of the credential. + public CredentialName? Name { get; set; } + /// KeyVault Secret URI for accessing the username. + public string UsernameSecretIdentifier { get; set; } + /// KeyVault Secret URI for accessing the password. + public string PasswordSecretIdentifier { get; set; } + /// This provides data pertaining to the health of the auth credential. + public CredentialHealth CredentialHealth { get; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CacheRuleData.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CacheRuleData.Serialization.cs new file mode 100644 index 000000000000..e57996601aaf --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CacheRuleData.Serialization.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.ContainerRegistry.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + public partial class CacheRuleData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(CredentialSetResourceId)) + { + writer.WritePropertyName("credentialSetResourceId"); + writer.WriteStringValue(CredentialSetResourceId); + } + if (Optional.IsDefined(SourceRepository)) + { + writer.WritePropertyName("sourceRepository"); + writer.WriteStringValue(SourceRepository); + } + if (Optional.IsDefined(TargetRepository)) + { + writer.WritePropertyName("targetRepository"); + writer.WriteStringValue(TargetRepository); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static CacheRuleData DeserializeCacheRuleData(JsonElement element) + { + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + Optional credentialSetResourceId = default; + Optional sourceRepository = default; + Optional targetRepository = default; + Optional creationDate = default; + Optional provisioningState = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id")) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("credentialSetResourceId")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + credentialSetResourceId = new ResourceIdentifier(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("sourceRepository")) + { + sourceRepository = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("targetRepository")) + { + targetRepository = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("creationDate")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + creationDate = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("provisioningState")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + provisioningState = new ContainerRegistryProvisioningState(property0.Value.GetString()); + continue; + } + } + continue; + } + } + return new CacheRuleData(id, name, type, systemData.Value, credentialSetResourceId.Value, sourceRepository.Value, targetRepository.Value, Optional.ToNullable(creationDate), Optional.ToNullable(provisioningState)); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CacheRulePatch.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CacheRulePatch.Serialization.cs new file mode 100644 index 000000000000..354e61eacb57 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CacheRulePatch.Serialization.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + public partial class CacheRulePatch : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(CredentialSetResourceId)) + { + writer.WritePropertyName("credentialSetResourceId"); + writer.WriteStringValue(CredentialSetResourceId); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CacheRulePatch.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CacheRulePatch.cs new file mode 100644 index 000000000000..8dbedecbdd0f --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CacheRulePatch.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The parameters for updating a cache rule. + public partial class CacheRulePatch + { + /// Initializes a new instance of CacheRulePatch. + public CacheRulePatch() + { + } + + /// The ARM resource ID of the credential store which is associated with the Cache rule. + public ResourceIdentifier CredentialSetResourceId { get; set; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CacheRulesListResult.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CacheRulesListResult.Serialization.cs new file mode 100644 index 000000000000..0bfd57d9fe20 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CacheRulesListResult.Serialization.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.ContainerRegistry; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + internal partial class CacheRulesListResult + { + internal static CacheRulesListResult DeserializeCacheRulesListResult(JsonElement element) + { + Optional> value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CacheRuleData.DeserializeCacheRuleData(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new CacheRulesListResult(Optional.ToList(value), nextLink.Value); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CacheRulesListResult.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CacheRulesListResult.cs new file mode 100644 index 000000000000..19c2ec80a428 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CacheRulesListResult.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.ContainerRegistry; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The result of a request to list cache rules for a container registry. + internal partial class CacheRulesListResult + { + /// Initializes a new instance of CacheRulesListResult. + internal CacheRulesListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of CacheRulesListResult. + /// The list of cache rules. + /// If provided, client must use NextLink URI to request next list of cache rules. + internal CacheRulesListResult(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// The list of cache rules. + public IReadOnlyList Value { get; } + /// If provided, client must use NextLink URI to request next list of cache rules. + public string NextLink { get; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CredentialHealth.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CredentialHealth.Serialization.cs new file mode 100644 index 000000000000..c8afadc4ac43 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CredentialHealth.Serialization.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + public partial class CredentialHealth + { + internal static CredentialHealth DeserializeCredentialHealth(JsonElement element) + { + Optional status = default; + Optional errorCode = default; + Optional errorMessage = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("status")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + status = new CredentialHealthStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("errorCode")) + { + errorCode = property.Value.GetString(); + continue; + } + if (property.NameEquals("errorMessage")) + { + errorMessage = property.Value.GetString(); + continue; + } + } + return new CredentialHealth(Optional.ToNullable(status), errorCode.Value, errorMessage.Value); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CredentialHealth.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CredentialHealth.cs new file mode 100644 index 000000000000..62727b4bcf71 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CredentialHealth.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The health of the auth credential. + public partial class CredentialHealth + { + /// Initializes a new instance of CredentialHealth. + internal CredentialHealth() + { + } + + /// Initializes a new instance of CredentialHealth. + /// The health status of credential. + /// Error code representing the health check error. + /// Descriptive message representing the health check error. + internal CredentialHealth(CredentialHealthStatus? status, string errorCode, string errorMessage) + { + Status = status; + ErrorCode = errorCode; + ErrorMessage = errorMessage; + } + + /// The health status of credential. + public CredentialHealthStatus? Status { get; } + /// Error code representing the health check error. + public string ErrorCode { get; } + /// Descriptive message representing the health check error. + public string ErrorMessage { get; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CredentialHealthStatus.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CredentialHealthStatus.cs new file mode 100644 index 000000000000..f1b4682d030c --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CredentialHealthStatus.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The health status of credential. + public readonly partial struct CredentialHealthStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CredentialHealthStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string HealthyValue = "Healthy"; + private const string UnhealthyValue = "Unhealthy"; + + /// Healthy. + public static CredentialHealthStatus Healthy { get; } = new CredentialHealthStatus(HealthyValue); + /// Unhealthy. + public static CredentialHealthStatus Unhealthy { get; } = new CredentialHealthStatus(UnhealthyValue); + /// Determines if two values are the same. + public static bool operator ==(CredentialHealthStatus left, CredentialHealthStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CredentialHealthStatus left, CredentialHealthStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator CredentialHealthStatus(string value) => new CredentialHealthStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CredentialHealthStatus other && Equals(other); + /// + public bool Equals(CredentialHealthStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CredentialName.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CredentialName.cs new file mode 100644 index 000000000000..2ca1d7ab5ee9 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CredentialName.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The name of the credential. + public readonly partial struct CredentialName : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CredentialName(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string Credential1Value = "Credential1"; + + /// Credential1. + public static CredentialName Credential1 { get; } = new CredentialName(Credential1Value); + /// Determines if two values are the same. + public static bool operator ==(CredentialName left, CredentialName right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CredentialName left, CredentialName right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator CredentialName(string value) => new CredentialName(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CredentialName other && Equals(other); + /// + public bool Equals(CredentialName other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CredentialSetData.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CredentialSetData.Serialization.cs new file mode 100644 index 000000000000..114a227fc1c5 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CredentialSetData.Serialization.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.ContainerRegistry.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + public partial class CredentialSetData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"); + JsonSerializer.Serialize(writer, Identity); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsDefined(LoginServer)) + { + writer.WritePropertyName("loginServer"); + writer.WriteStringValue(LoginServer); + } + if (Optional.IsCollectionDefined(AuthCredentials)) + { + writer.WritePropertyName("authCredentials"); + writer.WriteStartArray(); + foreach (var item in AuthCredentials) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static CredentialSetData DeserializeCredentialSetData(JsonElement element) + { + Optional identity = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + Optional loginServer = default; + Optional> authCredentials = default; + Optional creationDate = default; + Optional provisioningState = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("identity")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + identity = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("id")) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type")) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("loginServer")) + { + loginServer = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("authCredentials")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(AuthCredential.DeserializeAuthCredential(item)); + } + authCredentials = array; + continue; + } + if (property0.NameEquals("creationDate")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + creationDate = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("provisioningState")) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + provisioningState = new ContainerRegistryProvisioningState(property0.Value.GetString()); + continue; + } + } + continue; + } + } + return new CredentialSetData(id, name, type, systemData.Value, identity, loginServer.Value, Optional.ToList(authCredentials), Optional.ToNullable(creationDate), Optional.ToNullable(provisioningState)); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CredentialSetListResult.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CredentialSetListResult.Serialization.cs new file mode 100644 index 000000000000..088208de4a39 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CredentialSetListResult.Serialization.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.ContainerRegistry; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + internal partial class CredentialSetListResult + { + internal static CredentialSetListResult DeserializeCredentialSetListResult(JsonElement element) + { + Optional> value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CredentialSetData.DeserializeCredentialSetData(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new CredentialSetListResult(Optional.ToList(value), nextLink.Value); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CredentialSetListResult.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CredentialSetListResult.cs new file mode 100644 index 000000000000..ec70dfc078c1 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CredentialSetListResult.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.ContainerRegistry; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The result of a request to list credential sets for a container registry. + internal partial class CredentialSetListResult + { + /// Initializes a new instance of CredentialSetListResult. + internal CredentialSetListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of CredentialSetListResult. + /// The list of credential sets. Since this list may be incomplete, the nextLink field should be used to request the next list of credential sets. + /// The URI that can be used to request the next list of credential sets. + internal CredentialSetListResult(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// The list of credential sets. Since this list may be incomplete, the nextLink field should be used to request the next list of credential sets. + public IReadOnlyList Value { get; } + /// The URI that can be used to request the next list of credential sets. + public string NextLink { get; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CredentialSetPatch.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CredentialSetPatch.Serialization.cs new file mode 100644 index 000000000000..fb424c201818 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CredentialSetPatch.Serialization.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + public partial class CredentialSetPatch : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"); + JsonSerializer.Serialize(writer, Identity); + } + writer.WritePropertyName("properties"); + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(AuthCredentials)) + { + writer.WritePropertyName("authCredentials"); + writer.WriteStartArray(); + foreach (var item in AuthCredentials) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CredentialSetPatch.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CredentialSetPatch.cs new file mode 100644 index 000000000000..94b3c93c9743 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/CredentialSetPatch.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerRegistry.Models +{ + /// The parameters for updating a credential set. + public partial class CredentialSetPatch + { + /// Initializes a new instance of CredentialSetPatch. + public CredentialSetPatch() + { + AuthCredentials = new ChangeTrackingList(); + } + + /// Identities associated with the resource. This is used to access the KeyVault secrets. + public ManagedServiceIdentity Identity { get; set; } + /// + /// List of authentication credentials stored for an upstream. + /// Usually consists of a primary and an optional secondary credential. + /// + public IList AuthCredentials { get; } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/AgentPoolsRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/AgentPoolsRestOperations.cs index 40ea51c9a021..7bbe36bc0997 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/AgentPoolsRestOperations.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/AgentPoolsRestOperations.cs @@ -37,7 +37,7 @@ public AgentPoolsRestOperations(HttpPipeline pipeline, string applicationId, Uri _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string registryName, string agentPoolName) + internal HttpMessage CreateGetRequest(Guid subscriptionId, string resourceGroupName, string registryName, string agentPoolName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -60,16 +60,15 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Gets the detailed information for a given agent pool. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The name of the agent pool. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string registryName, string agentPoolName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(Guid subscriptionId, string resourceGroupName, string registryName, string agentPoolName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); @@ -93,16 +92,15 @@ public async Task> GetAsync(string subs } /// Gets the detailed information for a given agent pool. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The name of the agent pool. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string registryName, string agentPoolName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(Guid subscriptionId, string resourceGroupName, string registryName, string agentPoolName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); @@ -125,7 +123,7 @@ public Response Get(string subscriptionId, strin } } - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string registryName, string agentPoolName, ContainerRegistryAgentPoolData data) + internal HttpMessage CreateCreateRequest(Guid subscriptionId, string resourceGroupName, string registryName, string agentPoolName, ContainerRegistryAgentPoolData data) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -152,17 +150,16 @@ internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceG } /// Creates an agent pool for a container registry with the specified parameters. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The name of the agent pool. /// The parameters of an agent pool that needs to scheduled. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task CreateAsync(string subscriptionId, string resourceGroupName, string registryName, string agentPoolName, ContainerRegistryAgentPoolData data, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(Guid subscriptionId, string resourceGroupName, string registryName, string agentPoolName, ContainerRegistryAgentPoolData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); @@ -181,17 +178,16 @@ public async Task CreateAsync(string subscriptionId, string resourceGr } /// Creates an agent pool for a container registry with the specified parameters. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The name of the agent pool. /// The parameters of an agent pool that needs to scheduled. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string registryName, string agentPoolName, ContainerRegistryAgentPoolData data, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Create(Guid subscriptionId, string resourceGroupName, string registryName, string agentPoolName, ContainerRegistryAgentPoolData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); @@ -209,7 +205,7 @@ public Response Create(string subscriptionId, string resourceGroupName, string r } } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string registryName, string agentPoolName) + internal HttpMessage CreateDeleteRequest(Guid subscriptionId, string resourceGroupName, string registryName, string agentPoolName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -232,16 +228,15 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Deletes a specified agent pool resource. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The name of the agent pool. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string registryName, string agentPoolName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(Guid subscriptionId, string resourceGroupName, string registryName, string agentPoolName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); @@ -260,16 +255,15 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Deletes a specified agent pool resource. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The name of the agent pool. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string registryName, string agentPoolName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(Guid subscriptionId, string resourceGroupName, string registryName, string agentPoolName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); @@ -287,7 +281,7 @@ public Response Delete(string subscriptionId, string resourceGroupName, string r } } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string registryName, string agentPoolName, ContainerRegistryAgentPoolPatch patch) + internal HttpMessage CreateUpdateRequest(Guid subscriptionId, string resourceGroupName, string registryName, string agentPoolName, ContainerRegistryAgentPoolPatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -314,17 +308,16 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG } /// Updates an agent pool with the specified parameters. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The name of the agent pool. /// The parameters for updating an agent pool. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string registryName, string agentPoolName, ContainerRegistryAgentPoolPatch patch, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(Guid subscriptionId, string resourceGroupName, string registryName, string agentPoolName, ContainerRegistryAgentPoolPatch patch, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); @@ -343,17 +336,16 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr } /// Updates an agent pool with the specified parameters. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The name of the agent pool. /// The parameters for updating an agent pool. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string registryName, string agentPoolName, ContainerRegistryAgentPoolPatch patch, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(Guid subscriptionId, string resourceGroupName, string registryName, string agentPoolName, ContainerRegistryAgentPoolPatch patch, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); @@ -371,7 +363,7 @@ public Response Update(string subscriptionId, string resourceGroupName, string r } } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string registryName) + internal HttpMessage CreateListRequest(Guid subscriptionId, string resourceGroupName, string registryName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -393,15 +385,14 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// Lists all the agent pools for a specified container registry. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -422,15 +413,14 @@ public async Task> ListAsync(stri } /// Lists all the agent pools for a specified container registry. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response List(Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -450,7 +440,7 @@ public Response List(string subscriptionId } } - internal HttpMessage CreateGetQueueStatusRequest(string subscriptionId, string resourceGroupName, string registryName, string agentPoolName) + internal HttpMessage CreateGetQueueStatusRequest(Guid subscriptionId, string resourceGroupName, string registryName, string agentPoolName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -474,16 +464,15 @@ internal HttpMessage CreateGetQueueStatusRequest(string subscriptionId, string r } /// Gets the count of queued runs for a given agent pool. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The name of the agent pool. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetQueueStatusAsync(string subscriptionId, string resourceGroupName, string registryName, string agentPoolName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetQueueStatusAsync(Guid subscriptionId, string resourceGroupName, string registryName, string agentPoolName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); @@ -505,16 +494,15 @@ public async Task> GetQueueStatu } /// Gets the count of queued runs for a given agent pool. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The name of the agent pool. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response GetQueueStatus(string subscriptionId, string resourceGroupName, string registryName, string agentPoolName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response GetQueueStatus(Guid subscriptionId, string resourceGroupName, string registryName, string agentPoolName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName)); @@ -535,7 +523,7 @@ public Response GetQueueStatus(string sub } } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string registryName) + internal HttpMessage CreateListNextPageRequest(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -551,16 +539,15 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Lists all the agent pools for a specified container registry. /// The URL to the next page of results. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -582,16 +569,15 @@ public async Task> ListNextPageAs /// Lists all the agent pools for a specified container registry. /// The URL to the next page of results. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/BuildsRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/BuildsRestOperations.cs index 895914b88098..c3e7d8dc5417 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/BuildsRestOperations.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/BuildsRestOperations.cs @@ -37,7 +37,7 @@ public BuildsRestOperations(HttpPipeline pipeline, string applicationId, Uri end _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal HttpMessage CreateGetBuildSourceUploadUrlRequest(string subscriptionId, string resourceGroupName, string registryName) + internal HttpMessage CreateGetBuildSourceUploadUrlRequest(Guid subscriptionId, string resourceGroupName, string registryName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -59,15 +59,14 @@ internal HttpMessage CreateGetBuildSourceUploadUrlRequest(string subscriptionId, } /// Get the upload location for the user to be able to upload the source. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> GetBuildSourceUploadUrlAsync(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> GetBuildSourceUploadUrlAsync(Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -88,15 +87,14 @@ public async Task> GetBuildSourceUploadUrlAsync } /// Get the upload location for the user to be able to upload the source. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response GetBuildSourceUploadUrl(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response GetBuildSourceUploadUrl(Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CacheRulesRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CacheRulesRestOperations.cs new file mode 100644 index 000000000000..31fb3c6ad129 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CacheRulesRestOperations.cs @@ -0,0 +1,517 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ContainerRegistry.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + internal partial class CacheRulesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of CacheRulesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public CacheRulesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-01-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateListRequest(Guid subscriptionId, string resourceGroupName, string registryName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/cacheRules", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all cache rule resources for the specified container registry. + /// 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 container registry. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CacheRulesListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CacheRulesListResult.DeserializeCacheRulesListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all cache rule resources for the specified container registry. + /// 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 container registry. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response List(Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CacheRulesListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CacheRulesListResult.DeserializeCacheRulesListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetRequest(Guid subscriptionId, string resourceGroupName, string registryName, string cacheRuleName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/cacheRules/", false); + uri.AppendPath(cacheRuleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the properties of the specified cache rule resource. + /// 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 container registry. + /// The name of the cache rule. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(Guid subscriptionId, string resourceGroupName, string registryName, string cacheRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(cacheRuleName, nameof(cacheRuleName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, registryName, cacheRuleName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CacheRuleData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CacheRuleData.DeserializeCacheRuleData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((CacheRuleData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the properties of the specified cache rule resource. + /// 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 container registry. + /// The name of the cache rule. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(Guid subscriptionId, string resourceGroupName, string registryName, string cacheRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(cacheRuleName, nameof(cacheRuleName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, registryName, cacheRuleName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CacheRuleData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CacheRuleData.DeserializeCacheRuleData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((CacheRuleData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateRequest(Guid subscriptionId, string resourceGroupName, string registryName, string cacheRuleName, CacheRuleData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/cacheRules/", false); + uri.AppendPath(cacheRuleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates a cache rule for a container registry with the specified parameters. + /// 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 container registry. + /// The name of the cache rule. + /// The parameters for creating a cache rule. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(Guid subscriptionId, string resourceGroupName, string registryName, string cacheRuleName, CacheRuleData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(cacheRuleName, nameof(cacheRuleName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, registryName, cacheRuleName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates a cache rule for a container registry with the specified parameters. + /// 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 container registry. + /// The name of the cache rule. + /// The parameters for creating a cache rule. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Create(Guid subscriptionId, string resourceGroupName, string registryName, string cacheRuleName, CacheRuleData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(cacheRuleName, nameof(cacheRuleName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, registryName, cacheRuleName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteRequest(Guid subscriptionId, string resourceGroupName, string registryName, string cacheRuleName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/cacheRules/", false); + uri.AppendPath(cacheRuleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes a cache rule resource from a container registry. + /// 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 container registry. + /// The name of the cache rule. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(Guid subscriptionId, string resourceGroupName, string registryName, string cacheRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(cacheRuleName, nameof(cacheRuleName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, registryName, cacheRuleName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes a cache rule resource from a container registry. + /// 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 container registry. + /// The name of the cache rule. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(Guid subscriptionId, string resourceGroupName, string registryName, string cacheRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(cacheRuleName, nameof(cacheRuleName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, registryName, cacheRuleName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateRequest(Guid subscriptionId, string resourceGroupName, string registryName, string cacheRuleName, CacheRulePatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/cacheRules/", false); + uri.AppendPath(cacheRuleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Updates a cache rule for a container registry with the specified parameters. + /// 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 container registry. + /// The name of the cache rule. + /// The parameters for updating a cache rule. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(Guid subscriptionId, string resourceGroupName, string registryName, string cacheRuleName, CacheRulePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(cacheRuleName, nameof(cacheRuleName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, registryName, cacheRuleName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Updates a cache rule for a container registry with the specified parameters. + /// 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 container registry. + /// The name of the cache rule. + /// The parameters for updating a cache rule. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(Guid subscriptionId, string resourceGroupName, string registryName, string cacheRuleName, CacheRulePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(cacheRuleName, nameof(cacheRuleName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, registryName, cacheRuleName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all cache rule resources for the specified container registry. + /// The URL to the next page of results. + /// 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 container registry. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, registryName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CacheRulesListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CacheRulesListResult.DeserializeCacheRulesListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all cache rule resources for the specified container registry. + /// The URL to the next page of results. + /// 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 container registry. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, registryName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CacheRulesListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CacheRulesListResult.DeserializeCacheRulesListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ConnectedRegistriesRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ConnectedRegistriesRestOperations.cs index 05537ff75da2..060ae1954d60 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ConnectedRegistriesRestOperations.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ConnectedRegistriesRestOperations.cs @@ -33,11 +33,11 @@ public ConnectedRegistriesRestOperations(HttpPipeline pipeline, string applicati { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-02-01-preview"; + _apiVersion = apiVersion ?? "2023-01-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string registryName, string filter) + internal HttpMessage CreateListRequest(Guid subscriptionId, string resourceGroupName, string registryName, string filter) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -63,16 +63,15 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// Lists all connected registries for the specified container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// An OData filter expression that describes a subset of connectedRegistries to return. The parameters that can be filtered are parent.id (the resource id of the connectedRegistry parent), mode, and connectionState. The supported operator is eq. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string registryName, string filter = null, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(Guid subscriptionId, string resourceGroupName, string registryName, string filter = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -93,16 +92,15 @@ public async Task> ListAsync(string subscr } /// Lists all connected registries for the specified container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// An OData filter expression that describes a subset of connectedRegistries to return. The parameters that can be filtered are parent.id (the resource id of the connectedRegistry parent), mode, and connectionState. The supported operator is eq. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string registryName, string filter = null, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response List(Guid subscriptionId, string resourceGroupName, string registryName, string filter = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -122,7 +120,7 @@ public Response List(string subscriptionId, string } } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName) + internal HttpMessage CreateGetRequest(Guid subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -145,16 +143,15 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Gets the properties of the connected registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the connected registry. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(Guid subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); @@ -178,16 +175,15 @@ public async Task> GetAsync(string subscriptionI } /// Gets the properties of the connected registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the connected registry. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(Guid subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); @@ -210,7 +206,7 @@ public Response Get(string subscriptionId, string resourc } } - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, ConnectedRegistryData data) + internal HttpMessage CreateCreateRequest(Guid subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, ConnectedRegistryData data) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -237,17 +233,16 @@ internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceG } /// Creates a connected registry for a container registry with the specified parameters. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the connected registry. /// The parameters for creating a connectedRegistry. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task CreateAsync(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, ConnectedRegistryData data, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(Guid subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, ConnectedRegistryData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); @@ -266,17 +261,16 @@ public async Task CreateAsync(string subscriptionId, string resourceGr } /// Creates a connected registry for a container registry with the specified parameters. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the connected registry. /// The parameters for creating a connectedRegistry. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, ConnectedRegistryData data, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Create(Guid subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, ConnectedRegistryData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); @@ -294,7 +288,7 @@ public Response Create(string subscriptionId, string resourceGroupName, string r } } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName) + internal HttpMessage CreateDeleteRequest(Guid subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -317,16 +311,15 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Deletes a connected registry from a container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the connected registry. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(Guid subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); @@ -345,16 +338,15 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Deletes a connected registry from a container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the connected registry. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(Guid subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); @@ -372,7 +364,7 @@ public Response Delete(string subscriptionId, string resourceGroupName, string r } } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, ConnectedRegistryPatch patch) + internal HttpMessage CreateUpdateRequest(Guid subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, ConnectedRegistryPatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -399,17 +391,16 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG } /// Updates a connected registry with the specified parameters. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the connected registry. /// The parameters for updating a connectedRegistry. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, ConnectedRegistryPatch patch, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(Guid subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, ConnectedRegistryPatch patch, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); @@ -428,17 +419,16 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr } /// Updates a connected registry with the specified parameters. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the connected registry. /// The parameters for updating a connectedRegistry. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, ConnectedRegistryPatch patch, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(Guid subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, ConnectedRegistryPatch patch, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); @@ -456,7 +446,7 @@ public Response Update(string subscriptionId, string resourceGroupName, string r } } - internal HttpMessage CreateDeactivateRequest(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName) + internal HttpMessage CreateDeactivateRequest(Guid subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -480,16 +470,15 @@ internal HttpMessage CreateDeactivateRequest(string subscriptionId, string resou } /// Deactivates the connected registry instance. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the connected registry. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task DeactivateAsync(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeactivateAsync(Guid subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); @@ -507,16 +496,15 @@ public async Task DeactivateAsync(string subscriptionId, string resour } /// Deactivates the connected registry instance. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the connected registry. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Deactivate(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Deactivate(Guid subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); @@ -533,7 +521,7 @@ public Response Deactivate(string subscriptionId, string resourceGroupName, stri } } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string filter) + internal HttpMessage CreateListNextPageRequest(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName, string filter) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -549,17 +537,16 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Lists all connected registries for the specified container registry. /// The URL to the next page of results. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// An OData filter expression that describes a subset of connectedRegistries to return. The parameters that can be filtered are parent.id (the resource id of the connectedRegistry parent), mode, and connectionState. The supported operator is eq. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string filter = null, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName, string filter = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -581,17 +568,16 @@ public async Task> ListNextPageAsync(strin /// Lists all connected registries for the specified container registry. /// The URL to the next page of results. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// An OData filter expression that describes a subset of connectedRegistries to return. The parameters that can be filtered are parent.id (the resource id of the connectedRegistry parent), mode, and connectionState. The supported operator is eq. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string filter = null, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName, string filter = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CredentialSetsRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CredentialSetsRestOperations.cs new file mode 100644 index 000000000000..b3547cae5051 --- /dev/null +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/CredentialSetsRestOperations.cs @@ -0,0 +1,517 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ContainerRegistry.Models; + +namespace Azure.ResourceManager.ContainerRegistry +{ + internal partial class CredentialSetsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of CredentialSetsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public CredentialSetsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-01-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateListRequest(Guid subscriptionId, string resourceGroupName, string registryName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/credentialSets", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all credential set resources for the specified container registry. + /// 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 container registry. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CredentialSetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CredentialSetListResult.DeserializeCredentialSetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all credential set resources for the specified container registry. + /// 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 container registry. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response List(Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CredentialSetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CredentialSetListResult.DeserializeCredentialSetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetRequest(Guid subscriptionId, string resourceGroupName, string registryName, string credentialSetName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/credentialSets/", false); + uri.AppendPath(credentialSetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the properties of the specified credential set resource. + /// 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 container registry. + /// The name of the credential set. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(Guid subscriptionId, string resourceGroupName, string registryName, string credentialSetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(credentialSetName, nameof(credentialSetName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, registryName, credentialSetName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CredentialSetData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CredentialSetData.DeserializeCredentialSetData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((CredentialSetData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the properties of the specified credential set resource. + /// 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 container registry. + /// The name of the credential set. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(Guid subscriptionId, string resourceGroupName, string registryName, string credentialSetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(credentialSetName, nameof(credentialSetName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, registryName, credentialSetName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CredentialSetData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CredentialSetData.DeserializeCredentialSetData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((CredentialSetData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateRequest(Guid subscriptionId, string resourceGroupName, string registryName, string credentialSetName, CredentialSetData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/credentialSets/", false); + uri.AppendPath(credentialSetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates a credential set for a container registry with the specified parameters. + /// 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 container registry. + /// The name of the credential set. + /// The parameters for creating a credential set. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(Guid subscriptionId, string resourceGroupName, string registryName, string credentialSetName, CredentialSetData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(credentialSetName, nameof(credentialSetName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, registryName, credentialSetName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates a credential set for a container registry with the specified parameters. + /// 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 container registry. + /// The name of the credential set. + /// The parameters for creating a credential set. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Create(Guid subscriptionId, string resourceGroupName, string registryName, string credentialSetName, CredentialSetData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(credentialSetName, nameof(credentialSetName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, registryName, credentialSetName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteRequest(Guid subscriptionId, string resourceGroupName, string registryName, string credentialSetName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/credentialSets/", false); + uri.AppendPath(credentialSetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes a credential set from a container registry. + /// 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 container registry. + /// The name of the credential set. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(Guid subscriptionId, string resourceGroupName, string registryName, string credentialSetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(credentialSetName, nameof(credentialSetName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, registryName, credentialSetName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes a credential set from a container registry. + /// 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 container registry. + /// The name of the credential set. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(Guid subscriptionId, string resourceGroupName, string registryName, string credentialSetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(credentialSetName, nameof(credentialSetName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, registryName, credentialSetName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateRequest(Guid subscriptionId, string resourceGroupName, string registryName, string credentialSetName, CredentialSetPatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerRegistry/registries/", false); + uri.AppendPath(registryName, true); + uri.AppendPath("/credentialSets/", false); + uri.AppendPath(credentialSetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Updates a credential set for a container registry with the specified parameters. + /// 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 container registry. + /// The name of the credential set. + /// The parameters for updating a credential set. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(Guid subscriptionId, string resourceGroupName, string registryName, string credentialSetName, CredentialSetPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(credentialSetName, nameof(credentialSetName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, registryName, credentialSetName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Updates a credential set for a container registry with the specified parameters. + /// 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 container registry. + /// The name of the credential set. + /// The parameters for updating a credential set. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(Guid subscriptionId, string resourceGroupName, string registryName, string credentialSetName, CredentialSetPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + Argument.AssertNotNullOrEmpty(credentialSetName, nameof(credentialSetName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, registryName, credentialSetName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all credential set resources for the specified container registry. + /// The URL to the next page of results. + /// 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 container registry. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, registryName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CredentialSetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CredentialSetListResult.DeserializeCredentialSetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all credential set resources for the specified container registry. + /// The URL to the next page of results. + /// 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 container registry. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, registryName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CredentialSetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CredentialSetListResult.DeserializeCredentialSetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ExportPipelinesRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ExportPipelinesRestOperations.cs index eef72a069263..41e7a7ce8235 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ExportPipelinesRestOperations.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ExportPipelinesRestOperations.cs @@ -33,11 +33,11 @@ public ExportPipelinesRestOperations(HttpPipeline pipeline, string applicationId { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-02-01-preview"; + _apiVersion = apiVersion ?? "2023-01-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string registryName) + internal HttpMessage CreateListRequest(Guid subscriptionId, string resourceGroupName, string registryName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -59,15 +59,14 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// Lists all export pipelines for the specified container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -88,15 +87,14 @@ public async Task> ListAsync(string subscript } /// Lists all export pipelines for the specified container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response List(Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -116,7 +114,7 @@ public Response List(string subscriptionId, string res } } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string registryName, string exportPipelineName) + internal HttpMessage CreateGetRequest(Guid subscriptionId, string resourceGroupName, string registryName, string exportPipelineName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -139,16 +137,15 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Gets the properties of the export pipeline. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the export pipeline. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string registryName, string exportPipelineName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(Guid subscriptionId, string resourceGroupName, string registryName, string exportPipelineName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(exportPipelineName, nameof(exportPipelineName)); @@ -172,16 +169,15 @@ public async Task> GetAsync(string subscriptionId, } /// Gets the properties of the export pipeline. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the export pipeline. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string registryName, string exportPipelineName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(Guid subscriptionId, string resourceGroupName, string registryName, string exportPipelineName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(exportPipelineName, nameof(exportPipelineName)); @@ -204,7 +200,7 @@ public Response Get(string subscriptionId, string resourceGr } } - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string registryName, string exportPipelineName, ExportPipelineData data) + internal HttpMessage CreateCreateRequest(Guid subscriptionId, string resourceGroupName, string registryName, string exportPipelineName, ExportPipelineData data) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -231,17 +227,16 @@ internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceG } /// Creates an export pipeline for a container registry with the specified parameters. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the export pipeline. /// The parameters for creating an export pipeline. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task CreateAsync(string subscriptionId, string resourceGroupName, string registryName, string exportPipelineName, ExportPipelineData data, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(Guid subscriptionId, string resourceGroupName, string registryName, string exportPipelineName, ExportPipelineData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(exportPipelineName, nameof(exportPipelineName)); @@ -260,17 +255,16 @@ public async Task CreateAsync(string subscriptionId, string resourceGr } /// Creates an export pipeline for a container registry with the specified parameters. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the export pipeline. /// The parameters for creating an export pipeline. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string registryName, string exportPipelineName, ExportPipelineData data, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Create(Guid subscriptionId, string resourceGroupName, string registryName, string exportPipelineName, ExportPipelineData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(exportPipelineName, nameof(exportPipelineName)); @@ -288,7 +282,7 @@ public Response Create(string subscriptionId, string resourceGroupName, string r } } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string registryName, string exportPipelineName) + internal HttpMessage CreateDeleteRequest(Guid subscriptionId, string resourceGroupName, string registryName, string exportPipelineName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -311,16 +305,15 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Deletes an export pipeline from a container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the export pipeline. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string registryName, string exportPipelineName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(Guid subscriptionId, string resourceGroupName, string registryName, string exportPipelineName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(exportPipelineName, nameof(exportPipelineName)); @@ -339,16 +332,15 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Deletes an export pipeline from a container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the export pipeline. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string registryName, string exportPipelineName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(Guid subscriptionId, string resourceGroupName, string registryName, string exportPipelineName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(exportPipelineName, nameof(exportPipelineName)); @@ -366,7 +358,7 @@ public Response Delete(string subscriptionId, string resourceGroupName, string r } } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string registryName) + internal HttpMessage CreateListNextPageRequest(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -382,16 +374,15 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Lists all export pipelines for the specified container registry. /// The URL to the next page of results. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -413,16 +404,15 @@ public async Task> ListNextPageAsync(string n /// Lists all export pipelines for the specified container registry. /// The URL to the next page of results. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ImportPipelinesRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ImportPipelinesRestOperations.cs index bfdb5ba99d48..1ae2bca6894a 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ImportPipelinesRestOperations.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ImportPipelinesRestOperations.cs @@ -33,11 +33,11 @@ public ImportPipelinesRestOperations(HttpPipeline pipeline, string applicationId { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-02-01-preview"; + _apiVersion = apiVersion ?? "2023-01-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string registryName) + internal HttpMessage CreateListRequest(Guid subscriptionId, string resourceGroupName, string registryName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -59,15 +59,14 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// Lists all import pipelines for the specified container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -88,15 +87,14 @@ public async Task> ListAsync(string subscript } /// Lists all import pipelines for the specified container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response List(Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -116,7 +114,7 @@ public Response List(string subscriptionId, string res } } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string registryName, string importPipelineName) + internal HttpMessage CreateGetRequest(Guid subscriptionId, string resourceGroupName, string registryName, string importPipelineName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -139,16 +137,15 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Gets the properties of the import pipeline. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the import pipeline. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string registryName, string importPipelineName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(Guid subscriptionId, string resourceGroupName, string registryName, string importPipelineName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(importPipelineName, nameof(importPipelineName)); @@ -172,16 +169,15 @@ public async Task> GetAsync(string subscriptionId, } /// Gets the properties of the import pipeline. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the import pipeline. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string registryName, string importPipelineName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(Guid subscriptionId, string resourceGroupName, string registryName, string importPipelineName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(importPipelineName, nameof(importPipelineName)); @@ -204,7 +200,7 @@ public Response Get(string subscriptionId, string resourceGr } } - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string registryName, string importPipelineName, ImportPipelineData data) + internal HttpMessage CreateCreateRequest(Guid subscriptionId, string resourceGroupName, string registryName, string importPipelineName, ImportPipelineData data) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -231,17 +227,16 @@ internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceG } /// Creates an import pipeline for a container registry with the specified parameters. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the import pipeline. /// The parameters for creating an import pipeline. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task CreateAsync(string subscriptionId, string resourceGroupName, string registryName, string importPipelineName, ImportPipelineData data, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(Guid subscriptionId, string resourceGroupName, string registryName, string importPipelineName, ImportPipelineData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(importPipelineName, nameof(importPipelineName)); @@ -260,17 +255,16 @@ public async Task CreateAsync(string subscriptionId, string resourceGr } /// Creates an import pipeline for a container registry with the specified parameters. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the import pipeline. /// The parameters for creating an import pipeline. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string registryName, string importPipelineName, ImportPipelineData data, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Create(Guid subscriptionId, string resourceGroupName, string registryName, string importPipelineName, ImportPipelineData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(importPipelineName, nameof(importPipelineName)); @@ -288,7 +282,7 @@ public Response Create(string subscriptionId, string resourceGroupName, string r } } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string registryName, string importPipelineName) + internal HttpMessage CreateDeleteRequest(Guid subscriptionId, string resourceGroupName, string registryName, string importPipelineName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -311,16 +305,15 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Deletes an import pipeline from a container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the import pipeline. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string registryName, string importPipelineName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(Guid subscriptionId, string resourceGroupName, string registryName, string importPipelineName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(importPipelineName, nameof(importPipelineName)); @@ -339,16 +332,15 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Deletes an import pipeline from a container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the import pipeline. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string registryName, string importPipelineName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(Guid subscriptionId, string resourceGroupName, string registryName, string importPipelineName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(importPipelineName, nameof(importPipelineName)); @@ -366,7 +358,7 @@ public Response Delete(string subscriptionId, string resourceGroupName, string r } } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string registryName) + internal HttpMessage CreateListNextPageRequest(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -382,16 +374,15 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Lists all import pipelines for the specified container registry. /// The URL to the next page of results. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -413,16 +404,15 @@ public async Task> ListNextPageAsync(string n /// Lists all import pipelines for the specified container registry. /// The URL to the next page of results. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/PipelineRunsRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/PipelineRunsRestOperations.cs index a21317630665..1e17cfd44e02 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/PipelineRunsRestOperations.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/PipelineRunsRestOperations.cs @@ -33,11 +33,11 @@ public PipelineRunsRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-02-01-preview"; + _apiVersion = apiVersion ?? "2023-01-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string registryName) + internal HttpMessage CreateListRequest(Guid subscriptionId, string resourceGroupName, string registryName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -59,15 +59,14 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// Lists all the pipeline runs for the specified container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -88,15 +87,14 @@ public async Task> ListAsync(string subscription } /// Lists all the pipeline runs for the specified container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response List(Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -116,7 +114,7 @@ public Response List(string subscriptionId, string resour } } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string registryName, string pipelineRunName) + internal HttpMessage CreateGetRequest(Guid subscriptionId, string resourceGroupName, string registryName, string pipelineRunName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -139,16 +137,15 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Gets the detailed information for a given pipeline run. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the pipeline run. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string registryName, string pipelineRunName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(Guid subscriptionId, string resourceGroupName, string registryName, string pipelineRunName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(pipelineRunName, nameof(pipelineRunName)); @@ -172,16 +169,15 @@ public async Task> GetAsync(string su } /// Gets the detailed information for a given pipeline run. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the pipeline run. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string registryName, string pipelineRunName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(Guid subscriptionId, string resourceGroupName, string registryName, string pipelineRunName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(pipelineRunName, nameof(pipelineRunName)); @@ -204,7 +200,7 @@ public Response Get(string subscriptionId, str } } - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string registryName, string pipelineRunName, ContainerRegistryPipelineRunData data) + internal HttpMessage CreateCreateRequest(Guid subscriptionId, string resourceGroupName, string registryName, string pipelineRunName, ContainerRegistryPipelineRunData data) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -231,17 +227,16 @@ internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceG } /// Creates a pipeline run for a container registry with the specified parameters. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the pipeline run. /// The parameters for creating a pipeline run. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task CreateAsync(string subscriptionId, string resourceGroupName, string registryName, string pipelineRunName, ContainerRegistryPipelineRunData data, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(Guid subscriptionId, string resourceGroupName, string registryName, string pipelineRunName, ContainerRegistryPipelineRunData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(pipelineRunName, nameof(pipelineRunName)); @@ -260,17 +255,16 @@ public async Task CreateAsync(string subscriptionId, string resourceGr } /// Creates a pipeline run for a container registry with the specified parameters. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the pipeline run. /// The parameters for creating a pipeline run. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string registryName, string pipelineRunName, ContainerRegistryPipelineRunData data, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Create(Guid subscriptionId, string resourceGroupName, string registryName, string pipelineRunName, ContainerRegistryPipelineRunData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(pipelineRunName, nameof(pipelineRunName)); @@ -288,7 +282,7 @@ public Response Create(string subscriptionId, string resourceGroupName, string r } } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string registryName, string pipelineRunName) + internal HttpMessage CreateDeleteRequest(Guid subscriptionId, string resourceGroupName, string registryName, string pipelineRunName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -311,16 +305,15 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Deletes a pipeline run from a container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the pipeline run. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string registryName, string pipelineRunName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(Guid subscriptionId, string resourceGroupName, string registryName, string pipelineRunName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(pipelineRunName, nameof(pipelineRunName)); @@ -339,16 +332,15 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Deletes a pipeline run from a container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the pipeline run. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string registryName, string pipelineRunName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(Guid subscriptionId, string resourceGroupName, string registryName, string pipelineRunName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(pipelineRunName, nameof(pipelineRunName)); @@ -366,7 +358,7 @@ public Response Delete(string subscriptionId, string resourceGroupName, string r } } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string registryName) + internal HttpMessage CreateListNextPageRequest(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -382,16 +374,15 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Lists all the pipeline runs for the specified container registry. /// The URL to the next page of results. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -413,16 +404,15 @@ public async Task> ListNextPageAsync(string next /// Lists all the pipeline runs for the specified container registry. /// The URL to the next page of results. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs index e211278ef219..5c86a45c5686 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs @@ -33,11 +33,11 @@ public PrivateEndpointConnectionsRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-02-01-preview"; + _apiVersion = apiVersion ?? "2023-01-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string registryName) + internal HttpMessage CreateListRequest(Guid subscriptionId, string resourceGroupName, string registryName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -59,15 +59,14 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// List all private endpoint connections in a container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -88,15 +87,14 @@ public async Task } /// List all private endpoint connections in a container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response List(Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -116,7 +114,7 @@ public Response List(strin } } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string registryName, string privateEndpointConnectionName) + internal HttpMessage CreateGetRequest(Guid subscriptionId, string resourceGroupName, string registryName, string privateEndpointConnectionName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -139,16 +137,15 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get the specified private endpoint connection associated with the container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the private endpoint connection. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string registryName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(Guid subscriptionId, string resourceGroupName, string registryName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); @@ -172,16 +169,15 @@ public async Task> GetA } /// Get the specified private endpoint connection associated with the container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the private endpoint connection. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string registryName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(Guid subscriptionId, string resourceGroupName, string registryName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); @@ -204,7 +200,7 @@ public Response Get(string subsc } } - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string registryName, string privateEndpointConnectionName, ContainerRegistryPrivateEndpointConnectionData data) + internal HttpMessage CreateCreateOrUpdateRequest(Guid subscriptionId, string resourceGroupName, string registryName, string privateEndpointConnectionName, ContainerRegistryPrivateEndpointConnectionData data) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -231,17 +227,16 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Update the state of specified private endpoint connection associated with the container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the private endpoint connection. /// The parameters for creating a private endpoint connection. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string registryName, string privateEndpointConnectionName, ContainerRegistryPrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(Guid subscriptionId, string resourceGroupName, string registryName, string privateEndpointConnectionName, ContainerRegistryPrivateEndpointConnectionData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); @@ -260,17 +255,16 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re } /// Update the state of specified private endpoint connection associated with the container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the private endpoint connection. /// The parameters for creating a private endpoint connection. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string registryName, string privateEndpointConnectionName, ContainerRegistryPrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(Guid subscriptionId, string resourceGroupName, string registryName, string privateEndpointConnectionName, ContainerRegistryPrivateEndpointConnectionData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); @@ -288,7 +282,7 @@ public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, } } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string registryName, string privateEndpointConnectionName) + internal HttpMessage CreateDeleteRequest(Guid subscriptionId, string resourceGroupName, string registryName, string privateEndpointConnectionName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -310,16 +304,15 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Deletes the specified private endpoint connection associated with the container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the private endpoint connection. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string registryName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(Guid subscriptionId, string resourceGroupName, string registryName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); @@ -338,16 +331,15 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Deletes the specified private endpoint connection associated with the container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the private endpoint connection. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string registryName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(Guid subscriptionId, string resourceGroupName, string registryName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); @@ -365,7 +357,7 @@ public Response Delete(string subscriptionId, string resourceGroupName, string r } } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string registryName) + internal HttpMessage CreateListNextPageRequest(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -381,16 +373,15 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// List all private endpoint connections in a container registry. /// The URL to the next page of results. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -412,16 +403,15 @@ public async Task /// List all private endpoint connections in a container registry. /// The URL to the next page of results. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/RegistriesRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/RegistriesRestOperations.cs index 0b94dd33cbdd..e326cd81cbde 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/RegistriesRestOperations.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/RegistriesRestOperations.cs @@ -33,11 +33,11 @@ public RegistriesRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-02-01-preview"; + _apiVersion = apiVersion ?? "2023-01-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal HttpMessage CreateImportImageRequest(string subscriptionId, string resourceGroupName, string registryName, ContainerRegistryImportImageContent content) + internal HttpMessage CreateImportImageRequest(Guid subscriptionId, string resourceGroupName, string registryName, ContainerRegistryImportImageContent content) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -62,16 +62,15 @@ internal HttpMessage CreateImportImageRequest(string subscriptionId, string reso } /// Copies an image to this container registry from the specified container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The parameters specifying the image to copy and the source container registry. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task ImportImageAsync(string subscriptionId, string resourceGroupName, string registryName, ContainerRegistryImportImageContent content, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task ImportImageAsync(Guid subscriptionId, string resourceGroupName, string registryName, ContainerRegistryImportImageContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNull(content, nameof(content)); @@ -89,16 +88,15 @@ public async Task ImportImageAsync(string subscriptionId, string resou } /// Copies an image to this container registry from the specified container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The parameters specifying the image to copy and the source container registry. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ImportImage(string subscriptionId, string resourceGroupName, string registryName, ContainerRegistryImportImageContent content, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ImportImage(Guid subscriptionId, string resourceGroupName, string registryName, ContainerRegistryImportImageContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNull(content, nameof(content)); @@ -115,7 +113,7 @@ public Response ImportImage(string subscriptionId, string resourceGroupName, str } } - internal HttpMessage CreateCheckNameAvailabilityRequest(string subscriptionId, ContainerRegistryNameAvailabilityContent content) + internal HttpMessage CreateCheckNameAvailabilityRequest(Guid subscriptionId, ContainerRegistryNameAvailabilityContent content) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -137,14 +135,12 @@ internal HttpMessage CreateCheckNameAvailabilityRequest(string subscriptionId, C } /// Checks whether the container registry name is available for use. The name must contain only alphanumeric characters, be globally unique, and between 5 and 50 characters in length. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The object containing information for the availability request. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> CheckNameAvailabilityAsync(string subscriptionId, ContainerRegistryNameAvailabilityContent content, CancellationToken cancellationToken = default) + /// is null. + public async Task> CheckNameAvailabilityAsync(Guid subscriptionId, ContainerRegistryNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNull(content, nameof(content)); using var message = CreateCheckNameAvailabilityRequest(subscriptionId, content); @@ -164,14 +160,12 @@ public async Task> CheckNameAvail } /// Checks whether the container registry name is available for use. The name must contain only alphanumeric characters, be globally unique, and between 5 and 50 characters in length. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The object containing information for the availability request. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response CheckNameAvailability(string subscriptionId, ContainerRegistryNameAvailabilityContent content, CancellationToken cancellationToken = default) + /// is null. + public Response CheckNameAvailability(Guid subscriptionId, ContainerRegistryNameAvailabilityContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNull(content, nameof(content)); using var message = CreateCheckNameAvailabilityRequest(subscriptionId, content); @@ -190,7 +184,7 @@ public Response CheckNameAvailability(stri } } - internal HttpMessage CreateListRequest(string subscriptionId) + internal HttpMessage CreateListRequest(Guid subscriptionId) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -208,14 +202,10 @@ internal HttpMessage CreateListRequest(string subscriptionId) } /// Lists all the container registries under the specified subscription. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, CancellationToken cancellationToken = default) + public async Task> ListAsync(Guid subscriptionId, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - using var message = CreateListRequest(subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) @@ -233,14 +223,10 @@ public async Task> ListAsync(string subscr } /// Lists all the container registries under the specified subscription. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, CancellationToken cancellationToken = default) + public Response List(Guid subscriptionId, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - using var message = CreateListRequest(subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) @@ -257,7 +243,7 @@ public Response List(string subscriptionId, Cancell } } - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + internal HttpMessage CreateListByResourceGroupRequest(Guid subscriptionId, string resourceGroupName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -277,14 +263,13 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str } /// Lists all the container registries under the specified resource group. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(Guid subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); @@ -304,14 +289,13 @@ public async Task> ListByResourceGroupAsyn } /// Lists all the container registries under the specified resource group. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(Guid subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); @@ -330,7 +314,7 @@ public Response ListByResourceGroup(string subscrip } } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string registryName) + internal HttpMessage CreateGetRequest(Guid subscriptionId, string resourceGroupName, string registryName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -351,15 +335,14 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Gets the properties of the specified container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -382,15 +365,14 @@ public async Task> GetAsync(string subscriptionI } /// Gets the properties of the specified container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response Get(Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -412,7 +394,7 @@ public Response Get(string subscriptionId, string resourc } } - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string registryName, ContainerRegistryData data) + internal HttpMessage CreateCreateRequest(Guid subscriptionId, string resourceGroupName, string registryName, ContainerRegistryData data) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -437,16 +419,15 @@ internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceG } /// Creates a container registry with the specified parameters. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The parameters for creating a container registry. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task CreateAsync(string subscriptionId, string resourceGroupName, string registryName, ContainerRegistryData data, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(Guid subscriptionId, string resourceGroupName, string registryName, ContainerRegistryData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNull(data, nameof(data)); @@ -464,16 +445,15 @@ public async Task CreateAsync(string subscriptionId, string resourceGr } /// Creates a container registry with the specified parameters. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The parameters for creating a container registry. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string registryName, ContainerRegistryData data, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response Create(Guid subscriptionId, string resourceGroupName, string registryName, ContainerRegistryData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNull(data, nameof(data)); @@ -490,7 +470,7 @@ public Response Create(string subscriptionId, string resourceGroupName, string r } } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string registryName) + internal HttpMessage CreateDeleteRequest(Guid subscriptionId, string resourceGroupName, string registryName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -510,15 +490,14 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Deletes a container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -536,15 +515,14 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Deletes a container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response Delete(Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -561,7 +539,7 @@ public Response Delete(string subscriptionId, string resourceGroupName, string r } } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string registryName, ContainerRegistryPatch patch) + internal HttpMessage CreateUpdateRequest(Guid subscriptionId, string resourceGroupName, string registryName, ContainerRegistryPatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -586,16 +564,15 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG } /// Updates a container registry with the specified parameters. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The parameters for updating a container registry. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string registryName, ContainerRegistryPatch patch, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(Guid subscriptionId, string resourceGroupName, string registryName, ContainerRegistryPatch patch, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNull(patch, nameof(patch)); @@ -613,16 +590,15 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr } /// Updates a container registry with the specified parameters. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The parameters for updating a container registry. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string registryName, ContainerRegistryPatch patch, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response Update(Guid subscriptionId, string resourceGroupName, string registryName, ContainerRegistryPatch patch, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNull(patch, nameof(patch)); @@ -639,7 +615,7 @@ public Response Update(string subscriptionId, string resourceGroupName, string r } } - internal HttpMessage CreateListUsagesRequest(string subscriptionId, string resourceGroupName, string registryName) + internal HttpMessage CreateListUsagesRequest(Guid subscriptionId, string resourceGroupName, string registryName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -661,15 +637,14 @@ internal HttpMessage CreateListUsagesRequest(string subscriptionId, string resou } /// Gets the quota usages for the specified container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListUsagesAsync(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListUsagesAsync(Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -690,15 +665,14 @@ public async Task> ListUsagesAsync(st } /// Gets the quota usages for the specified container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListUsages(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListUsages(Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -718,7 +692,7 @@ public Response ListUsages(string subscription } } - internal HttpMessage CreateListPrivateLinkResourcesRequest(string subscriptionId, string resourceGroupName, string registryName) + internal HttpMessage CreateListPrivateLinkResourcesRequest(Guid subscriptionId, string resourceGroupName, string registryName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -740,15 +714,14 @@ internal HttpMessage CreateListPrivateLinkResourcesRequest(string subscriptionId } /// Lists the private link resources for a container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListPrivateLinkResourcesAsync(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListPrivateLinkResourcesAsync(Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -769,15 +742,14 @@ public async Task> List } /// Lists the private link resources for a container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListPrivateLinkResources(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListPrivateLinkResources(Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -797,7 +769,7 @@ public Response ListPrivateLinkR } } - internal HttpMessage CreateGetPrivateLinkResourceRequest(string subscriptionId, string resourceGroupName, string registryName, string groupName) + internal HttpMessage CreateGetPrivateLinkResourceRequest(Guid subscriptionId, string resourceGroupName, string registryName, string groupName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -820,16 +792,15 @@ internal HttpMessage CreateGetPrivateLinkResourceRequest(string subscriptionId, } /// Gets a private link resource by a specified group name for a container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the private link resource. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetPrivateLinkResourceAsync(string subscriptionId, string resourceGroupName, string registryName, string groupName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetPrivateLinkResourceAsync(Guid subscriptionId, string resourceGroupName, string registryName, string groupName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); @@ -853,16 +824,15 @@ public async Task> GetPrivate } /// Gets a private link resource by a specified group name for a container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the private link resource. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response GetPrivateLinkResource(string subscriptionId, string resourceGroupName, string registryName, string groupName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response GetPrivateLinkResource(Guid subscriptionId, string resourceGroupName, string registryName, string groupName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); @@ -885,7 +855,7 @@ public Response GetPrivateLinkResource } } - internal HttpMessage CreateListCredentialsRequest(string subscriptionId, string resourceGroupName, string registryName) + internal HttpMessage CreateListCredentialsRequest(Guid subscriptionId, string resourceGroupName, string registryName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -907,15 +877,14 @@ internal HttpMessage CreateListCredentialsRequest(string subscriptionId, string } /// Lists the login credentials for the specified container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListCredentialsAsync(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListCredentialsAsync(Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -936,15 +905,14 @@ public async Task> ListCredenti } /// Lists the login credentials for the specified container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListCredentials(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListCredentials(Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -964,7 +932,7 @@ public Response ListCredentials(string s } } - internal HttpMessage CreateRegenerateCredentialRequest(string subscriptionId, string resourceGroupName, string registryName, ContainerRegistryCredentialRegenerateContent content) + internal HttpMessage CreateRegenerateCredentialRequest(Guid subscriptionId, string resourceGroupName, string registryName, ContainerRegistryCredentialRegenerateContent content) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -990,16 +958,15 @@ internal HttpMessage CreateRegenerateCredentialRequest(string subscriptionId, st } /// Regenerates one of the login credentials for the specified container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// Specifies name of the password which should be regenerated -- password or password2. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> RegenerateCredentialAsync(string subscriptionId, string resourceGroupName, string registryName, ContainerRegistryCredentialRegenerateContent content, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> RegenerateCredentialAsync(Guid subscriptionId, string resourceGroupName, string registryName, ContainerRegistryCredentialRegenerateContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNull(content, nameof(content)); @@ -1021,16 +988,15 @@ public async Task> RegenerateCr } /// Regenerates one of the login credentials for the specified container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// Specifies name of the password which should be regenerated -- password or password2. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response RegenerateCredential(string subscriptionId, string resourceGroupName, string registryName, ContainerRegistryCredentialRegenerateContent content, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response RegenerateCredential(Guid subscriptionId, string resourceGroupName, string registryName, ContainerRegistryCredentialRegenerateContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNull(content, nameof(content)); @@ -1051,7 +1017,7 @@ public Response RegenerateCredential(str } } - internal HttpMessage CreateGenerateCredentialsRequest(string subscriptionId, string resourceGroupName, string registryName, ContainerRegistryGenerateCredentialsContent content) + internal HttpMessage CreateGenerateCredentialsRequest(Guid subscriptionId, string resourceGroupName, string registryName, ContainerRegistryGenerateCredentialsContent content) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -1077,16 +1043,15 @@ internal HttpMessage CreateGenerateCredentialsRequest(string subscriptionId, str } /// Generate keys for a token of a specified container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The parameters for generating credentials. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task GenerateCredentialsAsync(string subscriptionId, string resourceGroupName, string registryName, ContainerRegistryGenerateCredentialsContent content, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task GenerateCredentialsAsync(Guid subscriptionId, string resourceGroupName, string registryName, ContainerRegistryGenerateCredentialsContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNull(content, nameof(content)); @@ -1104,16 +1069,15 @@ public async Task GenerateCredentialsAsync(string subscriptionId, stri } /// Generate keys for a token of a specified container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The parameters for generating credentials. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response GenerateCredentials(string subscriptionId, string resourceGroupName, string registryName, ContainerRegistryGenerateCredentialsContent content, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response GenerateCredentials(Guid subscriptionId, string resourceGroupName, string registryName, ContainerRegistryGenerateCredentialsContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNull(content, nameof(content)); @@ -1130,7 +1094,7 @@ public Response GenerateCredentials(string subscriptionId, string resourceGroupN } } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId) + internal HttpMessage CreateListNextPageRequest(string nextLink, Guid subscriptionId) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -1146,14 +1110,12 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Lists all the container registries under the specified subscription. /// The URL to the next page of results. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + /// is null. + public async Task> ListNextPageAsync(string nextLink, Guid subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); using var message = CreateListNextPageRequest(nextLink, subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); @@ -1173,14 +1135,12 @@ public async Task> ListNextPageAsync(strin /// Lists all the container registries under the specified subscription. /// The URL to the next page of results. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + /// is null. + public Response ListNextPage(string nextLink, Guid subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); using var message = CreateListNextPageRequest(nextLink, subscriptionId); _pipeline.Send(message, cancellationToken); @@ -1198,7 +1158,7 @@ public Response ListNextPage(string nextLink, strin } } - internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, Guid subscriptionId, string resourceGroupName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -1214,15 +1174,14 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s /// Lists all the container registries under the specified resource group. /// The URL to the next page of results. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, Guid subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); @@ -1243,15 +1202,14 @@ public async Task> ListByResourceGroupNext /// Lists all the container registries under the specified resource group. /// The URL to the next page of results. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, Guid subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); @@ -1270,7 +1228,7 @@ public Response ListByResourceGroupNextPage(string } } - internal HttpMessage CreateListPrivateLinkResourcesNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string registryName) + internal HttpMessage CreateListPrivateLinkResourcesNextPageRequest(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -1286,16 +1244,15 @@ internal HttpMessage CreateListPrivateLinkResourcesNextPageRequest(string nextLi /// Lists the private link resources for a container registry. /// The URL to the next page of results. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListPrivateLinkResourcesNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListPrivateLinkResourcesNextPageAsync(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -1317,16 +1274,15 @@ public async Task> List /// Lists the private link resources for a container registry. /// The URL to the next page of results. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListPrivateLinkResourcesNextPage(string nextLink, string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListPrivateLinkResourcesNextPage(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ReplicationsRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ReplicationsRestOperations.cs index 2bb86be23875..e983f757b08c 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ReplicationsRestOperations.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ReplicationsRestOperations.cs @@ -33,11 +33,11 @@ public ReplicationsRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-02-01-preview"; + _apiVersion = apiVersion ?? "2023-01-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string registryName) + internal HttpMessage CreateListRequest(Guid subscriptionId, string resourceGroupName, string registryName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -59,15 +59,14 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// Lists all the replications for the specified container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -88,15 +87,14 @@ public async Task> ListAsync(st } /// Lists all the replications for the specified container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response List(Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -116,7 +114,7 @@ public Response List(string subscription } } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string registryName, string replicationName) + internal HttpMessage CreateGetRequest(Guid subscriptionId, string resourceGroupName, string registryName, string replicationName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -139,16 +137,15 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Gets the properties of the specified replication. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the replication. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string registryName, string replicationName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(Guid subscriptionId, string resourceGroupName, string registryName, string replicationName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(replicationName, nameof(replicationName)); @@ -172,16 +169,15 @@ public async Task> GetAsync(string su } /// Gets the properties of the specified replication. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the replication. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string registryName, string replicationName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(Guid subscriptionId, string resourceGroupName, string registryName, string replicationName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(replicationName, nameof(replicationName)); @@ -204,7 +200,7 @@ public Response Get(string subscriptionId, str } } - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string registryName, string replicationName, ContainerRegistryReplicationData data) + internal HttpMessage CreateCreateRequest(Guid subscriptionId, string resourceGroupName, string registryName, string replicationName, ContainerRegistryReplicationData data) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -231,17 +227,16 @@ internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceG } /// Creates a replication for a container registry with the specified parameters. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the replication. /// The parameters for creating a replication. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task CreateAsync(string subscriptionId, string resourceGroupName, string registryName, string replicationName, ContainerRegistryReplicationData data, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(Guid subscriptionId, string resourceGroupName, string registryName, string replicationName, ContainerRegistryReplicationData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(replicationName, nameof(replicationName)); @@ -260,17 +255,16 @@ public async Task CreateAsync(string subscriptionId, string resourceGr } /// Creates a replication for a container registry with the specified parameters. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the replication. /// The parameters for creating a replication. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string registryName, string replicationName, ContainerRegistryReplicationData data, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Create(Guid subscriptionId, string resourceGroupName, string registryName, string replicationName, ContainerRegistryReplicationData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(replicationName, nameof(replicationName)); @@ -288,7 +282,7 @@ public Response Create(string subscriptionId, string resourceGroupName, string r } } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string registryName, string replicationName) + internal HttpMessage CreateDeleteRequest(Guid subscriptionId, string resourceGroupName, string registryName, string replicationName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -310,16 +304,15 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Deletes a replication from a container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the replication. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string registryName, string replicationName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(Guid subscriptionId, string resourceGroupName, string registryName, string replicationName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(replicationName, nameof(replicationName)); @@ -338,16 +331,15 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Deletes a replication from a container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the replication. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string registryName, string replicationName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(Guid subscriptionId, string resourceGroupName, string registryName, string replicationName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(replicationName, nameof(replicationName)); @@ -365,7 +357,7 @@ public Response Delete(string subscriptionId, string resourceGroupName, string r } } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string registryName, string replicationName, ContainerRegistryReplicationPatch patch) + internal HttpMessage CreateUpdateRequest(Guid subscriptionId, string resourceGroupName, string registryName, string replicationName, ContainerRegistryReplicationPatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -392,17 +384,16 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG } /// Updates a replication for a container registry with the specified parameters. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the replication. /// The parameters for updating a replication. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string registryName, string replicationName, ContainerRegistryReplicationPatch patch, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(Guid subscriptionId, string resourceGroupName, string registryName, string replicationName, ContainerRegistryReplicationPatch patch, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(replicationName, nameof(replicationName)); @@ -421,17 +412,16 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr } /// Updates a replication for a container registry with the specified parameters. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the replication. /// The parameters for updating a replication. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string registryName, string replicationName, ContainerRegistryReplicationPatch patch, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(Guid subscriptionId, string resourceGroupName, string registryName, string replicationName, ContainerRegistryReplicationPatch patch, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(replicationName, nameof(replicationName)); @@ -449,7 +439,7 @@ public Response Update(string subscriptionId, string resourceGroupName, string r } } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string registryName) + internal HttpMessage CreateListNextPageRequest(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -465,16 +455,15 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Lists all the replications for the specified container registry. /// The URL to the next page of results. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -496,16 +485,15 @@ public async Task> ListNextPage /// Lists all the replications for the specified container registry. /// The URL to the next page of results. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/RunsRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/RunsRestOperations.cs index 73c29aee99ef..c5792a4bfcb2 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/RunsRestOperations.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/RunsRestOperations.cs @@ -37,7 +37,7 @@ public RunsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpo _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string registryName, string filter, int? top) + internal HttpMessage CreateListRequest(Guid subscriptionId, string resourceGroupName, string registryName, string filter, int? top) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -67,17 +67,16 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// Gets all the runs for a registry. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container 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 cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string registryName, string filter = null, int? top = null, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(Guid subscriptionId, string resourceGroupName, string registryName, string filter = null, int? top = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -98,17 +97,16 @@ public async Task> ListAsync(string sub } /// Gets all the runs for a registry. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container 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 cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string registryName, string filter = null, int? top = null, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response List(Guid subscriptionId, string resourceGroupName, string registryName, string filter = null, int? top = null, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -128,7 +126,7 @@ public Response List(string subscriptionId, stri } } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string registryName, string runId) + internal HttpMessage CreateGetRequest(Guid subscriptionId, string resourceGroupName, string registryName, string runId) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -151,16 +149,15 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Gets the detailed information for a given run. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The run ID. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string registryName, string runId, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(Guid subscriptionId, string resourceGroupName, string registryName, string runId, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(runId, nameof(runId)); @@ -184,16 +181,15 @@ public async Task> GetAsync(string subscripti } /// Gets the detailed information for a given run. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The run ID. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string registryName, string runId, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(Guid subscriptionId, string resourceGroupName, string registryName, string runId, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(runId, nameof(runId)); @@ -216,7 +212,7 @@ public Response Get(string subscriptionId, string reso } } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string registryName, string runId, ContainerRegistryRunPatch patch) + internal HttpMessage CreateUpdateRequest(Guid subscriptionId, string resourceGroupName, string registryName, string runId, ContainerRegistryRunPatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -243,17 +239,16 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG } /// Patch the run properties. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The run ID. /// The run update properties. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string registryName, string runId, ContainerRegistryRunPatch patch, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(Guid subscriptionId, string resourceGroupName, string registryName, string runId, ContainerRegistryRunPatch patch, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(runId, nameof(runId)); @@ -272,17 +267,16 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr } /// Patch the run properties. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The run ID. /// The run update properties. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string registryName, string runId, ContainerRegistryRunPatch patch, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(Guid subscriptionId, string resourceGroupName, string registryName, string runId, ContainerRegistryRunPatch patch, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(runId, nameof(runId)); @@ -300,7 +294,7 @@ public Response Update(string subscriptionId, string resourceGroupName, string r } } - internal HttpMessage CreateGetLogSasUrlRequest(string subscriptionId, string resourceGroupName, string registryName, string runId) + internal HttpMessage CreateGetLogSasUrlRequest(Guid subscriptionId, string resourceGroupName, string registryName, string runId) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -324,16 +318,15 @@ internal HttpMessage CreateGetLogSasUrlRequest(string subscriptionId, string res } /// Gets a link to download the run logs. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The run ID. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetLogSasUrlAsync(string subscriptionId, string resourceGroupName, string registryName, string runId, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetLogSasUrlAsync(Guid subscriptionId, string resourceGroupName, string registryName, string runId, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(runId, nameof(runId)); @@ -355,16 +348,15 @@ public async Task> GetLogSasUrlAsync( } /// Gets a link to download the run logs. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The run ID. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response GetLogSasUrl(string subscriptionId, string resourceGroupName, string registryName, string runId, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response GetLogSasUrl(Guid subscriptionId, string resourceGroupName, string registryName, string runId, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(runId, nameof(runId)); @@ -385,7 +377,7 @@ public Response GetLogSasUrl(string subscripti } } - internal HttpMessage CreateCancelRequest(string subscriptionId, string resourceGroupName, string registryName, string runId) + internal HttpMessage CreateCancelRequest(Guid subscriptionId, string resourceGroupName, string registryName, string runId) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -409,16 +401,15 @@ internal HttpMessage CreateCancelRequest(string subscriptionId, string resourceG } /// Cancel an existing run. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The run ID. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task CancelAsync(string subscriptionId, string resourceGroupName, string registryName, string runId, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CancelAsync(Guid subscriptionId, string resourceGroupName, string registryName, string runId, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(runId, nameof(runId)); @@ -436,16 +427,15 @@ public async Task CancelAsync(string subscriptionId, string resourceGr } /// Cancel an existing run. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The run ID. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Cancel(string subscriptionId, string resourceGroupName, string registryName, string runId, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Cancel(Guid subscriptionId, string resourceGroupName, string registryName, string runId, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(runId, nameof(runId)); @@ -462,7 +452,7 @@ public Response Cancel(string subscriptionId, string resourceGroupName, string r } } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string filter, int? top) + internal HttpMessage CreateListNextPageRequest(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName, string filter, int? top) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -478,18 +468,17 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Gets all the runs for a registry. /// The URL to the next page of results. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container 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 cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string filter = null, int? top = null, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName, string filter = null, int? top = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -511,18 +500,17 @@ public async Task> ListNextPageAsync(st /// Gets all the runs for a registry. /// The URL to the next page of results. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container 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 cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string filter = null, int? top = null, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName, string filter = null, int? top = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/SchedulesRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/SchedulesRestOperations.cs index e2269c24ec7f..e89fee57e785 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/SchedulesRestOperations.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/SchedulesRestOperations.cs @@ -36,7 +36,7 @@ public SchedulesRestOperations(HttpPipeline pipeline, string applicationId, Uri _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal HttpMessage CreateScheduleRunRequest(string subscriptionId, string resourceGroupName, string registryName, ContainerRegistryRunContent content) + internal HttpMessage CreateScheduleRunRequest(Guid subscriptionId, string resourceGroupName, string registryName, ContainerRegistryRunContent content) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -62,16 +62,15 @@ internal HttpMessage CreateScheduleRunRequest(string subscriptionId, string reso } /// Schedules a new run based on the request parameters and add it to the run queue. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The parameters of a run that needs to scheduled. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task ScheduleRunAsync(string subscriptionId, string resourceGroupName, string registryName, ContainerRegistryRunContent content, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task ScheduleRunAsync(Guid subscriptionId, string resourceGroupName, string registryName, ContainerRegistryRunContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNull(content, nameof(content)); @@ -89,16 +88,15 @@ public async Task ScheduleRunAsync(string subscriptionId, string resou } /// Schedules a new run based on the request parameters and add it to the run queue. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The parameters of a run that needs to scheduled. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ScheduleRun(string subscriptionId, string resourceGroupName, string registryName, ContainerRegistryRunContent content, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ScheduleRun(Guid subscriptionId, string resourceGroupName, string registryName, ContainerRegistryRunContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNull(content, nameof(content)); diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ScopeMapsRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ScopeMapsRestOperations.cs index 7fbf69bc50c9..0b48f6688312 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ScopeMapsRestOperations.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ScopeMapsRestOperations.cs @@ -33,11 +33,11 @@ public ScopeMapsRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-02-01-preview"; + _apiVersion = apiVersion ?? "2023-01-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string registryName) + internal HttpMessage CreateListRequest(Guid subscriptionId, string resourceGroupName, string registryName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -59,15 +59,14 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// Lists all the scope maps for the specified container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -88,15 +87,14 @@ public async Task> ListAsync(string subscriptionId, } /// Lists all the scope maps for the specified container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response List(Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -116,7 +114,7 @@ public Response List(string subscriptionId, string resourceG } } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string registryName, string scopeMapName) + internal HttpMessage CreateGetRequest(Guid subscriptionId, string resourceGroupName, string registryName, string scopeMapName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -139,16 +137,15 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Gets the properties of the specified scope map. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the scope map. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string registryName, string scopeMapName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(Guid subscriptionId, string resourceGroupName, string registryName, string scopeMapName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(scopeMapName, nameof(scopeMapName)); @@ -172,16 +169,15 @@ public async Task> GetAsync(string subscriptionId, string } /// Gets the properties of the specified scope map. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the scope map. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string registryName, string scopeMapName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(Guid subscriptionId, string resourceGroupName, string registryName, string scopeMapName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(scopeMapName, nameof(scopeMapName)); @@ -204,7 +200,7 @@ public Response Get(string subscriptionId, string resourceGroupNam } } - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string registryName, string scopeMapName, ScopeMapData data) + internal HttpMessage CreateCreateRequest(Guid subscriptionId, string resourceGroupName, string registryName, string scopeMapName, ScopeMapData data) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -231,17 +227,16 @@ internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceG } /// Creates a scope map for a container registry with the specified parameters. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the scope map. /// The parameters for creating a scope map. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task CreateAsync(string subscriptionId, string resourceGroupName, string registryName, string scopeMapName, ScopeMapData data, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(Guid subscriptionId, string resourceGroupName, string registryName, string scopeMapName, ScopeMapData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(scopeMapName, nameof(scopeMapName)); @@ -260,17 +255,16 @@ public async Task CreateAsync(string subscriptionId, string resourceGr } /// Creates a scope map for a container registry with the specified parameters. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the scope map. /// The parameters for creating a scope map. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string registryName, string scopeMapName, ScopeMapData data, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Create(Guid subscriptionId, string resourceGroupName, string registryName, string scopeMapName, ScopeMapData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(scopeMapName, nameof(scopeMapName)); @@ -288,7 +282,7 @@ public Response Create(string subscriptionId, string resourceGroupName, string r } } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string registryName, string scopeMapName) + internal HttpMessage CreateDeleteRequest(Guid subscriptionId, string resourceGroupName, string registryName, string scopeMapName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -311,16 +305,15 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Deletes a scope map from a container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the scope map. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string registryName, string scopeMapName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(Guid subscriptionId, string resourceGroupName, string registryName, string scopeMapName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(scopeMapName, nameof(scopeMapName)); @@ -339,16 +332,15 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Deletes a scope map from a container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the scope map. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string registryName, string scopeMapName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(Guid subscriptionId, string resourceGroupName, string registryName, string scopeMapName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(scopeMapName, nameof(scopeMapName)); @@ -366,7 +358,7 @@ public Response Delete(string subscriptionId, string resourceGroupName, string r } } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string registryName, string scopeMapName, ScopeMapPatch patch) + internal HttpMessage CreateUpdateRequest(Guid subscriptionId, string resourceGroupName, string registryName, string scopeMapName, ScopeMapPatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -393,17 +385,16 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG } /// Updates a scope map with the specified parameters. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the scope map. /// The parameters for updating a scope map. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string registryName, string scopeMapName, ScopeMapPatch patch, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(Guid subscriptionId, string resourceGroupName, string registryName, string scopeMapName, ScopeMapPatch patch, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(scopeMapName, nameof(scopeMapName)); @@ -422,17 +413,16 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr } /// Updates a scope map with the specified parameters. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the scope map. /// The parameters for updating a scope map. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string registryName, string scopeMapName, ScopeMapPatch patch, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(Guid subscriptionId, string resourceGroupName, string registryName, string scopeMapName, ScopeMapPatch patch, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(scopeMapName, nameof(scopeMapName)); @@ -450,7 +440,7 @@ public Response Update(string subscriptionId, string resourceGroupName, string r } } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string registryName) + internal HttpMessage CreateListNextPageRequest(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -466,16 +456,15 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Lists all the scope maps for the specified container registry. /// The URL to the next page of results. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -497,16 +486,15 @@ public async Task> ListNextPageAsync(string nextLin /// Lists all the scope maps for the specified container registry. /// The URL to the next page of results. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/TaskRunsRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/TaskRunsRestOperations.cs index c1014a0e7d77..9042bde66265 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/TaskRunsRestOperations.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/TaskRunsRestOperations.cs @@ -37,7 +37,7 @@ public TaskRunsRestOperations(HttpPipeline pipeline, string applicationId, Uri e _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string registryName, string taskRunName) + internal HttpMessage CreateGetRequest(Guid subscriptionId, string resourceGroupName, string registryName, string taskRunName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -60,16 +60,15 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Gets the detailed information for a given task run. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The name of the task run. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string registryName, string taskRunName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(Guid subscriptionId, string resourceGroupName, string registryName, string taskRunName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(taskRunName, nameof(taskRunName)); @@ -93,16 +92,15 @@ public async Task> GetAsync(string subscr } /// Gets the detailed information for a given task run. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The name of the task run. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string registryName, string taskRunName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(Guid subscriptionId, string resourceGroupName, string registryName, string taskRunName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(taskRunName, nameof(taskRunName)); @@ -125,7 +123,7 @@ public Response Get(string subscriptionId, string } } - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string registryName, string taskRunName, ContainerRegistryTaskRunData data) + internal HttpMessage CreateCreateRequest(Guid subscriptionId, string resourceGroupName, string registryName, string taskRunName, ContainerRegistryTaskRunData data) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -152,17 +150,16 @@ internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceG } /// Creates a task run for a container registry with the specified parameters. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The name of the task run. /// The parameters of a run that needs to scheduled. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task CreateAsync(string subscriptionId, string resourceGroupName, string registryName, string taskRunName, ContainerRegistryTaskRunData data, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(Guid subscriptionId, string resourceGroupName, string registryName, string taskRunName, ContainerRegistryTaskRunData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(taskRunName, nameof(taskRunName)); @@ -181,17 +178,16 @@ public async Task CreateAsync(string subscriptionId, string resourceGr } /// Creates a task run for a container registry with the specified parameters. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The name of the task run. /// The parameters of a run that needs to scheduled. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string registryName, string taskRunName, ContainerRegistryTaskRunData data, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Create(Guid subscriptionId, string resourceGroupName, string registryName, string taskRunName, ContainerRegistryTaskRunData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(taskRunName, nameof(taskRunName)); @@ -209,7 +205,7 @@ public Response Create(string subscriptionId, string resourceGroupName, string r } } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string registryName, string taskRunName) + internal HttpMessage CreateDeleteRequest(Guid subscriptionId, string resourceGroupName, string registryName, string taskRunName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -232,16 +228,15 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Deletes a specified task run resource. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The name of the task run. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string registryName, string taskRunName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(Guid subscriptionId, string resourceGroupName, string registryName, string taskRunName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(taskRunName, nameof(taskRunName)); @@ -260,16 +255,15 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Deletes a specified task run resource. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The name of the task run. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string registryName, string taskRunName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(Guid subscriptionId, string resourceGroupName, string registryName, string taskRunName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(taskRunName, nameof(taskRunName)); @@ -287,7 +281,7 @@ public Response Delete(string subscriptionId, string resourceGroupName, string r } } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string registryName, string taskRunName, ContainerRegistryTaskRunPatch patch) + internal HttpMessage CreateUpdateRequest(Guid subscriptionId, string resourceGroupName, string registryName, string taskRunName, ContainerRegistryTaskRunPatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -314,17 +308,16 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG } /// Updates a task run with the specified parameters. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The name of the task run. /// The parameters for updating a task run. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string registryName, string taskRunName, ContainerRegistryTaskRunPatch patch, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(Guid subscriptionId, string resourceGroupName, string registryName, string taskRunName, ContainerRegistryTaskRunPatch patch, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(taskRunName, nameof(taskRunName)); @@ -343,17 +336,16 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr } /// Updates a task run with the specified parameters. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The name of the task run. /// The parameters for updating a task run. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string registryName, string taskRunName, ContainerRegistryTaskRunPatch patch, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(Guid subscriptionId, string resourceGroupName, string registryName, string taskRunName, ContainerRegistryTaskRunPatch patch, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(taskRunName, nameof(taskRunName)); @@ -371,7 +363,7 @@ public Response Update(string subscriptionId, string resourceGroupName, string r } } - internal HttpMessage CreateGetDetailsRequest(string subscriptionId, string resourceGroupName, string registryName, string taskRunName) + internal HttpMessage CreateGetDetailsRequest(Guid subscriptionId, string resourceGroupName, string registryName, string taskRunName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -395,16 +387,15 @@ internal HttpMessage CreateGetDetailsRequest(string subscriptionId, string resou } /// Gets the detailed information for a given task run that includes all secrets. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The name of the task run. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetDetailsAsync(string subscriptionId, string resourceGroupName, string registryName, string taskRunName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetDetailsAsync(Guid subscriptionId, string resourceGroupName, string registryName, string taskRunName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(taskRunName, nameof(taskRunName)); @@ -426,16 +417,15 @@ public async Task> GetDetailsAsync(string } /// Gets the detailed information for a given task run that includes all secrets. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The name of the task run. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response GetDetails(string subscriptionId, string resourceGroupName, string registryName, string taskRunName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response GetDetails(Guid subscriptionId, string resourceGroupName, string registryName, string taskRunName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(taskRunName, nameof(taskRunName)); @@ -456,7 +446,7 @@ public Response GetDetails(string subscriptionId, } } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string registryName) + internal HttpMessage CreateListRequest(Guid subscriptionId, string resourceGroupName, string registryName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -478,15 +468,14 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// Lists all the task runs for a specified container registry. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -507,15 +496,14 @@ public async Task> ListAsync(string } /// Lists all the task runs for a specified container registry. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response List(Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -535,7 +523,7 @@ public Response List(string subscriptionId, } } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string registryName) + internal HttpMessage CreateListNextPageRequest(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -551,16 +539,15 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Lists all the task runs for a specified container registry. /// The URL to the next page of results. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -582,16 +569,15 @@ public async Task> ListNextPageAsyn /// Lists all the task runs for a specified container registry. /// The URL to the next page of results. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/TasksRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/TasksRestOperations.cs index 29e31b147330..05d8b2be7752 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/TasksRestOperations.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/TasksRestOperations.cs @@ -37,7 +37,7 @@ public TasksRestOperations(HttpPipeline pipeline, string applicationId, Uri endp _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string registryName) + internal HttpMessage CreateListRequest(Guid subscriptionId, string resourceGroupName, string registryName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -59,15 +59,14 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// Lists all the tasks for a specified container registry. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -88,15 +87,14 @@ public async Task> ListAsync(string su } /// Lists all the tasks for a specified container registry. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response List(Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -116,7 +114,7 @@ public Response List(string subscriptionId, str } } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string registryName, string taskName) + internal HttpMessage CreateGetRequest(Guid subscriptionId, string resourceGroupName, string registryName, string taskName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -139,16 +137,15 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get the properties of a specified task. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The name of the container registry task. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string registryName, string taskName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(Guid subscriptionId, string resourceGroupName, string registryName, string taskName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(taskName, nameof(taskName)); @@ -172,16 +169,15 @@ public async Task> GetAsync(string subscript } /// Get the properties of a specified task. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The name of the container registry task. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string registryName, string taskName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(Guid subscriptionId, string resourceGroupName, string registryName, string taskName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(taskName, nameof(taskName)); @@ -204,7 +200,7 @@ public Response Get(string subscriptionId, string res } } - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string registryName, string taskName, ContainerRegistryTaskData data) + internal HttpMessage CreateCreateRequest(Guid subscriptionId, string resourceGroupName, string registryName, string taskName, ContainerRegistryTaskData data) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -231,17 +227,16 @@ internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceG } /// Creates a task for a container registry with the specified parameters. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The name of the container registry task. /// The parameters for creating a task. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task CreateAsync(string subscriptionId, string resourceGroupName, string registryName, string taskName, ContainerRegistryTaskData data, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(Guid subscriptionId, string resourceGroupName, string registryName, string taskName, ContainerRegistryTaskData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(taskName, nameof(taskName)); @@ -260,17 +255,16 @@ public async Task CreateAsync(string subscriptionId, string resourceGr } /// Creates a task for a container registry with the specified parameters. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The name of the container registry task. /// The parameters for creating a task. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string registryName, string taskName, ContainerRegistryTaskData data, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Create(Guid subscriptionId, string resourceGroupName, string registryName, string taskName, ContainerRegistryTaskData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(taskName, nameof(taskName)); @@ -288,7 +282,7 @@ public Response Create(string subscriptionId, string resourceGroupName, string r } } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string registryName, string taskName) + internal HttpMessage CreateDeleteRequest(Guid subscriptionId, string resourceGroupName, string registryName, string taskName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -311,16 +305,15 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Deletes a specified task. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The name of the container registry task. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string registryName, string taskName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(Guid subscriptionId, string resourceGroupName, string registryName, string taskName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(taskName, nameof(taskName)); @@ -339,16 +332,15 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Deletes a specified task. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The name of the container registry task. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string registryName, string taskName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(Guid subscriptionId, string resourceGroupName, string registryName, string taskName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(taskName, nameof(taskName)); @@ -366,7 +358,7 @@ public Response Delete(string subscriptionId, string resourceGroupName, string r } } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string registryName, string taskName, ContainerRegistryTaskPatch patch) + internal HttpMessage CreateUpdateRequest(Guid subscriptionId, string resourceGroupName, string registryName, string taskName, ContainerRegistryTaskPatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -393,17 +385,16 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG } /// Updates a task with the specified parameters. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The name of the container registry task. /// The parameters for updating a task. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string registryName, string taskName, ContainerRegistryTaskPatch patch, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(Guid subscriptionId, string resourceGroupName, string registryName, string taskName, ContainerRegistryTaskPatch patch, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(taskName, nameof(taskName)); @@ -422,17 +413,16 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr } /// Updates a task with the specified parameters. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The name of the container registry task. /// The parameters for updating a task. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string registryName, string taskName, ContainerRegistryTaskPatch patch, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(Guid subscriptionId, string resourceGroupName, string registryName, string taskName, ContainerRegistryTaskPatch patch, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(taskName, nameof(taskName)); @@ -450,7 +440,7 @@ public Response Update(string subscriptionId, string resourceGroupName, string r } } - internal HttpMessage CreateGetDetailsRequest(string subscriptionId, string resourceGroupName, string registryName, string taskName) + internal HttpMessage CreateGetDetailsRequest(Guid subscriptionId, string resourceGroupName, string registryName, string taskName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -474,16 +464,15 @@ internal HttpMessage CreateGetDetailsRequest(string subscriptionId, string resou } /// Returns a task with extended information that includes all secrets. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The name of the container registry task. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetDetailsAsync(string subscriptionId, string resourceGroupName, string registryName, string taskName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetDetailsAsync(Guid subscriptionId, string resourceGroupName, string registryName, string taskName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(taskName, nameof(taskName)); @@ -505,16 +494,15 @@ public async Task> GetDetailsAsync(string su } /// Returns a task with extended information that includes all secrets. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The name of the container registry task. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response GetDetails(string subscriptionId, string resourceGroupName, string registryName, string taskName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response GetDetails(Guid subscriptionId, string resourceGroupName, string registryName, string taskName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(taskName, nameof(taskName)); @@ -535,7 +523,7 @@ public Response GetDetails(string subscriptionId, str } } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string registryName) + internal HttpMessage CreateListNextPageRequest(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -551,16 +539,15 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Lists all the tasks for a specified container registry. /// The URL to the next page of results. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -582,16 +569,15 @@ public async Task> ListNextPageAsync(s /// Lists all the tasks for a specified container registry. /// The URL to the next page of results. - /// The Microsoft Azure subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group to which the container registry belongs. /// The name of the container registry. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/TokensRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/TokensRestOperations.cs index 0e92d9b924ac..1e19482c082d 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/TokensRestOperations.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/TokensRestOperations.cs @@ -33,11 +33,11 @@ public TokensRestOperations(HttpPipeline pipeline, string applicationId, Uri end { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-02-01-preview"; + _apiVersion = apiVersion ?? "2023-01-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string registryName) + internal HttpMessage CreateListRequest(Guid subscriptionId, string resourceGroupName, string registryName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -59,15 +59,14 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// Lists all the tokens for the specified container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -88,15 +87,14 @@ public async Task> ListAsync(string s } /// Lists all the tokens for the specified container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response List(Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -116,7 +114,7 @@ public Response List(string subscriptionId, st } } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string registryName, string tokenName) + internal HttpMessage CreateGetRequest(Guid subscriptionId, string resourceGroupName, string registryName, string tokenName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -139,16 +137,15 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Gets the properties of the specified token. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the token. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string registryName, string tokenName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(Guid subscriptionId, string resourceGroupName, string registryName, string tokenName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(tokenName, nameof(tokenName)); @@ -172,16 +169,15 @@ public async Task> GetAsync(string subscrip } /// Gets the properties of the specified token. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the token. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string registryName, string tokenName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(Guid subscriptionId, string resourceGroupName, string registryName, string tokenName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(tokenName, nameof(tokenName)); @@ -204,7 +200,7 @@ public Response Get(string subscriptionId, string re } } - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string registryName, string tokenName, ContainerRegistryTokenData data) + internal HttpMessage CreateCreateRequest(Guid subscriptionId, string resourceGroupName, string registryName, string tokenName, ContainerRegistryTokenData data) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -231,17 +227,16 @@ internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceG } /// Creates a token for a container registry with the specified parameters. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the token. /// The parameters for creating a token. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task CreateAsync(string subscriptionId, string resourceGroupName, string registryName, string tokenName, ContainerRegistryTokenData data, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(Guid subscriptionId, string resourceGroupName, string registryName, string tokenName, ContainerRegistryTokenData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(tokenName, nameof(tokenName)); @@ -260,17 +255,16 @@ public async Task CreateAsync(string subscriptionId, string resourceGr } /// Creates a token for a container registry with the specified parameters. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the token. /// The parameters for creating a token. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string registryName, string tokenName, ContainerRegistryTokenData data, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Create(Guid subscriptionId, string resourceGroupName, string registryName, string tokenName, ContainerRegistryTokenData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(tokenName, nameof(tokenName)); @@ -288,7 +282,7 @@ public Response Create(string subscriptionId, string resourceGroupName, string r } } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string registryName, string tokenName) + internal HttpMessage CreateDeleteRequest(Guid subscriptionId, string resourceGroupName, string registryName, string tokenName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -311,16 +305,15 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Deletes a token from a container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the token. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string registryName, string tokenName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(Guid subscriptionId, string resourceGroupName, string registryName, string tokenName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(tokenName, nameof(tokenName)); @@ -339,16 +332,15 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Deletes a token from a container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the token. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string registryName, string tokenName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(Guid subscriptionId, string resourceGroupName, string registryName, string tokenName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(tokenName, nameof(tokenName)); @@ -366,7 +358,7 @@ public Response Delete(string subscriptionId, string resourceGroupName, string r } } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string registryName, string tokenName, ContainerRegistryTokenPatch patch) + internal HttpMessage CreateUpdateRequest(Guid subscriptionId, string resourceGroupName, string registryName, string tokenName, ContainerRegistryTokenPatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -393,17 +385,16 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG } /// Updates a token with the specified parameters. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the token. /// The parameters for updating a token. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string registryName, string tokenName, ContainerRegistryTokenPatch patch, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(Guid subscriptionId, string resourceGroupName, string registryName, string tokenName, ContainerRegistryTokenPatch patch, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(tokenName, nameof(tokenName)); @@ -422,17 +413,16 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr } /// Updates a token with the specified parameters. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the token. /// The parameters for updating a token. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string registryName, string tokenName, ContainerRegistryTokenPatch patch, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(Guid subscriptionId, string resourceGroupName, string registryName, string tokenName, ContainerRegistryTokenPatch patch, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(tokenName, nameof(tokenName)); @@ -450,7 +440,7 @@ public Response Update(string subscriptionId, string resourceGroupName, string r } } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string registryName) + internal HttpMessage CreateListNextPageRequest(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -466,16 +456,15 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Lists all the tokens for the specified container registry. /// The URL to the next page of results. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -497,16 +486,15 @@ public async Task> ListNextPageAsync( /// Lists all the tokens for the specified container registry. /// The URL to the next page of results. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/WebhooksRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/WebhooksRestOperations.cs index 148fa80597be..0e8fc8c6099e 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/WebhooksRestOperations.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/WebhooksRestOperations.cs @@ -33,11 +33,11 @@ public WebhooksRestOperations(HttpPipeline pipeline, string applicationId, Uri e { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-02-01-preview"; + _apiVersion = apiVersion ?? "2023-01-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string registryName) + internal HttpMessage CreateListRequest(Guid subscriptionId, string resourceGroupName, string registryName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -59,15 +59,14 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// Lists all the webhooks for the specified container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -88,15 +87,14 @@ public async Task> ListAsync(string } /// Lists all the webhooks for the specified container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response List(Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -116,7 +114,7 @@ public Response List(string subscriptionId, } } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string registryName, string webhookName) + internal HttpMessage CreateGetRequest(Guid subscriptionId, string resourceGroupName, string registryName, string webhookName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -139,16 +137,15 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Gets the properties of the specified webhook. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the webhook. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string registryName, string webhookName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(Guid subscriptionId, string resourceGroupName, string registryName, string webhookName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(webhookName, nameof(webhookName)); @@ -172,16 +169,15 @@ public async Task> GetAsync(string subscr } /// Gets the properties of the specified webhook. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the webhook. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string registryName, string webhookName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(Guid subscriptionId, string resourceGroupName, string registryName, string webhookName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(webhookName, nameof(webhookName)); @@ -204,7 +200,7 @@ public Response Get(string subscriptionId, string } } - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string registryName, string webhookName, ContainerRegistryWebhookCreateOrUpdateContent content) + internal HttpMessage CreateCreateRequest(Guid subscriptionId, string resourceGroupName, string registryName, string webhookName, ContainerRegistryWebhookCreateOrUpdateContent content) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -231,17 +227,16 @@ internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceG } /// Creates a webhook for a container registry with the specified parameters. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the webhook. /// The parameters for creating a webhook. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task CreateAsync(string subscriptionId, string resourceGroupName, string registryName, string webhookName, ContainerRegistryWebhookCreateOrUpdateContent content, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(Guid subscriptionId, string resourceGroupName, string registryName, string webhookName, ContainerRegistryWebhookCreateOrUpdateContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(webhookName, nameof(webhookName)); @@ -260,17 +255,16 @@ public async Task CreateAsync(string subscriptionId, string resourceGr } /// Creates a webhook for a container registry with the specified parameters. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the webhook. /// The parameters for creating a webhook. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string registryName, string webhookName, ContainerRegistryWebhookCreateOrUpdateContent content, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Create(Guid subscriptionId, string resourceGroupName, string registryName, string webhookName, ContainerRegistryWebhookCreateOrUpdateContent content, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(webhookName, nameof(webhookName)); @@ -288,7 +282,7 @@ public Response Create(string subscriptionId, string resourceGroupName, string r } } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string registryName, string webhookName) + internal HttpMessage CreateDeleteRequest(Guid subscriptionId, string resourceGroupName, string registryName, string webhookName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -310,16 +304,15 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Deletes a webhook from a container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the webhook. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string registryName, string webhookName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(Guid subscriptionId, string resourceGroupName, string registryName, string webhookName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(webhookName, nameof(webhookName)); @@ -338,16 +331,15 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Deletes a webhook from a container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the webhook. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string registryName, string webhookName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(Guid subscriptionId, string resourceGroupName, string registryName, string webhookName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(webhookName, nameof(webhookName)); @@ -365,7 +357,7 @@ public Response Delete(string subscriptionId, string resourceGroupName, string r } } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string registryName, string webhookName, ContainerRegistryWebhookPatch patch) + internal HttpMessage CreateUpdateRequest(Guid subscriptionId, string resourceGroupName, string registryName, string webhookName, ContainerRegistryWebhookPatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -392,17 +384,16 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG } /// Updates a webhook with the specified parameters. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the webhook. /// The parameters for updating a webhook. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string registryName, string webhookName, ContainerRegistryWebhookPatch patch, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(Guid subscriptionId, string resourceGroupName, string registryName, string webhookName, ContainerRegistryWebhookPatch patch, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(webhookName, nameof(webhookName)); @@ -421,17 +412,16 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr } /// Updates a webhook with the specified parameters. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the webhook. /// The parameters for updating a webhook. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string registryName, string webhookName, ContainerRegistryWebhookPatch patch, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(Guid subscriptionId, string resourceGroupName, string registryName, string webhookName, ContainerRegistryWebhookPatch patch, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(webhookName, nameof(webhookName)); @@ -449,7 +439,7 @@ public Response Update(string subscriptionId, string resourceGroupName, string r } } - internal HttpMessage CreatePingRequest(string subscriptionId, string resourceGroupName, string registryName, string webhookName) + internal HttpMessage CreatePingRequest(Guid subscriptionId, string resourceGroupName, string registryName, string webhookName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -473,16 +463,15 @@ internal HttpMessage CreatePingRequest(string subscriptionId, string resourceGro } /// Triggers a ping event to be sent to the webhook. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the webhook. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> PingAsync(string subscriptionId, string resourceGroupName, string registryName, string webhookName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> PingAsync(Guid subscriptionId, string resourceGroupName, string registryName, string webhookName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(webhookName, nameof(webhookName)); @@ -504,16 +493,15 @@ public async Task> PingAsync(string } /// Triggers a ping event to be sent to the webhook. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the webhook. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Ping(string subscriptionId, string resourceGroupName, string registryName, string webhookName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Ping(Guid subscriptionId, string resourceGroupName, string registryName, string webhookName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(webhookName, nameof(webhookName)); @@ -534,7 +522,7 @@ public Response Ping(string subscriptionId, s } } - internal HttpMessage CreateListEventsRequest(string subscriptionId, string resourceGroupName, string registryName, string webhookName) + internal HttpMessage CreateListEventsRequest(Guid subscriptionId, string resourceGroupName, string registryName, string webhookName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -558,16 +546,15 @@ internal HttpMessage CreateListEventsRequest(string subscriptionId, string resou } /// Lists recent events for the specified webhook. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the webhook. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListEventsAsync(string subscriptionId, string resourceGroupName, string registryName, string webhookName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListEventsAsync(Guid subscriptionId, string resourceGroupName, string registryName, string webhookName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(webhookName, nameof(webhookName)); @@ -589,16 +576,15 @@ public async Task> ListEventsA } /// Lists recent events for the specified webhook. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the webhook. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response ListEvents(string subscriptionId, string resourceGroupName, string registryName, string webhookName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListEvents(Guid subscriptionId, string resourceGroupName, string registryName, string webhookName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(webhookName, nameof(webhookName)); @@ -619,7 +605,7 @@ public Response ListEvents(string subsc } } - internal HttpMessage CreateGetCallbackConfigRequest(string subscriptionId, string resourceGroupName, string registryName, string webhookName) + internal HttpMessage CreateGetCallbackConfigRequest(Guid subscriptionId, string resourceGroupName, string registryName, string webhookName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -643,16 +629,15 @@ internal HttpMessage CreateGetCallbackConfigRequest(string subscriptionId, strin } /// Gets the configuration of service URI and custom headers for the webhook. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the webhook. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetCallbackConfigAsync(string subscriptionId, string resourceGroupName, string registryName, string webhookName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetCallbackConfigAsync(Guid subscriptionId, string resourceGroupName, string registryName, string webhookName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(webhookName, nameof(webhookName)); @@ -674,16 +659,15 @@ public async Task> GetCallbackC } /// Gets the configuration of service URI and custom headers for the webhook. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the webhook. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response GetCallbackConfig(string subscriptionId, string resourceGroupName, string registryName, string webhookName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response GetCallbackConfig(Guid subscriptionId, string resourceGroupName, string registryName, string webhookName, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(webhookName, nameof(webhookName)); @@ -704,7 +688,7 @@ public Response GetCallbackConfig(string } } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string registryName) + internal HttpMessage CreateListNextPageRequest(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -720,16 +704,15 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Lists all the webhooks for the specified container registry. /// The URL to the next page of results. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -751,16 +734,15 @@ public async Task> ListNextPageAsyn /// Lists all the webhooks for the specified container registry. /// The URL to the next page of results. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); @@ -780,7 +762,7 @@ public Response ListNextPage(string nextLink } } - internal HttpMessage CreateListEventsNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string webhookName) + internal HttpMessage CreateListEventsNextPageRequest(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName, string webhookName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -796,17 +778,16 @@ internal HttpMessage CreateListEventsNextPageRequest(string nextLink, string sub /// Lists recent events for the specified webhook. /// The URL to the next page of results. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the webhook. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListEventsNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string webhookName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListEventsNextPageAsync(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName, string webhookName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(webhookName, nameof(webhookName)); @@ -829,17 +810,16 @@ public async Task> ListEventsN /// Lists recent events for the specified webhook. /// The URL to the next page of results. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. + /// 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 container registry. /// The name of the webhook. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response ListEventsNextPage(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string webhookName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListEventsNextPage(string nextLink, Guid subscriptionId, string resourceGroupName, string registryName, string webhookName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); Argument.AssertNotNullOrEmpty(webhookName, nameof(webhookName)); diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ScopeMapCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ScopeMapCollection.cs index 4d26780b5ae3..ddfe314bd10c 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ScopeMapCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ScopeMapCollection.cs @@ -72,8 +72,8 @@ public virtual async Task> CreateOrUpdateAsync(Wa scope.Start(); try { - var response = await _scopeMapRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, scopeMapName, data, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(new ScopeMapOperationSource(Client), _scopeMapClientDiagnostics, Pipeline, _scopeMapRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, scopeMapName, data).Request, response, OperationFinalStateVia.Location); + var response = await _scopeMapRestClient.CreateAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, scopeMapName, data, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ScopeMapOperationSource(Client), _scopeMapClientDiagnostics, Pipeline, _scopeMapRestClient.CreateCreateRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, scopeMapName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -105,8 +105,8 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil scope.Start(); try { - var response = _scopeMapRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, scopeMapName, data, cancellationToken); - var operation = new ContainerRegistryArmOperation(new ScopeMapOperationSource(Client), _scopeMapClientDiagnostics, Pipeline, _scopeMapRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, scopeMapName, data).Request, response, OperationFinalStateVia.Location); + var response = _scopeMapRestClient.Create(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, scopeMapName, data, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ScopeMapOperationSource(Client), _scopeMapClientDiagnostics, Pipeline, _scopeMapRestClient.CreateCreateRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, scopeMapName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -135,7 +135,7 @@ public virtual async Task> GetAsync(string scopeMapNa scope.Start(); try { - var response = await _scopeMapRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, scopeMapName, cancellationToken).ConfigureAwait(false); + var response = await _scopeMapRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, scopeMapName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ScopeMapResource(Client, response.Value), response.GetRawResponse()); @@ -164,7 +164,7 @@ public virtual Response Get(string scopeMapName, CancellationT scope.Start(); try { - var response = _scopeMapRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, scopeMapName, cancellationToken); + var response = _scopeMapRestClient.Get(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, scopeMapName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ScopeMapResource(Client, response.Value), response.GetRawResponse()); @@ -185,8 +185,8 @@ public virtual Response Get(string scopeMapName, CancellationT /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _scopeMapRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _scopeMapRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage FirstPageRequest(int? pageSizeHint) => _scopeMapRestClient.CreateListRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _scopeMapRestClient.CreateListNextPageRequest(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ScopeMapResource(Client, ScopeMapData.DeserializeScopeMapData(e)), _scopeMapClientDiagnostics, Pipeline, "ScopeMapCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -199,8 +199,8 @@ public virtual AsyncPageable GetAllAsync(CancellationToken can /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _scopeMapRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _scopeMapRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage FirstPageRequest(int? pageSizeHint) => _scopeMapRestClient.CreateListRequest(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _scopeMapRestClient.CreateListNextPageRequest(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name); return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ScopeMapResource(Client, ScopeMapData.DeserializeScopeMapData(e)), _scopeMapClientDiagnostics, Pipeline, "ScopeMapCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -221,7 +221,7 @@ public virtual async Task> ExistsAsync(string scopeMapName, Cance scope.Start(); try { - var response = await _scopeMapRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, scopeMapName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _scopeMapRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, scopeMapName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -248,7 +248,7 @@ public virtual Response Exists(string scopeMapName, CancellationToken canc scope.Start(); try { - var response = _scopeMapRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, scopeMapName, cancellationToken: cancellationToken); + var response = _scopeMapRestClient.Get(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, scopeMapName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ScopeMapResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ScopeMapResource.cs index 9bc242eb3ca5..6eeb5b8866bc 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ScopeMapResource.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ScopeMapResource.cs @@ -26,7 +26,7 @@ namespace Azure.ResourceManager.ContainerRegistry public partial class ScopeMapResource : ArmResource { /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string scopeMapName) + public static ResourceIdentifier CreateResourceIdentifier(Guid subscriptionId, string resourceGroupName, string registryName, string scopeMapName) { var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scopeMaps/{scopeMapName}"; return new ResourceIdentifier(resourceId); @@ -99,7 +99,7 @@ public virtual async Task> GetAsync(CancellationToken scope.Start(); try { - var response = await _scopeMapRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _scopeMapRestClient.GetAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ScopeMapResource(Client, response.Value), response.GetRawResponse()); @@ -123,7 +123,7 @@ public virtual Response Get(CancellationToken cancellationToke scope.Start(); try { - var response = _scopeMapRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var response = _scopeMapRestClient.Get(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ScopeMapResource(Client, response.Value), response.GetRawResponse()); @@ -148,8 +148,8 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell scope.Start(); try { - var response = await _scopeMapRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(_scopeMapClientDiagnostics, Pipeline, _scopeMapRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _scopeMapRestClient.DeleteAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(_scopeMapClientDiagnostics, Pipeline, _scopeMapRestClient.CreateDeleteRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -174,8 +174,8 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel scope.Start(); try { - var response = _scopeMapRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new ContainerRegistryArmOperation(_scopeMapClientDiagnostics, Pipeline, _scopeMapRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _scopeMapRestClient.Delete(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new ContainerRegistryArmOperation(_scopeMapClientDiagnostics, Pipeline, _scopeMapRestClient.CreateDeleteRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -204,8 +204,8 @@ public virtual async Task> UpdateAsync(WaitUntil scope.Start(); try { - var response = await _scopeMapRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); - var operation = new ContainerRegistryArmOperation(new ScopeMapOperationSource(Client), _scopeMapClientDiagnostics, Pipeline, _scopeMapRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + var response = await _scopeMapRestClient.UpdateAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerRegistryArmOperation(new ScopeMapOperationSource(Client), _scopeMapClientDiagnostics, Pipeline, _scopeMapRestClient.CreateUpdateRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -234,8 +234,8 @@ public virtual ArmOperation Update(WaitUntil waitUntil, ScopeM scope.Start(); try { - var response = _scopeMapRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken); - var operation = new ContainerRegistryArmOperation(new ScopeMapOperationSource(Client), _scopeMapClientDiagnostics, Pipeline, _scopeMapRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + var response = _scopeMapRestClient.Update(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch, cancellationToken); + var operation = new ContainerRegistryArmOperation(new ScopeMapOperationSource(Client), _scopeMapClientDiagnostics, Pipeline, _scopeMapRestClient.CreateUpdateRequest(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/autorest.md b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/autorest.md index 2f4bb5ef7a98..a860d4762bb2 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/autorest.md +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/autorest.md @@ -8,7 +8,7 @@ csharp: true library-name: ContainerRegistry namespace: Azure.ResourceManager.ContainerRegistry # default tag is a preview version -require: https://github.com/Azure/azure-rest-api-specs/blob/aa8a23b8f92477d0fdce7af6ccffee1c604b3c56/specification/containerregistry/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/containerregistry/resource-manager/readme.md output-folder: $(this-folder)/Generated clear-output-folder: true skip-csproj: true