diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryCollection.cs deleted file mode 100644 index 2fe3290cae4d..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryCollection.cs +++ /dev/null @@ -1,335 +0,0 @@ -// 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.Linq; -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 GetConnectedRegistries method from an instance of . - /// - public partial class ConnectedRegistryCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _connectedRegistryClientDiagnostics; - private readonly ConnectedRegistriesRestOperations _connectedRegistryRestClient; - - /// Initializes a new instance of the class for mocking. - protected ConnectedRegistryCollection() - { - } - - /// 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 ConnectedRegistryCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _connectedRegistryClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerRegistry", ConnectedRegistryResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ConnectedRegistryResource.ResourceType, out string connectedRegistryApiVersion); - _connectedRegistryRestClient = new ConnectedRegistriesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, connectedRegistryApiVersion); -#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 connected registry for a container registry with the specified parameters. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName} - /// Operation Id: ConnectedRegistries_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 connected registry. - /// The parameters for creating a connectedRegistry. - /// 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 connectedRegistryName, ConnectedRegistryData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _connectedRegistryClientDiagnostics.CreateScope("ConnectedRegistryCollection.CreateOrUpdate"); - 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); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates a connected registry for a container registry with the specified parameters. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName} - /// Operation Id: ConnectedRegistries_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 connected registry. - /// The parameters for creating a connectedRegistry. - /// 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 connectedRegistryName, ConnectedRegistryData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _connectedRegistryClientDiagnostics.CreateScope("ConnectedRegistryCollection.CreateOrUpdate"); - 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); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the properties of the connected registry. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName} - /// Operation Id: ConnectedRegistries_Get - /// - /// The name of the connected registry. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string connectedRegistryName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); - - using var scope = _connectedRegistryClientDiagnostics.CreateScope("ConnectedRegistryCollection.Get"); - scope.Start(); - try - { - var response = await _connectedRegistryRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, 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()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the properties of the connected registry. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName} - /// Operation Id: ConnectedRegistries_Get - /// - /// The name of the connected registry. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string connectedRegistryName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); - - using var scope = _connectedRegistryClientDiagnostics.CreateScope("ConnectedRegistryCollection.Get"); - scope.Start(); - try - { - var response = _connectedRegistryRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectedRegistryName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ConnectedRegistryResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Lists all connected registries for the specified container registry. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries - /// Operation Id: ConnectedRegistries_List - /// - /// 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. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(string filter = null, CancellationToken cancellationToken = default) - { - async Task> FirstPageFunc(int? pageSizeHint) - { - using var scope = _connectedRegistryClientDiagnostics.CreateScope("ConnectedRegistryCollection.GetAll"); - scope.Start(); - try - { - var response = await _connectedRegistryRestClient.ListAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter, cancellationToken: cancellationToken).ConfigureAwait(false); - return Page.FromValues(response.Value.Value.Select(value => new ConnectedRegistryResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - async Task> NextPageFunc(string nextLink, int? pageSizeHint) - { - using var scope = _connectedRegistryClientDiagnostics.CreateScope("ConnectedRegistryCollection.GetAll"); - scope.Start(); - try - { - var response = await _connectedRegistryRestClient.ListNextPageAsync(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter, cancellationToken: cancellationToken).ConfigureAwait(false); - return Page.FromValues(response.Value.Value.Select(value => new ConnectedRegistryResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); - } - - /// - /// Lists all connected registries for the specified container registry. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries - /// Operation Id: ConnectedRegistries_List - /// - /// 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. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(string filter = null, CancellationToken cancellationToken = default) - { - Page FirstPageFunc(int? pageSizeHint) - { - using var scope = _connectedRegistryClientDiagnostics.CreateScope("ConnectedRegistryCollection.GetAll"); - scope.Start(); - try - { - var response = _connectedRegistryRestClient.List(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter, cancellationToken: cancellationToken); - return Page.FromValues(response.Value.Value.Select(value => new ConnectedRegistryResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - Page NextPageFunc(string nextLink, int? pageSizeHint) - { - using var scope = _connectedRegistryClientDiagnostics.CreateScope("ConnectedRegistryCollection.GetAll"); - scope.Start(); - try - { - var response = _connectedRegistryRestClient.ListNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter, cancellationToken: cancellationToken); - return Page.FromValues(response.Value.Value.Select(value => new ConnectedRegistryResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); - } - - /// - /// Checks to see if the resource exists in azure. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName} - /// Operation Id: ConnectedRegistries_Get - /// - /// The name of the connected registry. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string connectedRegistryName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); - - using var scope = _connectedRegistryClientDiagnostics.CreateScope("ConnectedRegistryCollection.Exists"); - scope.Start(); - try - { - var response = await _connectedRegistryRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectedRegistryName, 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}/connectedRegistries/{connectedRegistryName} - /// Operation Id: ConnectedRegistries_Get - /// - /// The name of the connected registry. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string connectedRegistryName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); - - using var scope = _connectedRegistryClientDiagnostics.CreateScope("ConnectedRegistryCollection.Exists"); - scope.Start(); - try - { - var response = _connectedRegistryRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectedRegistryName, 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/ConnectedRegistryData.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryData.cs deleted file mode 100644 index 23f28bb1926f..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryData.cs +++ /dev/null @@ -1,91 +0,0 @@ -// 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 ConnectedRegistry data model. - public partial class ConnectedRegistryData : ResourceData - { - /// Initializes a new instance of ConnectedRegistryData. - public ConnectedRegistryData() - { - ClientTokenIds = new ChangeTrackingList(); - StatusDetails = new ChangeTrackingList(); - NotificationsList = new ChangeTrackingList(); - } - - /// Initializes a new instance of ConnectedRegistryData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Provisioning state of the resource. - /// The mode of the connected registry resource that indicates the permissions of the registry. - /// The current version of ACR runtime on the connected registry. - /// The current connection state of the connected registry. - /// The last activity time of the connected registry. - /// The activation properties of the connected registry. - /// The parent of the connected registry. - /// The list of the ACR token resource IDs used to authenticate clients to the connected registry. - /// The login server properties of the connected registry. - /// The logging properties of the connected registry. - /// The list of current statuses of the connected registry. - /// The list of notifications subscription information for the connected registry. - internal ConnectedRegistryData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ContainerRegistryProvisioningState? provisioningState, ConnectedRegistryMode? mode, string version, ConnectedRegistryConnectionState? connectionState, DateTimeOffset? lastActivityOn, ConnectedRegistryActivation activation, ConnectedRegistryParent parent, IList clientTokenIds, ConnectedRegistryLoginServer loginServer, ConnectedRegistryLogging logging, IReadOnlyList statusDetails, IList notificationsList) : base(id, name, resourceType, systemData) - { - ProvisioningState = provisioningState; - Mode = mode; - Version = version; - ConnectionState = connectionState; - LastActivityOn = lastActivityOn; - Activation = activation; - Parent = parent; - ClientTokenIds = clientTokenIds; - LoginServer = loginServer; - Logging = logging; - StatusDetails = statusDetails; - NotificationsList = notificationsList; - } - - /// Provisioning state of the resource. - public ContainerRegistryProvisioningState? ProvisioningState { get; } - /// The mode of the connected registry resource that indicates the permissions of the registry. - public ConnectedRegistryMode? Mode { get; set; } - /// The current version of ACR runtime on the connected registry. - public string Version { get; } - /// The current connection state of the connected registry. - public ConnectedRegistryConnectionState? ConnectionState { get; } - /// The last activity time of the connected registry. - public DateTimeOffset? LastActivityOn { get; } - /// The activation properties of the connected registry. - internal ConnectedRegistryActivation Activation { get; } - /// The activation status of the connected registry. - public ConnectedRegistryActivationStatus? ActivationStatus - { - get => Activation?.Status; - } - - /// The parent of the connected registry. - public ConnectedRegistryParent Parent { get; set; } - /// The list of the ACR token resource IDs used to authenticate clients to the connected registry. - public IList ClientTokenIds { get; } - /// The login server properties of the connected registry. - public ConnectedRegistryLoginServer LoginServer { get; set; } - /// The logging properties of the connected registry. - public ConnectedRegistryLogging Logging { get; set; } - /// The list of current statuses of the connected registry. - public IReadOnlyList StatusDetails { get; } - /// The list of notifications subscription information for the connected registry. - public IList NotificationsList { get; } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryResource.cs deleted file mode 100644 index 93098df89ab0..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ConnectedRegistryResource.cs +++ /dev/null @@ -1,302 +0,0 @@ -// 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 ConnectedRegistry 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 GetConnectedRegistryResource method. - /// Otherwise you can get one from its parent resource using the GetConnectedRegistry method. - /// - public partial class ConnectedRegistryResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _connectedRegistryClientDiagnostics; - private readonly ConnectedRegistriesRestOperations _connectedRegistryRestClient; - private readonly ConnectedRegistryData _data; - - /// Initializes a new instance of the class for mocking. - protected ConnectedRegistryResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal ConnectedRegistryResource(ArmClient client, ConnectedRegistryData 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 ConnectedRegistryResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _connectedRegistryClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerRegistry", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string connectedRegistryApiVersion); - _connectedRegistryRestClient = new ConnectedRegistriesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, connectedRegistryApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.ContainerRegistry/registries/connectedRegistries"; - - /// 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 ConnectedRegistryData 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 connected registry. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName} - /// Operation Id: ConnectedRegistries_Get - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _connectedRegistryClientDiagnostics.CreateScope("ConnectedRegistryResource.Get"); - scope.Start(); - try - { - var response = await _connectedRegistryRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, 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()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the properties of the connected registry. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName} - /// Operation Id: ConnectedRegistries_Get - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _connectedRegistryClientDiagnostics.CreateScope("ConnectedRegistryResource.Get"); - scope.Start(); - try - { - var response = _connectedRegistryRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, 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()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deletes a connected registry from a container registry. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName} - /// Operation Id: ConnectedRegistries_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 = _connectedRegistryClientDiagnostics.CreateScope("ConnectedRegistryResource.Delete"); - 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); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deletes a connected registry from a container registry. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName} - /// Operation Id: ConnectedRegistries_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 = _connectedRegistryClientDiagnostics.CreateScope("ConnectedRegistryResource.Delete"); - 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); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Updates a connected registry with the specified parameters. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName} - /// Operation Id: ConnectedRegistries_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 connectedRegistry. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, ConnectedRegistryPatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(patch, nameof(patch)); - - using var scope = _connectedRegistryClientDiagnostics.CreateScope("ConnectedRegistryResource.Update"); - 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); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Updates a connected registry with the specified parameters. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName} - /// Operation Id: ConnectedRegistries_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 connectedRegistry. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, ConnectedRegistryPatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(patch, nameof(patch)); - - using var scope = _connectedRegistryClientDiagnostics.CreateScope("ConnectedRegistryResource.Update"); - 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); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deactivates the connected registry instance. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName}/deactivate - /// Operation Id: ConnectedRegistries_Deactivate - /// - /// 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 DeactivateAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _connectedRegistryClientDiagnostics.CreateScope("ConnectedRegistryResource.Deactivate"); - 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); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deactivates the connected registry instance. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName}/deactivate - /// Operation Id: ConnectedRegistries_Deactivate - /// - /// 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 Deactivate(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _connectedRegistryClientDiagnostics.CreateScope("ConnectedRegistryResource.Deactivate"); - 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); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryAgentPoolCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryAgentPoolCollection.cs index 8154b24a3616..2e73a523f88b 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryAgentPoolCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryAgentPoolCollection.cs @@ -73,8 +73,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; @@ -106,8 +106,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; @@ -136,7 +136,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()); @@ -165,7 +165,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()); @@ -192,7 +192,7 @@ async Task> FirstPageFunc(int? pageSize scope.Start(); try { - var response = await _containerRegistryAgentPoolAgentPoolsRestClient.ListAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryAgentPoolAgentPoolsRestClient.ListAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); return Page.FromValues(response.Value.Value.Select(value => new ContainerRegistryAgentPoolResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -207,7 +207,7 @@ async Task> NextPageFunc(string nextLin scope.Start(); try { - var response = await _containerRegistryAgentPoolAgentPoolsRestClient.ListNextPageAsync(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryAgentPoolAgentPoolsRestClient.ListNextPageAsync(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); return Page.FromValues(response.Value.Value.Select(value => new ContainerRegistryAgentPoolResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -234,7 +234,7 @@ Page FirstPageFunc(int? pageSizeHint) scope.Start(); try { - var response = _containerRegistryAgentPoolAgentPoolsRestClient.List(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); + var response = _containerRegistryAgentPoolAgentPoolsRestClient.List(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken: cancellationToken); return Page.FromValues(response.Value.Value.Select(value => new ContainerRegistryAgentPoolResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -249,7 +249,7 @@ Page NextPageFunc(string nextLink, int? page scope.Start(); try { - var response = _containerRegistryAgentPoolAgentPoolsRestClient.ListNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); + var response = _containerRegistryAgentPoolAgentPoolsRestClient.ListNextPage(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken: cancellationToken); return Page.FromValues(response.Value.Value.Select(value => new ContainerRegistryAgentPoolResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -278,7 +278,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) @@ -305,7 +305,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 64cfefd9e6c1..623364689471 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryCollection.cs @@ -22,13 +22,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() @@ -38,8 +40,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); @@ -50,8 +58,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)); } /// @@ -74,8 +82,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; @@ -107,8 +115,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; @@ -137,7 +145,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()); @@ -166,7 +174,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()); @@ -193,7 +201,7 @@ async Task> FirstPageFunc(int? pageSizeHint) scope.Start(); try { - var response = await _containerRegistryRegistriesRestClient.ListByResourceGroupAsync(Id.SubscriptionId, Id.ResourceGroupName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryRegistriesRestClient.ListByResourceGroupAsync(Guid.Parse(_subscriptionId), _resourceGroupName, cancellationToken: cancellationToken).ConfigureAwait(false); return Page.FromValues(response.Value.Value.Select(value => new ContainerRegistryResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -208,7 +216,7 @@ async Task> NextPageFunc(string nextLink, int? p scope.Start(); try { - var response = await _containerRegistryRegistriesRestClient.ListByResourceGroupNextPageAsync(nextLink, Id.SubscriptionId, Id.ResourceGroupName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryRegistriesRestClient.ListByResourceGroupNextPageAsync(nextLink, Guid.Parse(_subscriptionId), _resourceGroupName, cancellationToken: cancellationToken).ConfigureAwait(false); return Page.FromValues(response.Value.Value.Select(value => new ContainerRegistryResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -235,7 +243,7 @@ Page FirstPageFunc(int? pageSizeHint) scope.Start(); try { - var response = _containerRegistryRegistriesRestClient.ListByResourceGroup(Id.SubscriptionId, Id.ResourceGroupName, cancellationToken: cancellationToken); + var response = _containerRegistryRegistriesRestClient.ListByResourceGroup(Guid.Parse(_subscriptionId), _resourceGroupName, cancellationToken: cancellationToken); return Page.FromValues(response.Value.Value.Select(value => new ContainerRegistryResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -250,7 +258,7 @@ Page NextPageFunc(string nextLink, int? pageSizeHint) scope.Start(); try { - var response = _containerRegistryRegistriesRestClient.ListByResourceGroupNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, cancellationToken: cancellationToken); + var response = _containerRegistryRegistriesRestClient.ListByResourceGroupNextPage(nextLink, Guid.Parse(_subscriptionId), _resourceGroupName, cancellationToken: cancellationToken); return Page.FromValues(response.Value.Value.Select(value => new ContainerRegistryResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -279,7 +287,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) @@ -306,7 +314,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/ContainerRegistryData.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryData.cs index dd9bccae2ed8..6f9fb1c22d34 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryData.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryData.cs @@ -52,8 +52,7 @@ public ContainerRegistryData(AzureLocation location, ContainerRegistrySku sku) : /// Whether or not public network access is allowed for the container registry. /// Whether to allow trusted Azure services to access a network restricted registry. /// Whether or not zone redundancy is enabled for this container registry. - /// Enables registry-wide pull from unauthenticated clients. - internal ContainerRegistryData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ContainerRegistrySku sku, ManagedServiceIdentity identity, string loginServer, DateTimeOffset? createdOn, ContainerRegistryProvisioningState? provisioningState, ContainerRegistryResourceStatus status, bool? isAdminUserEnabled, ContainerRegistryNetworkRuleSet networkRuleSet, ContainerRegistryPolicies policies, ContainerRegistryEncryption encryption, bool? isDataEndpointEnabled, IReadOnlyList dataEndpointHostNames, IReadOnlyList privateEndpointConnections, ContainerRegistryPublicNetworkAccess? publicNetworkAccess, ContainerRegistryNetworkRuleBypassOption? networkRuleBypassOptions, ContainerRegistryZoneRedundancy? zoneRedundancy, bool? isAnonymousPullEnabled) : base(id, name, resourceType, systemData, tags, location) + internal ContainerRegistryData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ContainerRegistrySku sku, ManagedServiceIdentity identity, string loginServer, DateTimeOffset? createdOn, ContainerRegistryProvisioningState? provisioningState, ContainerRegistryResourceStatus status, bool? isAdminUserEnabled, ContainerRegistryNetworkRuleSet networkRuleSet, ContainerRegistryPolicies policies, ContainerRegistryEncryption encryption, bool? isDataEndpointEnabled, IReadOnlyList dataEndpointHostNames, IReadOnlyList privateEndpointConnections, ContainerRegistryPublicNetworkAccess? publicNetworkAccess, ContainerRegistryNetworkRuleBypassOption? networkRuleBypassOptions, ContainerRegistryZoneRedundancy? zoneRedundancy) : base(id, name, resourceType, systemData, tags, location) { Sku = sku; Identity = identity; @@ -71,7 +70,6 @@ internal ContainerRegistryData(ResourceIdentifier id, string name, ResourceType PublicNetworkAccess = publicNetworkAccess; NetworkRuleBypassOptions = networkRuleBypassOptions; ZoneRedundancy = zoneRedundancy; - IsAnonymousPullEnabled = isAnonymousPullEnabled; } /// The SKU of the container registry. @@ -106,7 +104,5 @@ internal ContainerRegistryData(ResourceIdentifier id, string name, ResourceType public ContainerRegistryNetworkRuleBypassOption? NetworkRuleBypassOptions { get; set; } /// Whether or not zone redundancy is enabled for this container registry. public ContainerRegistryZoneRedundancy? ZoneRedundancy { get; set; } - /// Enables registry-wide pull from unauthenticated clients. - public bool? IsAnonymousPullEnabled { get; set; } } } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunCollection.cs deleted file mode 100644 index 701cb37ed640..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunCollection.cs +++ /dev/null @@ -1,333 +0,0 @@ -// 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.Linq; -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 GetContainerRegistryPipelineRuns method from an instance of . - /// - public partial class ContainerRegistryPipelineRunCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _containerRegistryPipelineRunPipelineRunsClientDiagnostics; - private readonly PipelineRunsRestOperations _containerRegistryPipelineRunPipelineRunsRestClient; - - /// Initializes a new instance of the class for mocking. - protected ContainerRegistryPipelineRunCollection() - { - } - - /// 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 ContainerRegistryPipelineRunCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _containerRegistryPipelineRunPipelineRunsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerRegistry", ContainerRegistryPipelineRunResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ContainerRegistryPipelineRunResource.ResourceType, out string containerRegistryPipelineRunPipelineRunsApiVersion); - _containerRegistryPipelineRunPipelineRunsRestClient = new PipelineRunsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerRegistryPipelineRunPipelineRunsApiVersion); -#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 pipeline run for a container registry with the specified parameters - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName} - /// Operation Id: PipelineRuns_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 pipeline run. - /// The parameters for creating a pipeline run. - /// 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 pipelineRunName, ContainerRegistryPipelineRunData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(pipelineRunName, nameof(pipelineRunName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _containerRegistryPipelineRunPipelineRunsClientDiagnostics.CreateScope("ContainerRegistryPipelineRunCollection.CreateOrUpdate"); - 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); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates a pipeline run for a container registry with the specified parameters - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName} - /// Operation Id: PipelineRuns_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 pipeline run. - /// The parameters for creating a pipeline run. - /// 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 pipelineRunName, ContainerRegistryPipelineRunData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(pipelineRunName, nameof(pipelineRunName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _containerRegistryPipelineRunPipelineRunsClientDiagnostics.CreateScope("ContainerRegistryPipelineRunCollection.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); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the detailed information for a given pipeline run. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName} - /// Operation Id: PipelineRuns_Get - /// - /// The name of the pipeline run. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string pipelineRunName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(pipelineRunName, nameof(pipelineRunName)); - - using var scope = _containerRegistryPipelineRunPipelineRunsClientDiagnostics.CreateScope("ContainerRegistryPipelineRunCollection.Get"); - scope.Start(); - try - { - var response = await _containerRegistryPipelineRunPipelineRunsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, 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()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the detailed information for a given pipeline run. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName} - /// Operation Id: PipelineRuns_Get - /// - /// The name of the pipeline run. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string pipelineRunName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(pipelineRunName, nameof(pipelineRunName)); - - using var scope = _containerRegistryPipelineRunPipelineRunsClientDiagnostics.CreateScope("ContainerRegistryPipelineRunCollection.Get"); - scope.Start(); - try - { - var response = _containerRegistryPipelineRunPipelineRunsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pipelineRunName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ContainerRegistryPipelineRunResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Lists all the pipeline runs for the specified container registry. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns - /// Operation Id: PipelineRuns_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) - { - async Task> FirstPageFunc(int? pageSizeHint) - { - using var scope = _containerRegistryPipelineRunPipelineRunsClientDiagnostics.CreateScope("ContainerRegistryPipelineRunCollection.GetAll"); - scope.Start(); - try - { - var response = await _containerRegistryPipelineRunPipelineRunsRestClient.ListAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); - return Page.FromValues(response.Value.Value.Select(value => new ContainerRegistryPipelineRunResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - async Task> NextPageFunc(string nextLink, int? pageSizeHint) - { - using var scope = _containerRegistryPipelineRunPipelineRunsClientDiagnostics.CreateScope("ContainerRegistryPipelineRunCollection.GetAll"); - scope.Start(); - try - { - var response = await _containerRegistryPipelineRunPipelineRunsRestClient.ListNextPageAsync(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); - return Page.FromValues(response.Value.Value.Select(value => new ContainerRegistryPipelineRunResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); - } - - /// - /// Lists all the pipeline runs for the specified container registry. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns - /// Operation Id: PipelineRuns_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) - { - Page FirstPageFunc(int? pageSizeHint) - { - using var scope = _containerRegistryPipelineRunPipelineRunsClientDiagnostics.CreateScope("ContainerRegistryPipelineRunCollection.GetAll"); - scope.Start(); - try - { - var response = _containerRegistryPipelineRunPipelineRunsRestClient.List(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); - return Page.FromValues(response.Value.Value.Select(value => new ContainerRegistryPipelineRunResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - Page NextPageFunc(string nextLink, int? pageSizeHint) - { - using var scope = _containerRegistryPipelineRunPipelineRunsClientDiagnostics.CreateScope("ContainerRegistryPipelineRunCollection.GetAll"); - scope.Start(); - try - { - var response = _containerRegistryPipelineRunPipelineRunsRestClient.ListNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); - return Page.FromValues(response.Value.Value.Select(value => new ContainerRegistryPipelineRunResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); - } - - /// - /// Checks to see if the resource exists in azure. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName} - /// Operation Id: PipelineRuns_Get - /// - /// The name of the pipeline run. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string pipelineRunName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(pipelineRunName, nameof(pipelineRunName)); - - using var scope = _containerRegistryPipelineRunPipelineRunsClientDiagnostics.CreateScope("ContainerRegistryPipelineRunCollection.Exists"); - scope.Start(); - try - { - var response = await _containerRegistryPipelineRunPipelineRunsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pipelineRunName, 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}/pipelineRuns/{pipelineRunName} - /// Operation Id: PipelineRuns_Get - /// - /// The name of the pipeline run. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string pipelineRunName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(pipelineRunName, nameof(pipelineRunName)); - - using var scope = _containerRegistryPipelineRunPipelineRunsClientDiagnostics.CreateScope("ContainerRegistryPipelineRunCollection.Exists"); - scope.Start(); - try - { - var response = _containerRegistryPipelineRunPipelineRunsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pipelineRunName, 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/ContainerRegistryPipelineRunData.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunData.cs deleted file mode 100644 index 4380a6477ab5..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunData.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager.ContainerRegistry.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.ContainerRegistry -{ - /// A class representing the ContainerRegistryPipelineRun data model. - public partial class ContainerRegistryPipelineRunData : ResourceData - { - /// Initializes a new instance of ContainerRegistryPipelineRunData. - public ContainerRegistryPipelineRunData() - { - } - - /// Initializes a new instance of ContainerRegistryPipelineRunData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The provisioning state of a pipeline run. - /// The request parameters for a pipeline run. - /// The response of a pipeline run. - /// How the pipeline run should be forced to recreate even if the pipeline run configuration has not changed. - internal ContainerRegistryPipelineRunData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ContainerRegistryProvisioningState? provisioningState, PipelineRunContent request, PipelineRunResult response, string forceUpdateTag) : base(id, name, resourceType, systemData) - { - ProvisioningState = provisioningState; - Request = request; - Response = response; - ForceUpdateTag = forceUpdateTag; - } - - /// The provisioning state of a pipeline run. - public ContainerRegistryProvisioningState? ProvisioningState { get; } - /// The request parameters for a pipeline run. - public PipelineRunContent Request { get; set; } - /// The response of a pipeline run. - public PipelineRunResult Response { get; } - /// How the pipeline run should be forced to recreate even if the pipeline run configuration has not changed. - public string ForceUpdateTag { get; set; } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunResource.cs deleted file mode 100644 index eb92233428e8..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPipelineRunResource.cs +++ /dev/null @@ -1,249 +0,0 @@ -// 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; - -namespace Azure.ResourceManager.ContainerRegistry -{ - /// - /// A Class representing a ContainerRegistryPipelineRun 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 GetContainerRegistryPipelineRunResource method. - /// Otherwise you can get one from its parent resource using the GetContainerRegistryPipelineRun method. - /// - public partial class ContainerRegistryPipelineRunResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string pipelineRunName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _containerRegistryPipelineRunPipelineRunsClientDiagnostics; - private readonly PipelineRunsRestOperations _containerRegistryPipelineRunPipelineRunsRestClient; - private readonly ContainerRegistryPipelineRunData _data; - - /// Initializes a new instance of the class for mocking. - protected ContainerRegistryPipelineRunResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal ContainerRegistryPipelineRunResource(ArmClient client, ContainerRegistryPipelineRunData 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 ContainerRegistryPipelineRunResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _containerRegistryPipelineRunPipelineRunsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerRegistry", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string containerRegistryPipelineRunPipelineRunsApiVersion); - _containerRegistryPipelineRunPipelineRunsRestClient = new PipelineRunsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerRegistryPipelineRunPipelineRunsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.ContainerRegistry/registries/pipelineRuns"; - - /// 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 ContainerRegistryPipelineRunData 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 detailed information for a given pipeline run. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName} - /// Operation Id: PipelineRuns_Get - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _containerRegistryPipelineRunPipelineRunsClientDiagnostics.CreateScope("ContainerRegistryPipelineRunResource.Get"); - scope.Start(); - try - { - var response = await _containerRegistryPipelineRunPipelineRunsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, 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()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the detailed information for a given pipeline run. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName} - /// Operation Id: PipelineRuns_Get - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _containerRegistryPipelineRunPipelineRunsClientDiagnostics.CreateScope("ContainerRegistryPipelineRunResource.Get"); - scope.Start(); - try - { - var response = _containerRegistryPipelineRunPipelineRunsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, 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()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deletes a pipeline run from a container registry. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName} - /// Operation Id: PipelineRuns_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 = _containerRegistryPipelineRunPipelineRunsClientDiagnostics.CreateScope("ContainerRegistryPipelineRunResource.Delete"); - 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); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deletes a pipeline run from a container registry. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName} - /// Operation Id: PipelineRuns_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 = _containerRegistryPipelineRunPipelineRunsClientDiagnostics.CreateScope("ContainerRegistryPipelineRunResource.Delete"); - 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); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates a pipeline run for a container registry with the specified parameters - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName} - /// Operation Id: PipelineRuns_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 parameters for creating a pipeline run. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, ContainerRegistryPipelineRunData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _containerRegistryPipelineRunPipelineRunsClientDiagnostics.CreateScope("ContainerRegistryPipelineRunResource.Update"); - 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); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates a pipeline run for a container registry with the specified parameters - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName} - /// Operation Id: PipelineRuns_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 parameters for creating a pipeline run. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, ContainerRegistryPipelineRunData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _containerRegistryPipelineRunPipelineRunsClientDiagnostics.CreateScope("ContainerRegistryPipelineRunResource.Update"); - 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); - 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/ContainerRegistryPrivateEndpointConnectionCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateEndpointConnectionCollection.cs index 2d598b3bc2d8..8ccfe6ac05fa 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateEndpointConnectionCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateEndpointConnectionCollection.cs @@ -73,8 +73,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; @@ -106,8 +106,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; @@ -136,7 +136,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()); @@ -192,7 +192,7 @@ async Task> FirstPageFu scope.Start(); try { - var response = await _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.ListAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.ListAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); return Page.FromValues(response.Value.Value.Select(value => new ContainerRegistryPrivateEndpointConnectionResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -207,7 +207,7 @@ async Task> NextPageFun scope.Start(); try { - var response = await _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.ListNextPageAsync(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.ListNextPageAsync(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); return Page.FromValues(response.Value.Value.Select(value => new ContainerRegistryPrivateEndpointConnectionResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -234,7 +234,7 @@ Page FirstPageFunc(int? page scope.Start(); try { - var response = _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.List(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); + var response = _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.List(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken: cancellationToken); return Page.FromValues(response.Value.Value.Select(value => new ContainerRegistryPrivateEndpointConnectionResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -249,7 +249,7 @@ Page NextPageFunc(string nex scope.Start(); try { - var response = _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.ListNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); + var response = _containerRegistryPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.ListNextPage(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken: cancellationToken); return Page.FromValues(response.Value.Value.Select(value => new ContainerRegistryPrivateEndpointConnectionResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -278,7 +278,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) @@ -305,7 +305,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 f94c1724c929..6ac4d08edef6 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateLinkResourceCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryPrivateLinkResourceCollection.cs @@ -70,7 +70,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()); @@ -99,7 +99,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()); @@ -126,7 +126,7 @@ async Task> FirstPageFunc(int? pageSi scope.Start(); try { - var response = await _containerRegistryPrivateLinkResourceRegistriesRestClient.ListPrivateLinkResourcesAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryPrivateLinkResourceRegistriesRestClient.ListPrivateLinkResourcesAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); return Page.FromValues(response.Value.Value.Select(value => new ContainerRegistryPrivateLinkResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -141,7 +141,7 @@ async Task> NextPageFunc(string nextL scope.Start(); try { - var response = await _containerRegistryPrivateLinkResourceRegistriesRestClient.ListPrivateLinkResourcesNextPageAsync(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryPrivateLinkResourceRegistriesRestClient.ListPrivateLinkResourcesNextPageAsync(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); return Page.FromValues(response.Value.Value.Select(value => new ContainerRegistryPrivateLinkResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -168,7 +168,7 @@ Page FirstPageFunc(int? pageSizeHint) scope.Start(); try { - var response = _containerRegistryPrivateLinkResourceRegistriesRestClient.ListPrivateLinkResources(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); + var response = _containerRegistryPrivateLinkResourceRegistriesRestClient.ListPrivateLinkResources(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken: cancellationToken); return Page.FromValues(response.Value.Value.Select(value => new ContainerRegistryPrivateLinkResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -183,7 +183,7 @@ Page NextPageFunc(string nextLink, int? pa scope.Start(); try { - var response = _containerRegistryPrivateLinkResourceRegistriesRestClient.ListPrivateLinkResourcesNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); + var response = _containerRegistryPrivateLinkResourceRegistriesRestClient.ListPrivateLinkResourcesNextPage(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken: cancellationToken); return Page.FromValues(response.Value.Value.Select(value => new ContainerRegistryPrivateLinkResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -212,7 +212,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) @@ -239,7 +239,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 70e093f4003e..7db9c0c813d8 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryReplicationCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryReplicationCollection.cs @@ -73,8 +73,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; @@ -106,8 +106,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; @@ -136,7 +136,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()); @@ -165,7 +165,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()); @@ -192,7 +192,7 @@ async Task> FirstPageFunc(int? pageSi scope.Start(); try { - var response = await _containerRegistryReplicationReplicationsRestClient.ListAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryReplicationReplicationsRestClient.ListAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); return Page.FromValues(response.Value.Value.Select(value => new ContainerRegistryReplicationResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -207,7 +207,7 @@ async Task> NextPageFunc(string nextL scope.Start(); try { - var response = await _containerRegistryReplicationReplicationsRestClient.ListNextPageAsync(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryReplicationReplicationsRestClient.ListNextPageAsync(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); return Page.FromValues(response.Value.Value.Select(value => new ContainerRegistryReplicationResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -234,7 +234,7 @@ Page FirstPageFunc(int? pageSizeHint) scope.Start(); try { - var response = _containerRegistryReplicationReplicationsRestClient.List(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); + var response = _containerRegistryReplicationReplicationsRestClient.List(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken: cancellationToken); return Page.FromValues(response.Value.Value.Select(value => new ContainerRegistryReplicationResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -249,7 +249,7 @@ Page NextPageFunc(string nextLink, int? pa scope.Start(); try { - var response = _containerRegistryReplicationReplicationsRestClient.ListNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); + var response = _containerRegistryReplicationReplicationsRestClient.ListNextPage(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken: cancellationToken); return Page.FromValues(response.Value.Value.Select(value => new ContainerRegistryReplicationResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -278,7 +278,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) @@ -305,7 +305,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 15ff77a475e5..4458bc6d8f3d 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,80 +97,6 @@ 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 ConnectedRegistryResources in the ContainerRegistry. - /// An object representing collection of ConnectedRegistryResources and their operations over a ConnectedRegistryResource. - public virtual ConnectedRegistryCollection GetConnectedRegistries() - { - return GetCachedClient(Client => new ConnectedRegistryCollection(Client, Id)); - } - - /// - /// Gets the properties of the connected registry. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName} - /// Operation Id: ConnectedRegistries_Get - /// - /// The name of the connected registry. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual async Task> GetConnectedRegistryAsync(string connectedRegistryName, CancellationToken cancellationToken = default) - { - return await GetConnectedRegistries().GetAsync(connectedRegistryName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets the properties of the connected registry. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName} - /// Operation Id: ConnectedRegistries_Get - /// - /// The name of the connected registry. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual Response GetConnectedRegistry(string connectedRegistryName, CancellationToken cancellationToken = default) - { - return GetConnectedRegistries().Get(connectedRegistryName, 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() - { - return GetCachedClient(Client => new ExportPipelineCollection(Client, Id)); - } - - /// - /// Gets the properties of the export pipeline. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName} - /// Operation Id: ExportPipelines_Get - /// - /// The name of the export pipeline. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual async Task> GetExportPipelineAsync(string exportPipelineName, CancellationToken cancellationToken = default) - { - return await GetExportPipelines().GetAsync(exportPipelineName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets the properties of the export pipeline. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName} - /// Operation Id: ExportPipelines_Get - /// - /// The name of the export pipeline. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual Response GetExportPipeline(string exportPipelineName, CancellationToken cancellationToken = default) - { - return GetExportPipelines().Get(exportPipelineName, cancellationToken); - } - /// Gets a collection of ContainerRegistryPrivateLinkResources in the ContainerRegistry. /// An object representing collection of ContainerRegistryPrivateLinkResources and their operations over a ContainerRegistryPrivateLinkResource. public virtual ContainerRegistryPrivateLinkResourceCollection GetContainerRegistryPrivateLinkResources() @@ -208,80 +134,6 @@ public virtual Response GetContainerRegist return GetContainerRegistryPrivateLinkResources().Get(groupName, cancellationToken); } - /// Gets a collection of ImportPipelineResources in the ContainerRegistry. - /// An object representing collection of ImportPipelineResources and their operations over a ImportPipelineResource. - public virtual ImportPipelineCollection GetImportPipelines() - { - return GetCachedClient(Client => new ImportPipelineCollection(Client, Id)); - } - - /// - /// Gets the properties of the import pipeline. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName} - /// Operation Id: ImportPipelines_Get - /// - /// The name of the import pipeline. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual async Task> GetImportPipelineAsync(string importPipelineName, CancellationToken cancellationToken = default) - { - return await GetImportPipelines().GetAsync(importPipelineName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets the properties of the import pipeline. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName} - /// Operation Id: ImportPipelines_Get - /// - /// The name of the import pipeline. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual Response GetImportPipeline(string importPipelineName, CancellationToken cancellationToken = default) - { - return GetImportPipelines().Get(importPipelineName, cancellationToken); - } - - /// Gets a collection of ContainerRegistryPipelineRunResources in the ContainerRegistry. - /// An object representing collection of ContainerRegistryPipelineRunResources and their operations over a ContainerRegistryPipelineRunResource. - public virtual ContainerRegistryPipelineRunCollection GetContainerRegistryPipelineRuns() - { - return GetCachedClient(Client => new ContainerRegistryPipelineRunCollection(Client, Id)); - } - - /// - /// Gets the detailed information for a given pipeline run. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName} - /// Operation Id: PipelineRuns_Get - /// - /// The name of the pipeline run. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual async Task> GetContainerRegistryPipelineRunAsync(string pipelineRunName, CancellationToken cancellationToken = default) - { - return await GetContainerRegistryPipelineRuns().GetAsync(pipelineRunName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets the detailed information for a given pipeline run. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName} - /// Operation Id: PipelineRuns_Get - /// - /// The name of the pipeline run. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual Response GetContainerRegistryPipelineRun(string pipelineRunName, CancellationToken cancellationToken = default) - { - return GetContainerRegistryPipelineRuns().Get(pipelineRunName, cancellationToken); - } - /// Gets a collection of ContainerRegistryPrivateEndpointConnectionResources in the ContainerRegistry. /// An object representing collection of ContainerRegistryPrivateEndpointConnectionResources and their operations over a ContainerRegistryPrivateEndpointConnectionResource. public virtual ContainerRegistryPrivateEndpointConnectionCollection GetContainerRegistryPrivateEndpointConnections() @@ -627,7 +479,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 +503,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 +528,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 +554,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 +584,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 +614,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 +644,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 +674,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; @@ -850,7 +702,7 @@ async Task> FirstPageFunc(int? pageSizeHint) scope.Start(); try { - var response = await _containerRegistryRegistriesRestClient.ListUsagesAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryRegistriesRestClient.ListUsagesAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); } catch (Exception e) @@ -877,7 +729,7 @@ Page FirstPageFunc(int? pageSizeHint) scope.Start(); try { - var response = _containerRegistryRegistriesRestClient.ListUsages(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); + var response = _containerRegistryRegistriesRestClient.ListUsages(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken: cancellationToken); return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); } catch (Exception e) @@ -901,7 +753,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) @@ -923,7 +775,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) @@ -949,7 +801,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) @@ -975,7 +827,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) @@ -1002,8 +854,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; @@ -1032,8 +884,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; @@ -1062,8 +914,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; @@ -1092,8 +944,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; @@ -1117,7 +969,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) @@ -1139,7 +991,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) @@ -1172,7 +1024,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 @@ -1218,7 +1070,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 @@ -1263,7 +1115,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 @@ -1304,7 +1156,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 @@ -1388,7 +1240,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 fa63d5e0fffd..1d3aa723d869 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryRunCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryRunCollection.cs @@ -70,7 +70,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()); @@ -99,7 +99,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()); @@ -128,7 +128,7 @@ async Task> FirstPageFunc(int? pageSizeHint) scope.Start(); try { - var response = await _containerRegistryRunRunsRestClient.ListAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter, top, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryRunRunsRestClient.ListAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, filter, top, cancellationToken: cancellationToken).ConfigureAwait(false); return Page.FromValues(response.Value.Value.Select(value => new ContainerRegistryRunResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -143,7 +143,7 @@ async Task> NextPageFunc(string nextLink, int scope.Start(); try { - var response = await _containerRegistryRunRunsRestClient.ListNextPageAsync(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter, top, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryRunRunsRestClient.ListNextPageAsync(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, filter, top, cancellationToken: cancellationToken).ConfigureAwait(false); return Page.FromValues(response.Value.Value.Select(value => new ContainerRegistryRunResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -172,7 +172,7 @@ Page FirstPageFunc(int? pageSizeHint) scope.Start(); try { - var response = _containerRegistryRunRunsRestClient.List(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter, top, cancellationToken: cancellationToken); + var response = _containerRegistryRunRunsRestClient.List(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, filter, top, cancellationToken: cancellationToken); return Page.FromValues(response.Value.Value.Select(value => new ContainerRegistryRunResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -187,7 +187,7 @@ Page NextPageFunc(string nextLink, int? pageSizeHi scope.Start(); try { - var response = _containerRegistryRunRunsRestClient.ListNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter, top, cancellationToken: cancellationToken); + var response = _containerRegistryRunRunsRestClient.ListNextPage(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, filter, top, cancellationToken: cancellationToken); return Page.FromValues(response.Value.Value.Select(value => new ContainerRegistryRunResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -216,7 +216,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) @@ -243,7 +243,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 8fc6b9c89201..570b4326ed54 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTaskCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTaskCollection.cs @@ -73,8 +73,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; @@ -106,8 +106,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; @@ -136,7 +136,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()); @@ -165,7 +165,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()); @@ -192,7 +192,7 @@ async Task> FirstPageFunc(int? pageSizeHint) scope.Start(); try { - var response = await _containerRegistryTaskTasksRestClient.ListAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryTaskTasksRestClient.ListAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); return Page.FromValues(response.Value.Value.Select(value => new ContainerRegistryTaskResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -207,7 +207,7 @@ async Task> NextPageFunc(string nextLink, in scope.Start(); try { - var response = await _containerRegistryTaskTasksRestClient.ListNextPageAsync(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryTaskTasksRestClient.ListNextPageAsync(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); return Page.FromValues(response.Value.Value.Select(value => new ContainerRegistryTaskResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -234,7 +234,7 @@ Page FirstPageFunc(int? pageSizeHint) scope.Start(); try { - var response = _containerRegistryTaskTasksRestClient.List(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); + var response = _containerRegistryTaskTasksRestClient.List(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken: cancellationToken); return Page.FromValues(response.Value.Value.Select(value => new ContainerRegistryTaskResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -249,7 +249,7 @@ Page NextPageFunc(string nextLink, int? pageSizeH scope.Start(); try { - var response = _containerRegistryTaskTasksRestClient.ListNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); + var response = _containerRegistryTaskTasksRestClient.ListNextPage(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken: cancellationToken); return Page.FromValues(response.Value.Value.Select(value => new ContainerRegistryTaskResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -278,7 +278,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) @@ -305,7 +305,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 e2113516059a..9bf6fb2b105b 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTaskRunCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTaskRunCollection.cs @@ -73,8 +73,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; @@ -106,8 +106,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; @@ -136,7 +136,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()); @@ -165,7 +165,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()); @@ -192,7 +192,7 @@ async Task> FirstPageFunc(int? pageSizeHi scope.Start(); try { - var response = await _containerRegistryTaskRunTaskRunsRestClient.ListAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryTaskRunTaskRunsRestClient.ListAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); return Page.FromValues(response.Value.Value.Select(value => new ContainerRegistryTaskRunResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -207,7 +207,7 @@ async Task> NextPageFunc(string nextLink, scope.Start(); try { - var response = await _containerRegistryTaskRunTaskRunsRestClient.ListNextPageAsync(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryTaskRunTaskRunsRestClient.ListNextPageAsync(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); return Page.FromValues(response.Value.Value.Select(value => new ContainerRegistryTaskRunResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -234,7 +234,7 @@ Page FirstPageFunc(int? pageSizeHint) scope.Start(); try { - var response = _containerRegistryTaskRunTaskRunsRestClient.List(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); + var response = _containerRegistryTaskRunTaskRunsRestClient.List(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken: cancellationToken); return Page.FromValues(response.Value.Value.Select(value => new ContainerRegistryTaskRunResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -249,7 +249,7 @@ Page NextPageFunc(string nextLink, int? pageSi scope.Start(); try { - var response = _containerRegistryTaskRunTaskRunsRestClient.ListNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); + var response = _containerRegistryTaskRunTaskRunsRestClient.ListNextPage(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken: cancellationToken); return Page.FromValues(response.Value.Value.Select(value => new ContainerRegistryTaskRunResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -278,7 +278,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) @@ -305,7 +305,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 b09702ddad00..e4b9042281e4 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTokenCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryTokenCollection.cs @@ -73,8 +73,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; @@ -106,8 +106,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; @@ -136,7 +136,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()); @@ -165,7 +165,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()); @@ -192,7 +192,7 @@ async Task> FirstPageFunc(int? pageSizeHint scope.Start(); try { - var response = await _containerRegistryTokenTokensRestClient.ListAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryTokenTokensRestClient.ListAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); return Page.FromValues(response.Value.Value.Select(value => new ContainerRegistryTokenResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -207,7 +207,7 @@ async Task> NextPageFunc(string nextLink, i scope.Start(); try { - var response = await _containerRegistryTokenTokensRestClient.ListNextPageAsync(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryTokenTokensRestClient.ListNextPageAsync(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); return Page.FromValues(response.Value.Value.Select(value => new ContainerRegistryTokenResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -234,7 +234,7 @@ Page FirstPageFunc(int? pageSizeHint) scope.Start(); try { - var response = _containerRegistryTokenTokensRestClient.List(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); + var response = _containerRegistryTokenTokensRestClient.List(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken: cancellationToken); return Page.FromValues(response.Value.Value.Select(value => new ContainerRegistryTokenResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -249,7 +249,7 @@ Page NextPageFunc(string nextLink, int? pageSize scope.Start(); try { - var response = _containerRegistryTokenTokensRestClient.ListNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); + var response = _containerRegistryTokenTokensRestClient.ListNextPage(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken: cancellationToken); return Page.FromValues(response.Value.Value.Select(value => new ContainerRegistryTokenResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -278,7 +278,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) @@ -305,7 +305,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 68fd205176f1..f845ed306efe 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryWebhookCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ContainerRegistryWebhookCollection.cs @@ -74,8 +74,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; @@ -107,8 +107,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; @@ -137,7 +137,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()); @@ -166,7 +166,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()); @@ -193,7 +193,7 @@ async Task> FirstPageFunc(int? pageSizeHi scope.Start(); try { - var response = await _containerRegistryWebhookWebhooksRestClient.ListAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryWebhookWebhooksRestClient.ListAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); return Page.FromValues(response.Value.Value.Select(value => new ContainerRegistryWebhookResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -208,7 +208,7 @@ async Task> NextPageFunc(string nextLink, scope.Start(); try { - var response = await _containerRegistryWebhookWebhooksRestClient.ListNextPageAsync(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryWebhookWebhooksRestClient.ListNextPageAsync(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); return Page.FromValues(response.Value.Value.Select(value => new ContainerRegistryWebhookResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -235,7 +235,7 @@ Page FirstPageFunc(int? pageSizeHint) scope.Start(); try { - var response = _containerRegistryWebhookWebhooksRestClient.List(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); + var response = _containerRegistryWebhookWebhooksRestClient.List(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken: cancellationToken); return Page.FromValues(response.Value.Value.Select(value => new ContainerRegistryWebhookResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -250,7 +250,7 @@ Page NextPageFunc(string nextLink, int? pageSi scope.Start(); try { - var response = _containerRegistryWebhookWebhooksRestClient.ListNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); + var response = _containerRegistryWebhookWebhooksRestClient.ListNextPage(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken: cancellationToken); return Page.FromValues(response.Value.Value.Select(value => new ContainerRegistryWebhookResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -279,7 +279,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) @@ -306,7 +306,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 a96b760dd045..55714b142e7b 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) @@ -307,7 +307,7 @@ async Task> FirstPageFunc(int? pageSizeHint) scope.Start(); try { - var response = await _containerRegistryWebhookWebhooksRestClient.ListEventsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryWebhookWebhooksRestClient.ListEventsAsync(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -322,7 +322,7 @@ async Task> NextPageFunc(string nextLink, in scope.Start(); try { - var response = await _containerRegistryWebhookWebhooksRestClient.ListEventsNextPageAsync(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _containerRegistryWebhookWebhooksRestClient.ListEventsNextPageAsync(nextLink, Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -349,7 +349,7 @@ Page FirstPageFunc(int? pageSizeHint) scope.Start(); try { - var response = _containerRegistryWebhookWebhooksRestClient.ListEvents(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken: cancellationToken); + var response = _containerRegistryWebhookWebhooksRestClient.ListEvents(Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken: cancellationToken); return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -364,7 +364,7 @@ Page NextPageFunc(string nextLink, int? pageSizeH scope.Start(); try { - var response = _containerRegistryWebhookWebhooksRestClient.ListEventsNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken: cancellationToken); + var response = _containerRegistryWebhookWebhooksRestClient.ListEventsNextPage(nextLink, Guid.Parse(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken: cancellationToken); return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -388,7 +388,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) @@ -410,7 +410,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) @@ -443,7 +443,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 @@ -489,7 +489,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 @@ -534,7 +534,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 @@ -575,7 +575,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 @@ -659,7 +659,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/ExportPipelineCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ExportPipelineCollection.cs deleted file mode 100644 index 57621e691519..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ExportPipelineCollection.cs +++ /dev/null @@ -1,333 +0,0 @@ -// 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.Linq; -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 an instance call the GetExportPipelines method from an instance of . - /// - public partial class ExportPipelineCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _exportPipelineClientDiagnostics; - private readonly ExportPipelinesRestOperations _exportPipelineRestClient; - - /// Initializes a new instance of the class for mocking. - protected ExportPipelineCollection() - { - } - - /// 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 ExportPipelineCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _exportPipelineClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerRegistry", ExportPipelineResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ExportPipelineResource.ResourceType, out string exportPipelineApiVersion); - _exportPipelineRestClient = new ExportPipelinesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, exportPipelineApiVersion); -#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 an export pipeline for a container registry with the specified parameters. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName} - /// Operation Id: ExportPipelines_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 export pipeline. - /// The parameters for creating an export pipeline. - /// 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 exportPipelineName, ExportPipelineData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(exportPipelineName, nameof(exportPipelineName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _exportPipelineClientDiagnostics.CreateScope("ExportPipelineCollection.CreateOrUpdate"); - 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); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates an export pipeline for a container registry with the specified parameters. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName} - /// Operation Id: ExportPipelines_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 export pipeline. - /// The parameters for creating an export pipeline. - /// 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 exportPipelineName, ExportPipelineData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(exportPipelineName, nameof(exportPipelineName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _exportPipelineClientDiagnostics.CreateScope("ExportPipelineCollection.CreateOrUpdate"); - 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); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the properties of the export pipeline. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName} - /// Operation Id: ExportPipelines_Get - /// - /// The name of the export pipeline. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string exportPipelineName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(exportPipelineName, nameof(exportPipelineName)); - - using var scope = _exportPipelineClientDiagnostics.CreateScope("ExportPipelineCollection.Get"); - scope.Start(); - try - { - var response = await _exportPipelineRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, 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()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the properties of the export pipeline. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName} - /// Operation Id: ExportPipelines_Get - /// - /// The name of the export pipeline. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string exportPipelineName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(exportPipelineName, nameof(exportPipelineName)); - - using var scope = _exportPipelineClientDiagnostics.CreateScope("ExportPipelineCollection.Get"); - scope.Start(); - try - { - var response = _exportPipelineRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, exportPipelineName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ExportPipelineResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Lists all export pipelines for the specified container registry. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines - /// Operation Id: ExportPipelines_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) - { - async Task> FirstPageFunc(int? pageSizeHint) - { - using var scope = _exportPipelineClientDiagnostics.CreateScope("ExportPipelineCollection.GetAll"); - scope.Start(); - try - { - var response = await _exportPipelineRestClient.ListAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); - return Page.FromValues(response.Value.Value.Select(value => new ExportPipelineResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - async Task> NextPageFunc(string nextLink, int? pageSizeHint) - { - using var scope = _exportPipelineClientDiagnostics.CreateScope("ExportPipelineCollection.GetAll"); - scope.Start(); - try - { - var response = await _exportPipelineRestClient.ListNextPageAsync(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); - return Page.FromValues(response.Value.Value.Select(value => new ExportPipelineResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); - } - - /// - /// Lists all export pipelines for the specified container registry. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines - /// Operation Id: ExportPipelines_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) - { - Page FirstPageFunc(int? pageSizeHint) - { - using var scope = _exportPipelineClientDiagnostics.CreateScope("ExportPipelineCollection.GetAll"); - scope.Start(); - try - { - var response = _exportPipelineRestClient.List(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); - return Page.FromValues(response.Value.Value.Select(value => new ExportPipelineResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - Page NextPageFunc(string nextLink, int? pageSizeHint) - { - using var scope = _exportPipelineClientDiagnostics.CreateScope("ExportPipelineCollection.GetAll"); - scope.Start(); - try - { - var response = _exportPipelineRestClient.ListNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); - return Page.FromValues(response.Value.Value.Select(value => new ExportPipelineResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); - } - - /// - /// Checks to see if the resource exists in azure. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName} - /// Operation Id: ExportPipelines_Get - /// - /// The name of the export pipeline. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string exportPipelineName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(exportPipelineName, nameof(exportPipelineName)); - - using var scope = _exportPipelineClientDiagnostics.CreateScope("ExportPipelineCollection.Exists"); - scope.Start(); - try - { - var response = await _exportPipelineRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, exportPipelineName, 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}/exportPipelines/{exportPipelineName} - /// Operation Id: ExportPipelines_Get - /// - /// The name of the export pipeline. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string exportPipelineName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(exportPipelineName, nameof(exportPipelineName)); - - using var scope = _exportPipelineClientDiagnostics.CreateScope("ExportPipelineCollection.Exists"); - scope.Start(); - try - { - var response = _exportPipelineRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, exportPipelineName, 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/ExportPipelineData.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ExportPipelineData.cs deleted file mode 100644 index 90850b0f7906..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ExportPipelineData.cs +++ /dev/null @@ -1,54 +0,0 @@ -// 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.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.ContainerRegistry -{ - /// A class representing the ExportPipeline data model. - public partial class ExportPipelineData : ResourceData - { - /// Initializes a new instance of ExportPipelineData. - public ExportPipelineData() - { - Options = new ChangeTrackingList(); - } - - /// Initializes a new instance of ExportPipelineData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The location of the export pipeline. - /// The identity of the export pipeline. - /// The target properties of the export pipeline. - /// The list of all options configured for the pipeline. - /// The provisioning state of the pipeline at the time the operation was called. - internal ExportPipelineData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, AzureLocation? location, ManagedServiceIdentity identity, ExportPipelineTargetProperties target, IList options, ContainerRegistryProvisioningState? provisioningState) : base(id, name, resourceType, systemData) - { - Location = location; - Identity = identity; - Target = target; - Options = options; - ProvisioningState = provisioningState; - } - - /// The location of the export pipeline. - public AzureLocation? Location { get; set; } - /// The identity of the export pipeline. - public ManagedServiceIdentity Identity { get; set; } - /// The target properties of the export pipeline. - public ExportPipelineTargetProperties Target { get; set; } - /// The list of all options configured for the pipeline. - public IList Options { get; } - /// The provisioning state of the pipeline at the time the operation was called. - public ContainerRegistryProvisioningState? ProvisioningState { get; } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ExportPipelineResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ExportPipelineResource.cs deleted file mode 100644 index 4851c90308e2..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ExportPipelineResource.cs +++ /dev/null @@ -1,249 +0,0 @@ -// 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; - -namespace Azure.ResourceManager.ContainerRegistry -{ - /// - /// A Class representing an ExportPipeline along with the instance operations that can be performed on it. - /// If you have a you can construct an - /// from an instance of using the GetExportPipelineResource method. - /// Otherwise you can get one from its parent resource using the GetExportPipeline method. - /// - public partial class ExportPipelineResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string exportPipelineName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _exportPipelineClientDiagnostics; - private readonly ExportPipelinesRestOperations _exportPipelineRestClient; - private readonly ExportPipelineData _data; - - /// Initializes a new instance of the class for mocking. - protected ExportPipelineResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal ExportPipelineResource(ArmClient client, ExportPipelineData 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 ExportPipelineResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _exportPipelineClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerRegistry", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string exportPipelineApiVersion); - _exportPipelineRestClient = new ExportPipelinesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, exportPipelineApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.ContainerRegistry/registries/exportPipelines"; - - /// 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 ExportPipelineData 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 export pipeline. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName} - /// Operation Id: ExportPipelines_Get - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _exportPipelineClientDiagnostics.CreateScope("ExportPipelineResource.Get"); - scope.Start(); - try - { - var response = await _exportPipelineRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, 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()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the properties of the export pipeline. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName} - /// Operation Id: ExportPipelines_Get - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _exportPipelineClientDiagnostics.CreateScope("ExportPipelineResource.Get"); - scope.Start(); - try - { - var response = _exportPipelineRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, 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()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deletes an export pipeline from a container registry. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName} - /// Operation Id: ExportPipelines_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 = _exportPipelineClientDiagnostics.CreateScope("ExportPipelineResource.Delete"); - 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); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deletes an export pipeline from a container registry. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName} - /// Operation Id: ExportPipelines_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 = _exportPipelineClientDiagnostics.CreateScope("ExportPipelineResource.Delete"); - 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); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates an export pipeline for a container registry with the specified parameters. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName} - /// Operation Id: ExportPipelines_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 parameters for creating an export pipeline. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, ExportPipelineData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _exportPipelineClientDiagnostics.CreateScope("ExportPipelineResource.Update"); - 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); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates an export pipeline for a container registry with the specified parameters. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName} - /// Operation Id: ExportPipelines_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 parameters for creating an export pipeline. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, ExportPipelineData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _exportPipelineClientDiagnostics.CreateScope("ExportPipelineResource.Update"); - 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); - 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/Extensions/ContainerRegistryExtensions.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/ContainerRegistryExtensions.cs index 5e56da20c441..76daa1aab34d 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,101 +130,14 @@ 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) - { - return resourceGroupResource.GetCachedClient((client) => - { - return new ResourceGroupResourceExtensionClient(client, resourceGroupResource.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); - } - - #region ConnectedRegistryResource - /// - /// 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 ConnectedRegistryResource GetConnectedRegistryResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - ConnectedRegistryResource.ValidateResourceId(id); - return new ConnectedRegistryResource(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. - /// You can use to create an from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static ExportPipelineResource GetExportPipelineResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - ExportPipelineResource.ValidateResourceId(id); - return new ExportPipelineResource(client, id); - } - ); - } - #endregion - #region ContainerRegistryResource /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. @@ -211,44 +176,6 @@ public static ContainerRegistryPrivateLinkResource GetContainerRegistryPrivateLi } #endregion - #region ImportPipelineResource - /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static ImportPipelineResource GetImportPipelineResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - ImportPipelineResource.ValidateResourceId(id); - return new ImportPipelineResource(client, id); - } - ); - } - #endregion - - #region ContainerRegistryPipelineRunResource - /// - /// 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 ContainerRegistryPipelineRunResource GetContainerRegistryPipelineRunResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - ContainerRegistryPipelineRunResource.ValidateResourceId(id); - return new ContainerRegistryPipelineRunResource(client, id); - } - ); - } - #endregion - #region ContainerRegistryPrivateEndpointConnectionResource /// /// Gets an object representing a 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 68% 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 14f85ba8066f..e201cb491543 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Extensions/TenantResourceExtensionClient.cs @@ -17,24 +17,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)); @@ -44,20 +48,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) @@ -72,15 +86,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) @@ -101,11 +116,11 @@ public virtual AsyncPageable GetContainerRegistriesAs { async Task> FirstPageFunc(int? pageSizeHint) { - using var scope = ContainerRegistryRegistriesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetContainerRegistries"); + using var scope = ContainerRegistryRegistriesClientDiagnostics.CreateScope("TenantResourceExtensionClient.GetContainerRegistries"); scope.Start(); try { - var response = await ContainerRegistryRegistriesRestClient.ListAsync(Id.SubscriptionId, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await ContainerRegistryRegistriesRestClient.ListAsync(Guid.Parse(_subscriptionId), cancellationToken: cancellationToken).ConfigureAwait(false); return Page.FromValues(response.Value.Value.Select(value => new ContainerRegistryResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -116,11 +131,11 @@ async Task> FirstPageFunc(int? pageSizeHint) } async Task> NextPageFunc(string nextLink, int? pageSizeHint) { - using var scope = ContainerRegistryRegistriesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetContainerRegistries"); + using var scope = ContainerRegistryRegistriesClientDiagnostics.CreateScope("TenantResourceExtensionClient.GetContainerRegistries"); scope.Start(); try { - var response = await ContainerRegistryRegistriesRestClient.ListNextPageAsync(nextLink, Id.SubscriptionId, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await ContainerRegistryRegistriesRestClient.ListNextPageAsync(nextLink, Guid.Parse(_subscriptionId), cancellationToken: cancellationToken).ConfigureAwait(false); return Page.FromValues(response.Value.Value.Select(value => new ContainerRegistryResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -143,11 +158,11 @@ public virtual Pageable GetContainerRegistries(Cancel { Page FirstPageFunc(int? pageSizeHint) { - using var scope = ContainerRegistryRegistriesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetContainerRegistries"); + using var scope = ContainerRegistryRegistriesClientDiagnostics.CreateScope("TenantResourceExtensionClient.GetContainerRegistries"); scope.Start(); try { - var response = ContainerRegistryRegistriesRestClient.List(Id.SubscriptionId, cancellationToken: cancellationToken); + var response = ContainerRegistryRegistriesRestClient.List(Guid.Parse(_subscriptionId), cancellationToken: cancellationToken); return Page.FromValues(response.Value.Value.Select(value => new ContainerRegistryResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -158,11 +173,11 @@ Page FirstPageFunc(int? pageSizeHint) } Page NextPageFunc(string nextLink, int? pageSizeHint) { - using var scope = ContainerRegistryRegistriesClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetContainerRegistries"); + using var scope = ContainerRegistryRegistriesClientDiagnostics.CreateScope("TenantResourceExtensionClient.GetContainerRegistries"); scope.Start(); try { - var response = ContainerRegistryRegistriesRestClient.ListNextPage(nextLink, Id.SubscriptionId, cancellationToken: cancellationToken); + var response = ContainerRegistryRegistriesRestClient.ListNextPage(nextLink, Guid.Parse(_subscriptionId), cancellationToken: cancellationToken); return Page.FromValues(response.Value.Value.Select(value => new ContainerRegistryResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ImportPipelineCollection.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ImportPipelineCollection.cs deleted file mode 100644 index efb477e345b5..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ImportPipelineCollection.cs +++ /dev/null @@ -1,333 +0,0 @@ -// 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.Linq; -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 an instance call the GetImportPipelines method from an instance of . - /// - public partial class ImportPipelineCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _importPipelineClientDiagnostics; - private readonly ImportPipelinesRestOperations _importPipelineRestClient; - - /// Initializes a new instance of the class for mocking. - protected ImportPipelineCollection() - { - } - - /// 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 ImportPipelineCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _importPipelineClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerRegistry", ImportPipelineResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ImportPipelineResource.ResourceType, out string importPipelineApiVersion); - _importPipelineRestClient = new ImportPipelinesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, importPipelineApiVersion); -#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 an import pipeline for a container registry with the specified parameters. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName} - /// Operation Id: ImportPipelines_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 import pipeline. - /// The parameters for creating an import pipeline. - /// 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 importPipelineName, ImportPipelineData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(importPipelineName, nameof(importPipelineName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _importPipelineClientDiagnostics.CreateScope("ImportPipelineCollection.CreateOrUpdate"); - 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); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates an import pipeline for a container registry with the specified parameters. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName} - /// Operation Id: ImportPipelines_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 import pipeline. - /// The parameters for creating an import pipeline. - /// 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 importPipelineName, ImportPipelineData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(importPipelineName, nameof(importPipelineName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _importPipelineClientDiagnostics.CreateScope("ImportPipelineCollection.CreateOrUpdate"); - 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); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the properties of the import pipeline. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName} - /// Operation Id: ImportPipelines_Get - /// - /// The name of the import pipeline. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string importPipelineName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(importPipelineName, nameof(importPipelineName)); - - using var scope = _importPipelineClientDiagnostics.CreateScope("ImportPipelineCollection.Get"); - scope.Start(); - try - { - var response = await _importPipelineRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, 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()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the properties of the import pipeline. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName} - /// Operation Id: ImportPipelines_Get - /// - /// The name of the import pipeline. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string importPipelineName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(importPipelineName, nameof(importPipelineName)); - - using var scope = _importPipelineClientDiagnostics.CreateScope("ImportPipelineCollection.Get"); - scope.Start(); - try - { - var response = _importPipelineRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, importPipelineName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ImportPipelineResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Lists all import pipelines for the specified container registry. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines - /// Operation Id: ImportPipelines_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) - { - async Task> FirstPageFunc(int? pageSizeHint) - { - using var scope = _importPipelineClientDiagnostics.CreateScope("ImportPipelineCollection.GetAll"); - scope.Start(); - try - { - var response = await _importPipelineRestClient.ListAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); - return Page.FromValues(response.Value.Value.Select(value => new ImportPipelineResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - async Task> NextPageFunc(string nextLink, int? pageSizeHint) - { - using var scope = _importPipelineClientDiagnostics.CreateScope("ImportPipelineCollection.GetAll"); - scope.Start(); - try - { - var response = await _importPipelineRestClient.ListNextPageAsync(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); - return Page.FromValues(response.Value.Value.Select(value => new ImportPipelineResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); - } - - /// - /// Lists all import pipelines for the specified container registry. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines - /// Operation Id: ImportPipelines_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) - { - Page FirstPageFunc(int? pageSizeHint) - { - using var scope = _importPipelineClientDiagnostics.CreateScope("ImportPipelineCollection.GetAll"); - scope.Start(); - try - { - var response = _importPipelineRestClient.List(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); - return Page.FromValues(response.Value.Value.Select(value => new ImportPipelineResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - Page NextPageFunc(string nextLink, int? pageSizeHint) - { - using var scope = _importPipelineClientDiagnostics.CreateScope("ImportPipelineCollection.GetAll"); - scope.Start(); - try - { - var response = _importPipelineRestClient.ListNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); - return Page.FromValues(response.Value.Value.Select(value => new ImportPipelineResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); - } - - /// - /// Checks to see if the resource exists in azure. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName} - /// Operation Id: ImportPipelines_Get - /// - /// The name of the import pipeline. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string importPipelineName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(importPipelineName, nameof(importPipelineName)); - - using var scope = _importPipelineClientDiagnostics.CreateScope("ImportPipelineCollection.Exists"); - scope.Start(); - try - { - var response = await _importPipelineRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, importPipelineName, 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}/importPipelines/{importPipelineName} - /// Operation Id: ImportPipelines_Get - /// - /// The name of the import pipeline. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string importPipelineName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(importPipelineName, nameof(importPipelineName)); - - using var scope = _importPipelineClientDiagnostics.CreateScope("ImportPipelineCollection.Exists"); - scope.Start(); - try - { - var response = _importPipelineRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, importPipelineName, 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/ImportPipelineData.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ImportPipelineData.cs deleted file mode 100644 index eb6f67da06c2..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ImportPipelineData.cs +++ /dev/null @@ -1,77 +0,0 @@ -// 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.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.ContainerRegistry -{ - /// A class representing the ImportPipeline data model. - public partial class ImportPipelineData : ResourceData - { - /// Initializes a new instance of ImportPipelineData. - public ImportPipelineData() - { - Options = new ChangeTrackingList(); - } - - /// Initializes a new instance of ImportPipelineData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The location of the import pipeline. - /// The identity of the import pipeline. - /// The source properties of the import pipeline. - /// The properties that describe the trigger of the import pipeline. - /// The list of all options configured for the pipeline. - /// The provisioning state of the pipeline at the time the operation was called. - internal ImportPipelineData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, AzureLocation? location, ManagedServiceIdentity identity, ImportPipelineSourceProperties source, PipelineTriggerProperties trigger, IList options, ContainerRegistryProvisioningState? provisioningState) : base(id, name, resourceType, systemData) - { - Location = location; - Identity = identity; - Source = source; - Trigger = trigger; - Options = options; - ProvisioningState = provisioningState; - } - - /// The location of the import pipeline. - public AzureLocation? Location { get; set; } - /// The identity of the import pipeline. - public ManagedServiceIdentity Identity { get; set; } - /// The source properties of the import pipeline. - public ImportPipelineSourceProperties Source { get; set; } - /// The properties that describe the trigger of the import pipeline. - internal PipelineTriggerProperties Trigger { get; set; } - /// The current status of the source trigger. - public ContainerRegistryTriggerStatus? SourceTriggerStatus - { - get => Trigger is null ? default : Trigger.SourceTriggerStatus; - set - { - if (value.HasValue) - { - if (Trigger is null) - Trigger = new PipelineTriggerProperties(); - Trigger.SourceTriggerStatus = value.Value; - } - else - { - Trigger = null; - } - } - } - - /// The list of all options configured for the pipeline. - public IList Options { get; } - /// The provisioning state of the pipeline at the time the operation was called. - public ContainerRegistryProvisioningState? ProvisioningState { get; } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ImportPipelineResource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ImportPipelineResource.cs deleted file mode 100644 index 8c18ae50ebaa..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ImportPipelineResource.cs +++ /dev/null @@ -1,249 +0,0 @@ -// 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; - -namespace Azure.ResourceManager.ContainerRegistry -{ - /// - /// A Class representing an ImportPipeline along with the instance operations that can be performed on it. - /// If you have a you can construct an - /// from an instance of using the GetImportPipelineResource method. - /// Otherwise you can get one from its parent resource using the GetImportPipeline method. - /// - public partial class ImportPipelineResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string registryName, string importPipelineName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _importPipelineClientDiagnostics; - private readonly ImportPipelinesRestOperations _importPipelineRestClient; - private readonly ImportPipelineData _data; - - /// Initializes a new instance of the class for mocking. - protected ImportPipelineResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal ImportPipelineResource(ArmClient client, ImportPipelineData 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 ImportPipelineResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _importPipelineClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerRegistry", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string importPipelineApiVersion); - _importPipelineRestClient = new ImportPipelinesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, importPipelineApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.ContainerRegistry/registries/importPipelines"; - - /// 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 ImportPipelineData 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 import pipeline. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName} - /// Operation Id: ImportPipelines_Get - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _importPipelineClientDiagnostics.CreateScope("ImportPipelineResource.Get"); - scope.Start(); - try - { - var response = await _importPipelineRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, 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()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the properties of the import pipeline. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName} - /// Operation Id: ImportPipelines_Get - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _importPipelineClientDiagnostics.CreateScope("ImportPipelineResource.Get"); - scope.Start(); - try - { - var response = _importPipelineRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, 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()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deletes an import pipeline from a container registry. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName} - /// Operation Id: ImportPipelines_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 = _importPipelineClientDiagnostics.CreateScope("ImportPipelineResource.Delete"); - 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); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deletes an import pipeline from a container registry. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName} - /// Operation Id: ImportPipelines_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 = _importPipelineClientDiagnostics.CreateScope("ImportPipelineResource.Delete"); - 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); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates an import pipeline for a container registry with the specified parameters. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName} - /// Operation Id: ImportPipelines_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 parameters for creating an import pipeline. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, ImportPipelineData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _importPipelineClientDiagnostics.CreateScope("ImportPipelineResource.Update"); - 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); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates an import pipeline for a container registry with the specified parameters. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName} - /// Operation Id: ImportPipelines_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 parameters for creating an import pipeline. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, ImportPipelineData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _importPipelineClientDiagnostics.CreateScope("ImportPipelineResource.Update"); - 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); - 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/LongRunningOperation/ConnectedRegistryOperationSource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ConnectedRegistryOperationSource.cs deleted file mode 100644 index 9133280dea86..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ConnectedRegistryOperationSource.cs +++ /dev/null @@ -1,40 +0,0 @@ -// 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 ConnectedRegistryOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal ConnectedRegistryOperationSource(ArmClient client) - { - _client = client; - } - - ConnectedRegistryResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = ConnectedRegistryData.DeserializeConnectedRegistryData(document.RootElement); - return new ConnectedRegistryResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = ConnectedRegistryData.DeserializeConnectedRegistryData(document.RootElement); - return new ConnectedRegistryResource(_client, data); - } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryPipelineRunOperationSource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryPipelineRunOperationSource.cs deleted file mode 100644 index 2ec5714ba703..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ContainerRegistryPipelineRunOperationSource.cs +++ /dev/null @@ -1,40 +0,0 @@ -// 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 ContainerRegistryPipelineRunOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal ContainerRegistryPipelineRunOperationSource(ArmClient client) - { - _client = client; - } - - ContainerRegistryPipelineRunResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = ContainerRegistryPipelineRunData.DeserializeContainerRegistryPipelineRunData(document.RootElement); - return new ContainerRegistryPipelineRunResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = ContainerRegistryPipelineRunData.DeserializeContainerRegistryPipelineRunData(document.RootElement); - return new ContainerRegistryPipelineRunResource(_client, data); - } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ExportPipelineOperationSource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ExportPipelineOperationSource.cs deleted file mode 100644 index 58681b307317..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ExportPipelineOperationSource.cs +++ /dev/null @@ -1,40 +0,0 @@ -// 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 ExportPipelineOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal ExportPipelineOperationSource(ArmClient client) - { - _client = client; - } - - ExportPipelineResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = ExportPipelineData.DeserializeExportPipelineData(document.RootElement); - return new ExportPipelineResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = ExportPipelineData.DeserializeExportPipelineData(document.RootElement); - return new ExportPipelineResource(_client, data); - } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ImportPipelineOperationSource.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ImportPipelineOperationSource.cs deleted file mode 100644 index de2884aaef0c..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/LongRunningOperation/ImportPipelineOperationSource.cs +++ /dev/null @@ -1,40 +0,0 @@ -// 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 ImportPipelineOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal ImportPipelineOperationSource(ArmClient client) - { - _client = client; - } - - ImportPipelineResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = ImportPipelineData.DeserializeImportPipelineData(document.RootElement); - return new ImportPipelineResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = ImportPipelineData.DeserializeImportPipelineData(document.RootElement); - return new ImportPipelineResource(_client, data); - } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/AzureADAuthenticationAsArmPolicy.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/AzureADAuthenticationAsArmPolicy.Serialization.cs deleted file mode 100644 index 7ea7147d2d32..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/AzureADAuthenticationAsArmPolicy.Serialization.cs +++ /dev/null @@ -1,45 +0,0 @@ -// 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 -{ - internal partial class AzureADAuthenticationAsArmPolicy : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Status)) - { - writer.WritePropertyName("status"); - writer.WriteStringValue(Status.Value.ToString()); - } - writer.WriteEndObject(); - } - - internal static AzureADAuthenticationAsArmPolicy DeserializeAzureADAuthenticationAsArmPolicy(JsonElement element) - { - Optional status = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("status")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - status = new AzureADAuthenticationAsArmPolicyStatus(property.Value.GetString()); - continue; - } - } - return new AzureADAuthenticationAsArmPolicy(Optional.ToNullable(status)); - } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/AzureADAuthenticationAsArmPolicy.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/AzureADAuthenticationAsArmPolicy.cs deleted file mode 100644 index 9e758a944271..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/AzureADAuthenticationAsArmPolicy.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.ContainerRegistry.Models -{ - /// The policy for using ARM audience token for a container registry. - internal partial class AzureADAuthenticationAsArmPolicy - { - /// Initializes a new instance of AzureADAuthenticationAsArmPolicy. - public AzureADAuthenticationAsArmPolicy() - { - } - - /// Initializes a new instance of AzureADAuthenticationAsArmPolicy. - /// The value that indicates whether the policy is enabled or not. - internal AzureADAuthenticationAsArmPolicy(AzureADAuthenticationAsArmPolicyStatus? status) - { - Status = status; - } - - /// The value that indicates whether the policy is enabled or not. - public AzureADAuthenticationAsArmPolicyStatus? Status { get; set; } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/AzureADAuthenticationAsArmPolicyStatus.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/AzureADAuthenticationAsArmPolicyStatus.cs deleted file mode 100644 index cfd8defcdae8..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/AzureADAuthenticationAsArmPolicyStatus.cs +++ /dev/null @@ -1,51 +0,0 @@ -// 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 value that indicates whether the policy is enabled or not. - public readonly partial struct AzureADAuthenticationAsArmPolicyStatus : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public AzureADAuthenticationAsArmPolicyStatus(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string EnabledValue = "enabled"; - private const string DisabledValue = "disabled"; - - /// enabled. - public static AzureADAuthenticationAsArmPolicyStatus Enabled { get; } = new AzureADAuthenticationAsArmPolicyStatus(EnabledValue); - /// disabled. - public static AzureADAuthenticationAsArmPolicyStatus Disabled { get; } = new AzureADAuthenticationAsArmPolicyStatus(DisabledValue); - /// Determines if two values are the same. - public static bool operator ==(AzureADAuthenticationAsArmPolicyStatus left, AzureADAuthenticationAsArmPolicyStatus right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(AzureADAuthenticationAsArmPolicyStatus left, AzureADAuthenticationAsArmPolicyStatus right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator AzureADAuthenticationAsArmPolicyStatus(string value) => new AzureADAuthenticationAsArmPolicyStatus(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is AzureADAuthenticationAsArmPolicyStatus other && Equals(other); - /// - public bool Equals(AzureADAuthenticationAsArmPolicyStatus 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/ConnectedRegistryActivation.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryActivation.Serialization.cs deleted file mode 100644 index b24d0461570b..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryActivation.Serialization.cs +++ /dev/null @@ -1,34 +0,0 @@ -// 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 -{ - internal partial class ConnectedRegistryActivation - { - internal static ConnectedRegistryActivation DeserializeConnectedRegistryActivation(JsonElement element) - { - Optional status = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("status")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - status = new ConnectedRegistryActivationStatus(property.Value.GetString()); - continue; - } - } - return new ConnectedRegistryActivation(Optional.ToNullable(status)); - } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryActivation.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryActivation.cs deleted file mode 100644 index 662e9bcb1317..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryActivation.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.ContainerRegistry.Models -{ - /// The activation properties of the connected registry. - internal partial class ConnectedRegistryActivation - { - /// Initializes a new instance of ConnectedRegistryActivation. - internal ConnectedRegistryActivation() - { - } - - /// Initializes a new instance of ConnectedRegistryActivation. - /// The activation status of the connected registry. - internal ConnectedRegistryActivation(ConnectedRegistryActivationStatus? status) - { - Status = status; - } - - /// The activation status of the connected registry. - public ConnectedRegistryActivationStatus? Status { get; } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryActivationStatus.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryActivationStatus.cs deleted file mode 100644 index 193f4fb3b7d5..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryActivationStatus.cs +++ /dev/null @@ -1,51 +0,0 @@ -// 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 activation status of the connected registry. - public readonly partial struct ConnectedRegistryActivationStatus : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ConnectedRegistryActivationStatus(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ActiveValue = "Active"; - private const string InactiveValue = "Inactive"; - - /// Active. - public static ConnectedRegistryActivationStatus Active { get; } = new ConnectedRegistryActivationStatus(ActiveValue); - /// Inactive. - public static ConnectedRegistryActivationStatus Inactive { get; } = new ConnectedRegistryActivationStatus(InactiveValue); - /// Determines if two values are the same. - public static bool operator ==(ConnectedRegistryActivationStatus left, ConnectedRegistryActivationStatus right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ConnectedRegistryActivationStatus left, ConnectedRegistryActivationStatus right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ConnectedRegistryActivationStatus(string value) => new ConnectedRegistryActivationStatus(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ConnectedRegistryActivationStatus other && Equals(other); - /// - public bool Equals(ConnectedRegistryActivationStatus 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/ConnectedRegistryAuditLogStatus.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryAuditLogStatus.cs deleted file mode 100644 index 3903ef3982fc..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryAuditLogStatus.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerRegistry.Models -{ - /// Indicates whether audit logs are enabled on the connected registry. - public readonly partial struct ConnectedRegistryAuditLogStatus : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ConnectedRegistryAuditLogStatus(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string EnabledValue = "Enabled"; - private const string DisabledValue = "Disabled"; - - /// Enabled. - public static ConnectedRegistryAuditLogStatus Enabled { get; } = new ConnectedRegistryAuditLogStatus(EnabledValue); - /// Disabled. - public static ConnectedRegistryAuditLogStatus Disabled { get; } = new ConnectedRegistryAuditLogStatus(DisabledValue); - /// Determines if two values are the same. - public static bool operator ==(ConnectedRegistryAuditLogStatus left, ConnectedRegistryAuditLogStatus right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ConnectedRegistryAuditLogStatus left, ConnectedRegistryAuditLogStatus right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ConnectedRegistryAuditLogStatus(string value) => new ConnectedRegistryAuditLogStatus(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ConnectedRegistryAuditLogStatus other && Equals(other); - /// - public bool Equals(ConnectedRegistryAuditLogStatus 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/ConnectedRegistryConnectionState.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryConnectionState.cs deleted file mode 100644 index 97fdc63f2eeb..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryConnectionState.cs +++ /dev/null @@ -1,57 +0,0 @@ -// 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 current connection state of the connected registry. - public readonly partial struct ConnectedRegistryConnectionState : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ConnectedRegistryConnectionState(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string OnlineValue = "Online"; - private const string OfflineValue = "Offline"; - private const string SyncingValue = "Syncing"; - private const string UnhealthyValue = "Unhealthy"; - - /// Online. - public static ConnectedRegistryConnectionState Online { get; } = new ConnectedRegistryConnectionState(OnlineValue); - /// Offline. - public static ConnectedRegistryConnectionState Offline { get; } = new ConnectedRegistryConnectionState(OfflineValue); - /// Syncing. - public static ConnectedRegistryConnectionState Syncing { get; } = new ConnectedRegistryConnectionState(SyncingValue); - /// Unhealthy. - public static ConnectedRegistryConnectionState Unhealthy { get; } = new ConnectedRegistryConnectionState(UnhealthyValue); - /// Determines if two values are the same. - public static bool operator ==(ConnectedRegistryConnectionState left, ConnectedRegistryConnectionState right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ConnectedRegistryConnectionState left, ConnectedRegistryConnectionState right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ConnectedRegistryConnectionState(string value) => new ConnectedRegistryConnectionState(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ConnectedRegistryConnectionState other && Equals(other); - /// - public bool Equals(ConnectedRegistryConnectionState 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/ConnectedRegistryData.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryData.Serialization.cs deleted file mode 100644 index 380c444ea10b..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryData.Serialization.cs +++ /dev/null @@ -1,259 +0,0 @@ -// 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 ConnectedRegistryData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(Mode)) - { - writer.WritePropertyName("mode"); - writer.WriteStringValue(Mode.Value.ToString()); - } - if (Optional.IsDefined(Parent)) - { - writer.WritePropertyName("parent"); - writer.WriteObjectValue(Parent); - } - if (Optional.IsCollectionDefined(ClientTokenIds)) - { - writer.WritePropertyName("clientTokenIds"); - writer.WriteStartArray(); - foreach (var item in ClientTokenIds) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(LoginServer)) - { - writer.WritePropertyName("loginServer"); - writer.WriteObjectValue(LoginServer); - } - if (Optional.IsDefined(Logging)) - { - writer.WritePropertyName("logging"); - writer.WriteObjectValue(Logging); - } - if (Optional.IsCollectionDefined(NotificationsList)) - { - writer.WritePropertyName("notificationsList"); - writer.WriteStartArray(); - foreach (var item in NotificationsList) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static ConnectedRegistryData DeserializeConnectedRegistryData(JsonElement element) - { - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional provisioningState = default; - Optional mode = default; - Optional version = default; - Optional connectionState = default; - Optional lastActivityTime = default; - Optional activation = default; - Optional parent = default; - Optional> clientTokenIds = default; - Optional loginServer = default; - Optional logging = default; - Optional> statusDetails = default; - Optional> notificationsList = 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("provisioningState")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - provisioningState = new ContainerRegistryProvisioningState(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("mode")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - mode = new ConnectedRegistryMode(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("version")) - { - version = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("connectionState")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - connectionState = new ConnectedRegistryConnectionState(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("lastActivityTime")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - lastActivityTime = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("activation")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - activation = ConnectedRegistryActivation.DeserializeConnectedRegistryActivation(property0.Value); - continue; - } - if (property0.NameEquals("parent")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - parent = ConnectedRegistryParent.DeserializeConnectedRegistryParent(property0.Value); - continue; - } - if (property0.NameEquals("clientTokenIds")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(new ResourceIdentifier(item.GetString())); - } - clientTokenIds = array; - continue; - } - if (property0.NameEquals("loginServer")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - loginServer = ConnectedRegistryLoginServer.DeserializeConnectedRegistryLoginServer(property0.Value); - continue; - } - if (property0.NameEquals("logging")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - logging = ConnectedRegistryLogging.DeserializeConnectedRegistryLogging(property0.Value); - continue; - } - if (property0.NameEquals("statusDetails")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(ConnectedRegistryStatusDetail.DeserializeConnectedRegistryStatusDetail(item)); - } - statusDetails = array; - continue; - } - if (property0.NameEquals("notificationsList")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - notificationsList = array; - continue; - } - } - continue; - } - } - return new ConnectedRegistryData(id, name, type, systemData.Value, Optional.ToNullable(provisioningState), Optional.ToNullable(mode), version.Value, Optional.ToNullable(connectionState), Optional.ToNullable(lastActivityTime), activation.Value, parent.Value, Optional.ToList(clientTokenIds), loginServer.Value, logging.Value, Optional.ToList(statusDetails), Optional.ToList(notificationsList)); - } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryListResult.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryListResult.Serialization.cs deleted file mode 100644 index 9b04038c0a20..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryListResult.Serialization.cs +++ /dev/null @@ -1,47 +0,0 @@ -// 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 ConnectedRegistryListResult - { - internal static ConnectedRegistryListResult DeserializeConnectedRegistryListResult(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(ConnectedRegistryData.DeserializeConnectedRegistryData(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new ConnectedRegistryListResult(Optional.ToList(value), nextLink.Value); - } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryListResult.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryListResult.cs deleted file mode 100644 index 35c44f497886..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryListResult.cs +++ /dev/null @@ -1,37 +0,0 @@ -// 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 connected registries for a container registry. - internal partial class ConnectedRegistryListResult - { - /// Initializes a new instance of ConnectedRegistryListResult. - internal ConnectedRegistryListResult() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of ConnectedRegistryListResult. - /// The list of connected registries. Since this list may be incomplete, the nextLink field should be used to request the next list of connected registries. - /// The URI that can be used to request the next list of connected registries. - internal ConnectedRegistryListResult(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// The list of connected registries. Since this list may be incomplete, the nextLink field should be used to request the next list of connected registries. - public IReadOnlyList Value { get; } - /// The URI that can be used to request the next list of connected registries. - public string NextLink { get; } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryLogLevel.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryLogLevel.cs deleted file mode 100644 index 74b86a6bc0ed..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryLogLevel.cs +++ /dev/null @@ -1,60 +0,0 @@ -// 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 verbosity of logs persisted on the connected registry. - public readonly partial struct ConnectedRegistryLogLevel : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ConnectedRegistryLogLevel(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string DebugValue = "Debug"; - private const string InformationValue = "Information"; - private const string WarningValue = "Warning"; - private const string ErrorValue = "Error"; - private const string NoneValue = "None"; - - /// Debug. - public static ConnectedRegistryLogLevel Debug { get; } = new ConnectedRegistryLogLevel(DebugValue); - /// Information. - public static ConnectedRegistryLogLevel Information { get; } = new ConnectedRegistryLogLevel(InformationValue); - /// Warning. - public static ConnectedRegistryLogLevel Warning { get; } = new ConnectedRegistryLogLevel(WarningValue); - /// Error. - public static ConnectedRegistryLogLevel Error { get; } = new ConnectedRegistryLogLevel(ErrorValue); - /// None. - public static ConnectedRegistryLogLevel None { get; } = new ConnectedRegistryLogLevel(NoneValue); - /// Determines if two values are the same. - public static bool operator ==(ConnectedRegistryLogLevel left, ConnectedRegistryLogLevel right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ConnectedRegistryLogLevel left, ConnectedRegistryLogLevel right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ConnectedRegistryLogLevel(string value) => new ConnectedRegistryLogLevel(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ConnectedRegistryLogLevel other && Equals(other); - /// - public bool Equals(ConnectedRegistryLogLevel 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/ConnectedRegistryLogging.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryLogging.Serialization.cs deleted file mode 100644 index ef5b9fc742ec..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryLogging.Serialization.cs +++ /dev/null @@ -1,61 +0,0 @@ -// 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 ConnectedRegistryLogging : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(LogLevel)) - { - writer.WritePropertyName("logLevel"); - writer.WriteStringValue(LogLevel.Value.ToString()); - } - if (Optional.IsDefined(AuditLogStatus)) - { - writer.WritePropertyName("auditLogStatus"); - writer.WriteStringValue(AuditLogStatus.Value.ToString()); - } - writer.WriteEndObject(); - } - - internal static ConnectedRegistryLogging DeserializeConnectedRegistryLogging(JsonElement element) - { - Optional logLevel = default; - Optional auditLogStatus = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("logLevel")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - logLevel = new ConnectedRegistryLogLevel(property.Value.GetString()); - continue; - } - if (property.NameEquals("auditLogStatus")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - auditLogStatus = new ConnectedRegistryAuditLogStatus(property.Value.GetString()); - continue; - } - } - return new ConnectedRegistryLogging(Optional.ToNullable(logLevel), Optional.ToNullable(auditLogStatus)); - } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryLogging.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryLogging.cs deleted file mode 100644 index aadfde68c228..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryLogging.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.ContainerRegistry.Models -{ - /// The logging properties of the connected registry. - public partial class ConnectedRegistryLogging - { - /// Initializes a new instance of ConnectedRegistryLogging. - public ConnectedRegistryLogging() - { - } - - /// Initializes a new instance of ConnectedRegistryLogging. - /// The verbosity of logs persisted on the connected registry. - /// Indicates whether audit logs are enabled on the connected registry. - internal ConnectedRegistryLogging(ConnectedRegistryLogLevel? logLevel, ConnectedRegistryAuditLogStatus? auditLogStatus) - { - LogLevel = logLevel; - AuditLogStatus = auditLogStatus; - } - - /// The verbosity of logs persisted on the connected registry. - public ConnectedRegistryLogLevel? LogLevel { get; set; } - /// Indicates whether audit logs are enabled on the connected registry. - public ConnectedRegistryAuditLogStatus? AuditLogStatus { get; set; } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryLoginServer.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryLoginServer.Serialization.cs deleted file mode 100644 index 13fec21a44a1..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryLoginServer.Serialization.cs +++ /dev/null @@ -1,46 +0,0 @@ -// 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 ConnectedRegistryLoginServer : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } - - internal static ConnectedRegistryLoginServer DeserializeConnectedRegistryLoginServer(JsonElement element) - { - Optional host = default; - Optional tls = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("host")) - { - host = property.Value.GetString(); - continue; - } - if (property.NameEquals("tls")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - tls = TlsProperties.DeserializeTlsProperties(property.Value); - continue; - } - } - return new ConnectedRegistryLoginServer(host.Value, tls.Value); - } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryLoginServer.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryLoginServer.cs deleted file mode 100644 index 8d46f3835d8c..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryLoginServer.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.ContainerRegistry.Models -{ - /// The login server properties of the connected registry. - public partial class ConnectedRegistryLoginServer - { - /// Initializes a new instance of ConnectedRegistryLoginServer. - public ConnectedRegistryLoginServer() - { - } - - /// Initializes a new instance of ConnectedRegistryLoginServer. - /// The host of the connected registry. Can be FQDN or IP. - /// The TLS properties of the connected registry login server. - internal ConnectedRegistryLoginServer(string host, TlsProperties tls) - { - Host = host; - Tls = tls; - } - - /// The host of the connected registry. Can be FQDN or IP. - public string Host { get; } - /// The TLS properties of the connected registry login server. - public TlsProperties Tls { get; } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryMode.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryMode.cs deleted file mode 100644 index d3c84e4127ab..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryMode.cs +++ /dev/null @@ -1,57 +0,0 @@ -// 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 mode of the connected registry resource that indicates the permissions of the registry. - public readonly partial struct ConnectedRegistryMode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ConnectedRegistryMode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ReadWriteValue = "ReadWrite"; - private const string ReadOnlyValue = "ReadOnly"; - private const string RegistryValue = "Registry"; - private const string MirrorValue = "Mirror"; - - /// ReadWrite. - public static ConnectedRegistryMode ReadWrite { get; } = new ConnectedRegistryMode(ReadWriteValue); - /// ReadOnly. - public static ConnectedRegistryMode ReadOnly { get; } = new ConnectedRegistryMode(ReadOnlyValue); - /// Registry. - public static ConnectedRegistryMode Registry { get; } = new ConnectedRegistryMode(RegistryValue); - /// Mirror. - public static ConnectedRegistryMode Mirror { get; } = new ConnectedRegistryMode(MirrorValue); - /// Determines if two values are the same. - public static bool operator ==(ConnectedRegistryMode left, ConnectedRegistryMode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ConnectedRegistryMode left, ConnectedRegistryMode right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ConnectedRegistryMode(string value) => new ConnectedRegistryMode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ConnectedRegistryMode other && Equals(other); - /// - public bool Equals(ConnectedRegistryMode 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/ConnectedRegistryParent.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryParent.Serialization.cs deleted file mode 100644 index 8e42b1d26a82..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryParent.Serialization.cs +++ /dev/null @@ -1,53 +0,0 @@ -// 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 ConnectedRegistryParent : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Id)) - { - writer.WritePropertyName("id"); - writer.WriteStringValue(Id); - } - writer.WritePropertyName("syncProperties"); - writer.WriteObjectValue(SyncProperties); - writer.WriteEndObject(); - } - - internal static ConnectedRegistryParent DeserializeConnectedRegistryParent(JsonElement element) - { - Optional id = default; - ConnectedRegistrySyncProperties syncProperties = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("syncProperties")) - { - syncProperties = ConnectedRegistrySyncProperties.DeserializeConnectedRegistrySyncProperties(property.Value); - continue; - } - } - return new ConnectedRegistryParent(id.Value, syncProperties); - } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryParent.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryParent.cs deleted file mode 100644 index 941a46ce2296..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryParent.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerRegistry.Models -{ - /// The properties of the connected registry parent. - public partial class ConnectedRegistryParent - { - /// Initializes a new instance of ConnectedRegistryParent. - /// The sync properties of the connected registry with its parent. - /// is null. - public ConnectedRegistryParent(ConnectedRegistrySyncProperties syncProperties) - { - Argument.AssertNotNull(syncProperties, nameof(syncProperties)); - - SyncProperties = syncProperties; - } - - /// Initializes a new instance of ConnectedRegistryParent. - /// The resource ID of the parent to which the connected registry will be associated. - /// The sync properties of the connected registry with its parent. - internal ConnectedRegistryParent(ResourceIdentifier id, ConnectedRegistrySyncProperties syncProperties) - { - Id = id; - SyncProperties = syncProperties; - } - - /// The resource ID of the parent to which the connected registry will be associated. - public ResourceIdentifier Id { get; set; } - /// The sync properties of the connected registry with its parent. - public ConnectedRegistrySyncProperties SyncProperties { get; set; } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryPatch.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryPatch.Serialization.cs deleted file mode 100644 index cb3a47ec65cb..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryPatch.Serialization.cs +++ /dev/null @@ -1,54 +0,0 @@ -// 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 ConnectedRegistryPatch : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(SyncProperties)) - { - writer.WritePropertyName("syncProperties"); - writer.WriteObjectValue(SyncProperties); - } - if (Optional.IsDefined(Logging)) - { - writer.WritePropertyName("logging"); - writer.WriteObjectValue(Logging); - } - if (Optional.IsCollectionDefined(ClientTokenIds)) - { - writer.WritePropertyName("clientTokenIds"); - writer.WriteStartArray(); - foreach (var item in ClientTokenIds) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(NotificationsList)) - { - writer.WritePropertyName("notificationsList"); - writer.WriteStartArray(); - foreach (var item in NotificationsList) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryPatch.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryPatch.cs deleted file mode 100644 index 651b6f287f37..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryPatch.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerRegistry.Models -{ - /// The parameters for updating a connected registry. - public partial class ConnectedRegistryPatch - { - /// Initializes a new instance of ConnectedRegistryPatch. - public ConnectedRegistryPatch() - { - ClientTokenIds = new ChangeTrackingList(); - NotificationsList = new ChangeTrackingList(); - } - - /// The sync properties of the connected registry with its parent. - public ConnectedRegistrySyncUpdateProperties SyncProperties { get; set; } - /// The logging properties of the connected registry. - public ConnectedRegistryLogging Logging { get; set; } - /// The list of the ACR token resource IDs used to authenticate clients to the connected registry. - public IList ClientTokenIds { get; } - /// The list of notifications subscription information for the connected registry. - public IList NotificationsList { get; } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryStatusDetail.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryStatusDetail.Serialization.cs deleted file mode 100644 index 2590534ad71a..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryStatusDetail.Serialization.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerRegistry.Models -{ - public partial class ConnectedRegistryStatusDetail - { - internal static ConnectedRegistryStatusDetail DeserializeConnectedRegistryStatusDetail(JsonElement element) - { - Optional type = default; - Optional code = default; - Optional description = default; - Optional timestamp = default; - Optional correlationId = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("code")) - { - code = property.Value.GetString(); - continue; - } - if (property.NameEquals("description")) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("timestamp")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - timestamp = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("correlationId")) - { - correlationId = property.Value.GetString(); - continue; - } - } - return new ConnectedRegistryStatusDetail(type.Value, code.Value, description.Value, Optional.ToNullable(timestamp), correlationId.Value); - } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryStatusDetail.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryStatusDetail.cs deleted file mode 100644 index 6194c9ea286c..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistryStatusDetail.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.ResourceManager.ContainerRegistry.Models -{ - /// The status detail properties of the connected registry. - public partial class ConnectedRegistryStatusDetail - { - /// Initializes a new instance of ConnectedRegistryStatusDetail. - internal ConnectedRegistryStatusDetail() - { - } - - /// Initializes a new instance of ConnectedRegistryStatusDetail. - /// The component of the connected registry corresponding to the status. - /// The code of the status. - /// The description of the status. - /// The timestamp of the status. - /// The correlation ID of the status. - internal ConnectedRegistryStatusDetail(string statusDetailType, string code, string description, DateTimeOffset? timestamp, string correlationId) - { - StatusDetailType = statusDetailType; - Code = code; - Description = description; - Timestamp = timestamp; - CorrelationId = correlationId; - } - - /// The component of the connected registry corresponding to the status. - public string StatusDetailType { get; } - /// The code of the status. - public string Code { get; } - /// The description of the status. - public string Description { get; } - /// The timestamp of the status. - public DateTimeOffset? Timestamp { get; } - /// The correlation ID of the status. - public string CorrelationId { get; } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistrySyncProperties.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistrySyncProperties.Serialization.cs deleted file mode 100644 index ab8a7399276c..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistrySyncProperties.Serialization.cs +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerRegistry.Models -{ - public partial class ConnectedRegistrySyncProperties : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("tokenId"); - writer.WriteStringValue(TokenId); - if (Optional.IsDefined(Schedule)) - { - writer.WritePropertyName("schedule"); - writer.WriteStringValue(Schedule); - } - if (Optional.IsDefined(SyncWindow)) - { - writer.WritePropertyName("syncWindow"); - writer.WriteStringValue(SyncWindow.Value, "P"); - } - writer.WritePropertyName("messageTtl"); - writer.WriteStringValue(MessageTtl, "P"); - writer.WriteEndObject(); - } - - internal static ConnectedRegistrySyncProperties DeserializeConnectedRegistrySyncProperties(JsonElement element) - { - ResourceIdentifier tokenId = default; - Optional schedule = default; - Optional syncWindow = default; - TimeSpan messageTtl = default; - Optional lastSyncTime = default; - Optional gatewayEndpoint = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("tokenId")) - { - tokenId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("schedule")) - { - schedule = property.Value.GetString(); - continue; - } - if (property.NameEquals("syncWindow")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - syncWindow = property.Value.GetTimeSpan("P"); - continue; - } - if (property.NameEquals("messageTtl")) - { - messageTtl = property.Value.GetTimeSpan("P"); - continue; - } - if (property.NameEquals("lastSyncTime")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - lastSyncTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("gatewayEndpoint")) - { - gatewayEndpoint = property.Value.GetString(); - continue; - } - } - return new ConnectedRegistrySyncProperties(tokenId, schedule.Value, Optional.ToNullable(syncWindow), messageTtl, Optional.ToNullable(lastSyncTime), gatewayEndpoint.Value); - } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistrySyncProperties.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistrySyncProperties.cs deleted file mode 100644 index f3a8ae5a860d..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistrySyncProperties.cs +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerRegistry.Models -{ - /// The sync properties of the connected registry with its parent. - public partial class ConnectedRegistrySyncProperties - { - /// Initializes a new instance of ConnectedRegistrySyncProperties. - /// The resource ID of the ACR token used to authenticate the connected registry to its parent during sync. - /// The period of time for which a message is available to sync before it is expired. Specify the duration using the format P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601. - /// is null. - public ConnectedRegistrySyncProperties(ResourceIdentifier tokenId, TimeSpan messageTtl) - { - Argument.AssertNotNull(tokenId, nameof(tokenId)); - - TokenId = tokenId; - MessageTtl = messageTtl; - } - - /// Initializes a new instance of ConnectedRegistrySyncProperties. - /// The resource ID of the ACR token used to authenticate the connected registry to its parent during sync. - /// The cron expression indicating the schedule that the connected registry will sync with its parent. - /// The time window during which sync is enabled for each schedule occurrence. Specify the duration using the format P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601. - /// The period of time for which a message is available to sync before it is expired. Specify the duration using the format P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601. - /// The last time a sync occurred between the connected registry and its parent. - /// The gateway endpoint used by the connected registry to communicate with its parent. - internal ConnectedRegistrySyncProperties(ResourceIdentifier tokenId, string schedule, TimeSpan? syncWindow, TimeSpan messageTtl, DateTimeOffset? lastSyncOn, string gatewayEndpoint) - { - TokenId = tokenId; - Schedule = schedule; - SyncWindow = syncWindow; - MessageTtl = messageTtl; - LastSyncOn = lastSyncOn; - GatewayEndpoint = gatewayEndpoint; - } - - /// The resource ID of the ACR token used to authenticate the connected registry to its parent during sync. - public ResourceIdentifier TokenId { get; set; } - /// The cron expression indicating the schedule that the connected registry will sync with its parent. - public string Schedule { get; set; } - /// The time window during which sync is enabled for each schedule occurrence. Specify the duration using the format P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601. - public TimeSpan? SyncWindow { get; set; } - /// The period of time for which a message is available to sync before it is expired. Specify the duration using the format P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601. - public TimeSpan MessageTtl { get; set; } - /// The last time a sync occurred between the connected registry and its parent. - public DateTimeOffset? LastSyncOn { get; } - /// The gateway endpoint used by the connected registry to communicate with its parent. - public string GatewayEndpoint { get; } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistrySyncUpdateProperties.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistrySyncUpdateProperties.Serialization.cs deleted file mode 100644 index 8bd23af56cad..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistrySyncUpdateProperties.Serialization.cs +++ /dev/null @@ -1,36 +0,0 @@ -// 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 ConnectedRegistrySyncUpdateProperties : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Schedule)) - { - writer.WritePropertyName("schedule"); - writer.WriteStringValue(Schedule); - } - if (Optional.IsDefined(SyncWindow)) - { - writer.WritePropertyName("syncWindow"); - writer.WriteStringValue(SyncWindow.Value, "P"); - } - if (Optional.IsDefined(MessageTtl)) - { - writer.WritePropertyName("messageTtl"); - writer.WriteStringValue(MessageTtl.Value, "P"); - } - writer.WriteEndObject(); - } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistrySyncUpdateProperties.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistrySyncUpdateProperties.cs deleted file mode 100644 index 90a651223234..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ConnectedRegistrySyncUpdateProperties.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.ResourceManager.ContainerRegistry.Models -{ - /// The parameters for updating the sync properties of the connected registry with its parent. - public partial class ConnectedRegistrySyncUpdateProperties - { - /// Initializes a new instance of ConnectedRegistrySyncUpdateProperties. - public ConnectedRegistrySyncUpdateProperties() - { - } - - /// The cron expression indicating the schedule that the connected registry will sync with its parent. - public string Schedule { get; set; } - /// The time window during which sync is enabled for each schedule occurrence. Specify the duration using the format P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601. - public TimeSpan? SyncWindow { get; set; } - /// The period of time for which a message is available to sync before it is expired. Specify the duration using the format P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601. - public TimeSpan? MessageTtl { get; set; } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryData.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryData.Serialization.cs index 0ce232301843..cbcceaa77646 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryData.Serialization.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryData.Serialization.cs @@ -81,11 +81,6 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("zoneRedundancy"); writer.WriteStringValue(ZoneRedundancy.Value.ToString()); } - if (Optional.IsDefined(IsAnonymousPullEnabled)) - { - writer.WritePropertyName("anonymousPullEnabled"); - writer.WriteBooleanValue(IsAnonymousPullEnabled.Value); - } writer.WriteEndObject(); writer.WriteEndObject(); } @@ -114,7 +109,6 @@ internal static ContainerRegistryData DeserializeContainerRegistryData(JsonEleme Optional publicNetworkAccess = default; Optional networkRuleBypassOptions = default; Optional zoneRedundancy = default; - Optional anonymousPullEnabled = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("sku")) @@ -331,21 +325,11 @@ internal static ContainerRegistryData DeserializeContainerRegistryData(JsonEleme zoneRedundancy = new ContainerRegistryZoneRedundancy(property0.Value.GetString()); continue; } - if (property0.NameEquals("anonymousPullEnabled")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - anonymousPullEnabled = property0.Value.GetBoolean(); - continue; - } } continue; } } - return new ContainerRegistryData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, sku, identity, loginServer.Value, Optional.ToNullable(creationDate), Optional.ToNullable(provisioningState), status.Value, Optional.ToNullable(adminUserEnabled), networkRuleSet.Value, policies.Value, encryption.Value, Optional.ToNullable(dataEndpointEnabled), Optional.ToList(dataEndpointHostNames), Optional.ToList(privateEndpointConnections), Optional.ToNullable(publicNetworkAccess), Optional.ToNullable(networkRuleBypassOptions), Optional.ToNullable(zoneRedundancy), Optional.ToNullable(anonymousPullEnabled)); + return new ContainerRegistryData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, sku, identity, loginServer.Value, Optional.ToNullable(creationDate), Optional.ToNullable(provisioningState), status.Value, Optional.ToNullable(adminUserEnabled), networkRuleSet.Value, policies.Value, encryption.Value, Optional.ToNullable(dataEndpointEnabled), Optional.ToList(dataEndpointHostNames), Optional.ToList(privateEndpointConnections), Optional.ToNullable(publicNetworkAccess), Optional.ToNullable(networkRuleBypassOptions), Optional.ToNullable(zoneRedundancy)); } } } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPatch.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPatch.Serialization.cs index 499cbf4c3e26..43145bcb404a 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPatch.Serialization.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPatch.Serialization.cs @@ -73,11 +73,6 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("networkRuleBypassOptions"); writer.WriteStringValue(NetworkRuleBypassOptions.Value.ToString()); } - if (Optional.IsDefined(IsAnonymousPullEnabled)) - { - writer.WritePropertyName("anonymousPullEnabled"); - writer.WriteBooleanValue(IsAnonymousPullEnabled.Value); - } writer.WriteEndObject(); writer.WriteEndObject(); } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPatch.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPatch.cs index 90456fd1baca..8a7e2d3e7a98 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPatch.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPatch.cs @@ -40,7 +40,5 @@ public ContainerRegistryPatch() public ContainerRegistryPublicNetworkAccess? PublicNetworkAccess { get; set; } /// Whether to allow trusted Azure services to access a network restricted registry. public ContainerRegistryNetworkRuleBypassOption? NetworkRuleBypassOptions { get; set; } - /// Enables registry-wide pull from unauthenticated clients. - public bool? IsAnonymousPullEnabled { get; set; } } } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunData.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunData.Serialization.cs deleted file mode 100644 index 6e6739693fd5..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPipelineRunData.Serialization.cs +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.ContainerRegistry.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.ContainerRegistry -{ - public partial class ContainerRegistryPipelineRunData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(Request)) - { - writer.WritePropertyName("request"); - writer.WriteObjectValue(Request); - } - if (Optional.IsDefined(ForceUpdateTag)) - { - writer.WritePropertyName("forceUpdateTag"); - writer.WriteStringValue(ForceUpdateTag); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static ContainerRegistryPipelineRunData DeserializeContainerRegistryPipelineRunData(JsonElement element) - { - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional provisioningState = default; - Optional request = default; - Optional response = default; - Optional forceUpdateTag = 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("provisioningState")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - provisioningState = new ContainerRegistryProvisioningState(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("request")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - request = PipelineRunContent.DeserializePipelineRunContent(property0.Value); - continue; - } - if (property0.NameEquals("response")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - response = PipelineRunResult.DeserializePipelineRunResult(property0.Value); - continue; - } - if (property0.NameEquals("forceUpdateTag")) - { - forceUpdateTag = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new ContainerRegistryPipelineRunData(id, name, type, systemData.Value, Optional.ToNullable(provisioningState), request.Value, response.Value, forceUpdateTag.Value); - } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPolicies.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPolicies.Serialization.cs index b4728cab1e39..ad86d5087e47 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPolicies.Serialization.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPolicies.Serialization.cs @@ -35,16 +35,6 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("exportPolicy"); writer.WriteObjectValue(ExportPolicy); } - if (Optional.IsDefined(AzureADAuthenticationAsArmPolicy)) - { - writer.WritePropertyName("azureADAuthenticationAsArmPolicy"); - writer.WriteObjectValue(AzureADAuthenticationAsArmPolicy); - } - if (Optional.IsDefined(SoftDeletePolicy)) - { - writer.WritePropertyName("softDeletePolicy"); - writer.WriteObjectValue(SoftDeletePolicy); - } writer.WriteEndObject(); } @@ -54,8 +44,6 @@ internal static ContainerRegistryPolicies DeserializeContainerRegistryPolicies(J Optional trustPolicy = default; Optional retentionPolicy = default; Optional exportPolicy = default; - Optional azureADAuthenticationAsArmPolicy = default; - Optional softDeletePolicy = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("quarantinePolicy")) @@ -98,28 +86,8 @@ internal static ContainerRegistryPolicies DeserializeContainerRegistryPolicies(J exportPolicy = ContainerRegistryExportPolicy.DeserializeContainerRegistryExportPolicy(property.Value); continue; } - if (property.NameEquals("azureADAuthenticationAsArmPolicy")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - azureADAuthenticationAsArmPolicy = AzureADAuthenticationAsArmPolicy.DeserializeAzureADAuthenticationAsArmPolicy(property.Value); - continue; - } - if (property.NameEquals("softDeletePolicy")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - softDeletePolicy = ContainerRegistrySoftDeletePolicy.DeserializeContainerRegistrySoftDeletePolicy(property.Value); - continue; - } } - return new ContainerRegistryPolicies(quarantinePolicy.Value, trustPolicy.Value, retentionPolicy.Value, exportPolicy.Value, azureADAuthenticationAsArmPolicy.Value, softDeletePolicy.Value); + return new ContainerRegistryPolicies(quarantinePolicy.Value, trustPolicy.Value, retentionPolicy.Value, exportPolicy.Value); } } } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPolicies.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPolicies.cs index bc1e11895f5a..6352fa0dfffd 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPolicies.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistryPolicies.cs @@ -20,16 +20,12 @@ public ContainerRegistryPolicies() /// The content trust policy for a container registry. /// The retention policy for a container registry. /// The export policy for a container registry. - /// The policy for using ARM audience token for a container registry. - /// The soft delete policy for a container registry. - internal ContainerRegistryPolicies(ContainerRegistryQuarantinePolicy quarantinePolicy, ContainerRegistryTrustPolicy trustPolicy, ContainerRegistryRetentionPolicy retentionPolicy, ContainerRegistryExportPolicy exportPolicy, AzureADAuthenticationAsArmPolicy azureADAuthenticationAsArmPolicy, ContainerRegistrySoftDeletePolicy softDeletePolicy) + internal ContainerRegistryPolicies(ContainerRegistryQuarantinePolicy quarantinePolicy, ContainerRegistryTrustPolicy trustPolicy, ContainerRegistryRetentionPolicy retentionPolicy, ContainerRegistryExportPolicy exportPolicy) { QuarantinePolicy = quarantinePolicy; TrustPolicy = trustPolicy; RetentionPolicy = retentionPolicy; ExportPolicy = exportPolicy; - AzureADAuthenticationAsArmPolicy = azureADAuthenticationAsArmPolicy; - SoftDeletePolicy = softDeletePolicy; } /// The quarantine policy for a container registry. @@ -63,22 +59,5 @@ public ContainerRegistryExportPolicyStatus? ExportStatus ExportPolicy.Status = value; } } - - /// The policy for using ARM audience token for a container registry. - internal AzureADAuthenticationAsArmPolicy AzureADAuthenticationAsArmPolicy { get; set; } - /// The value that indicates whether the policy is enabled or not. - public AzureADAuthenticationAsArmPolicyStatus? AzureADAuthenticationAsArmStatus - { - get => AzureADAuthenticationAsArmPolicy is null ? default : AzureADAuthenticationAsArmPolicy.Status; - set - { - if (AzureADAuthenticationAsArmPolicy is null) - AzureADAuthenticationAsArmPolicy = new AzureADAuthenticationAsArmPolicy(); - AzureADAuthenticationAsArmPolicy.Status = value; - } - } - - /// The soft delete policy for a container registry. - public ContainerRegistrySoftDeletePolicy SoftDeletePolicy { get; set; } } } diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistrySoftDeletePolicy.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistrySoftDeletePolicy.Serialization.cs deleted file mode 100644 index 5838bf5d90dd..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistrySoftDeletePolicy.Serialization.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerRegistry.Models -{ - public partial class ContainerRegistrySoftDeletePolicy : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(RetentionDays)) - { - writer.WritePropertyName("retentionDays"); - writer.WriteNumberValue(RetentionDays.Value); - } - if (Optional.IsDefined(Status)) - { - writer.WritePropertyName("status"); - writer.WriteStringValue(Status.Value.ToString()); - } - writer.WriteEndObject(); - } - - internal static ContainerRegistrySoftDeletePolicy DeserializeContainerRegistrySoftDeletePolicy(JsonElement element) - { - Optional retentionDays = default; - Optional lastUpdatedTime = default; - Optional status = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("retentionDays")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - retentionDays = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("lastUpdatedTime")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - lastUpdatedTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("status")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - status = new ContainerRegistryPolicyStatus(property.Value.GetString()); - continue; - } - } - return new ContainerRegistrySoftDeletePolicy(Optional.ToNullable(retentionDays), Optional.ToNullable(lastUpdatedTime), Optional.ToNullable(status)); - } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistrySoftDeletePolicy.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistrySoftDeletePolicy.cs deleted file mode 100644 index d414492e0b85..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ContainerRegistrySoftDeletePolicy.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.ResourceManager.ContainerRegistry.Models -{ - /// The soft delete policy for a container registry. - public partial class ContainerRegistrySoftDeletePolicy - { - /// Initializes a new instance of ContainerRegistrySoftDeletePolicy. - public ContainerRegistrySoftDeletePolicy() - { - } - - /// Initializes a new instance of ContainerRegistrySoftDeletePolicy. - /// The number of days after which a soft-deleted item is permanently deleted. - /// The timestamp when the policy was last updated. - /// The value that indicates whether the policy is enabled or not. - internal ContainerRegistrySoftDeletePolicy(int? retentionDays, DateTimeOffset? lastUpdatedOn, ContainerRegistryPolicyStatus? status) - { - RetentionDays = retentionDays; - LastUpdatedOn = lastUpdatedOn; - Status = status; - } - - /// The number of days after which a soft-deleted item is permanently deleted. - public int? RetentionDays { get; set; } - /// The timestamp when the policy was last updated. - public DateTimeOffset? LastUpdatedOn { get; } - /// The value that indicates whether the policy is enabled or not. - public ContainerRegistryPolicyStatus? Status { get; set; } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ExportPipelineData.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ExportPipelineData.Serialization.cs deleted file mode 100644 index 9233ec3c8340..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ExportPipelineData.Serialization.cs +++ /dev/null @@ -1,161 +0,0 @@ -// 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.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.ContainerRegistry -{ - public partial class ExportPipelineData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Location)) - { - writer.WritePropertyName("location"); - writer.WriteStringValue(Location.Value); - } - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"); - JsonSerializer.Serialize(writer, Identity); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(Target)) - { - writer.WritePropertyName("target"); - writer.WriteObjectValue(Target); - } - if (Optional.IsCollectionDefined(Options)) - { - writer.WritePropertyName("options"); - writer.WriteStartArray(); - foreach (var item in Options) - { - writer.WriteStringValue(item.ToString()); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static ExportPipelineData DeserializeExportPipelineData(JsonElement element) - { - Optional location = default; - Optional identity = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional target = default; - Optional> options = default; - Optional provisioningState = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("location")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - location = new AzureLocation(property.Value.GetString()); - continue; - } - 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("target")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - target = ExportPipelineTargetProperties.DeserializeExportPipelineTargetProperties(property0.Value); - continue; - } - if (property0.NameEquals("options")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(new PipelineOption(item.GetString())); - } - options = array; - continue; - } - if (property0.NameEquals("provisioningState")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - provisioningState = new ContainerRegistryProvisioningState(property0.Value.GetString()); - continue; - } - } - continue; - } - } - return new ExportPipelineData(id, name, type, systemData.Value, Optional.ToNullable(location), identity, target.Value, Optional.ToList(options), Optional.ToNullable(provisioningState)); - } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ExportPipelineListResult.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ExportPipelineListResult.Serialization.cs deleted file mode 100644 index eea03492ebab..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ExportPipelineListResult.Serialization.cs +++ /dev/null @@ -1,47 +0,0 @@ -// 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 ExportPipelineListResult - { - internal static ExportPipelineListResult DeserializeExportPipelineListResult(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(ExportPipelineData.DeserializeExportPipelineData(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new ExportPipelineListResult(Optional.ToList(value), nextLink.Value); - } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ExportPipelineListResult.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ExportPipelineListResult.cs deleted file mode 100644 index 96b3f86841e6..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ExportPipelineListResult.cs +++ /dev/null @@ -1,37 +0,0 @@ -// 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 export pipelines for a container registry. - internal partial class ExportPipelineListResult - { - /// Initializes a new instance of ExportPipelineListResult. - internal ExportPipelineListResult() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of ExportPipelineListResult. - /// The list of export pipelines. Since this list may be incomplete, the nextLink field should be used to request the next list of export pipelines. - /// The URI that can be used to request the next list of pipeline runs. - internal ExportPipelineListResult(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// The list of export pipelines. Since this list may be incomplete, the nextLink field should be used to request the next list of export pipelines. - public IReadOnlyList Value { get; } - /// The URI that can be used to request the next list of pipeline runs. - public string NextLink { get; } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ExportPipelineTargetProperties.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ExportPipelineTargetProperties.Serialization.cs deleted file mode 100644 index e8bebee410be..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ExportPipelineTargetProperties.Serialization.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerRegistry.Models -{ - public partial class ExportPipelineTargetProperties : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(PipelineTargetType)) - { - writer.WritePropertyName("type"); - writer.WriteStringValue(PipelineTargetType); - } - if (Optional.IsDefined(Uri)) - { - writer.WritePropertyName("uri"); - writer.WriteStringValue(Uri.AbsoluteUri); - } - writer.WritePropertyName("keyVaultUri"); - writer.WriteStringValue(KeyVaultUri.AbsoluteUri); - writer.WriteEndObject(); - } - - internal static ExportPipelineTargetProperties DeserializeExportPipelineTargetProperties(JsonElement element) - { - Optional type = default; - Optional uri = default; - Uri keyVaultUri = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("type")) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("uri")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - uri = null; - continue; - } - uri = new Uri(property.Value.GetString()); - continue; - } - if (property.NameEquals("keyVaultUri")) - { - keyVaultUri = new Uri(property.Value.GetString()); - continue; - } - } - return new ExportPipelineTargetProperties(type.Value, uri.Value, keyVaultUri); - } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ExportPipelineTargetProperties.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ExportPipelineTargetProperties.cs deleted file mode 100644 index 8301a2d67190..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ExportPipelineTargetProperties.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerRegistry.Models -{ - /// The properties of the export pipeline target. - public partial class ExportPipelineTargetProperties - { - /// Initializes a new instance of ExportPipelineTargetProperties. - /// They key vault secret uri to obtain the target storage SAS token. - /// is null. - public ExportPipelineTargetProperties(Uri keyVaultUri) - { - Argument.AssertNotNull(keyVaultUri, nameof(keyVaultUri)); - - KeyVaultUri = keyVaultUri; - } - - /// Initializes a new instance of ExportPipelineTargetProperties. - /// The type of target for the export pipeline. - /// - /// The target uri of the export pipeline. - /// When 'AzureStorageBlob': "https://accountName.blob.core.windows.net/containerName/blobName" - /// When 'AzureStorageBlobContainer': "https://accountName.blob.core.windows.net/containerName" - /// - /// They key vault secret uri to obtain the target storage SAS token. - internal ExportPipelineTargetProperties(string pipelineTargetType, Uri uri, Uri keyVaultUri) - { - PipelineTargetType = pipelineTargetType; - Uri = uri; - KeyVaultUri = keyVaultUri; - } - - /// The type of target for the export pipeline. - public string PipelineTargetType { get; set; } - /// - /// The target uri of the export pipeline. - /// When 'AzureStorageBlob': "https://accountName.blob.core.windows.net/containerName/blobName" - /// When 'AzureStorageBlobContainer': "https://accountName.blob.core.windows.net/containerName" - /// - public Uri Uri { get; set; } - /// They key vault secret uri to obtain the target storage SAS token. - public Uri KeyVaultUri { get; set; } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ImportPipelineData.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ImportPipelineData.Serialization.cs deleted file mode 100644 index 1bca3884292b..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ImportPipelineData.Serialization.cs +++ /dev/null @@ -1,177 +0,0 @@ -// 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.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.ContainerRegistry -{ - public partial class ImportPipelineData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Location)) - { - writer.WritePropertyName("location"); - writer.WriteStringValue(Location.Value); - } - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"); - JsonSerializer.Serialize(writer, Identity); - } - writer.WritePropertyName("properties"); - writer.WriteStartObject(); - if (Optional.IsDefined(Source)) - { - writer.WritePropertyName("source"); - writer.WriteObjectValue(Source); - } - if (Optional.IsDefined(Trigger)) - { - writer.WritePropertyName("trigger"); - writer.WriteObjectValue(Trigger); - } - if (Optional.IsCollectionDefined(Options)) - { - writer.WritePropertyName("options"); - writer.WriteStartArray(); - foreach (var item in Options) - { - writer.WriteStringValue(item.ToString()); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static ImportPipelineData DeserializeImportPipelineData(JsonElement element) - { - Optional location = default; - Optional identity = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional source = default; - Optional trigger = default; - Optional> options = default; - Optional provisioningState = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("location")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - location = new AzureLocation(property.Value.GetString()); - continue; - } - 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("source")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - source = ImportPipelineSourceProperties.DeserializeImportPipelineSourceProperties(property0.Value); - continue; - } - if (property0.NameEquals("trigger")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - trigger = PipelineTriggerProperties.DeserializePipelineTriggerProperties(property0.Value); - continue; - } - if (property0.NameEquals("options")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(new PipelineOption(item.GetString())); - } - options = array; - continue; - } - if (property0.NameEquals("provisioningState")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - provisioningState = new ContainerRegistryProvisioningState(property0.Value.GetString()); - continue; - } - } - continue; - } - } - return new ImportPipelineData(id, name, type, systemData.Value, Optional.ToNullable(location), identity, source.Value, trigger.Value, Optional.ToList(options), Optional.ToNullable(provisioningState)); - } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ImportPipelineListResult.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ImportPipelineListResult.Serialization.cs deleted file mode 100644 index 2defaee9dec8..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ImportPipelineListResult.Serialization.cs +++ /dev/null @@ -1,47 +0,0 @@ -// 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 ImportPipelineListResult - { - internal static ImportPipelineListResult DeserializeImportPipelineListResult(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(ImportPipelineData.DeserializeImportPipelineData(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new ImportPipelineListResult(Optional.ToList(value), nextLink.Value); - } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ImportPipelineListResult.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ImportPipelineListResult.cs deleted file mode 100644 index fc9c6db0c08e..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ImportPipelineListResult.cs +++ /dev/null @@ -1,37 +0,0 @@ -// 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 import pipelines for a container registry. - internal partial class ImportPipelineListResult - { - /// Initializes a new instance of ImportPipelineListResult. - internal ImportPipelineListResult() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of ImportPipelineListResult. - /// The list of import pipelines. Since this list may be incomplete, the nextLink field should be used to request the next list of import pipelines. - /// The URI that can be used to request the next list of pipeline runs. - internal ImportPipelineListResult(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// The list of import pipelines. Since this list may be incomplete, the nextLink field should be used to request the next list of import pipelines. - public IReadOnlyList Value { get; } - /// The URI that can be used to request the next list of pipeline runs. - public string NextLink { get; } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ImportPipelineSourceProperties.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ImportPipelineSourceProperties.Serialization.cs deleted file mode 100644 index 6e85d85f51ae..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ImportPipelineSourceProperties.Serialization.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerRegistry.Models -{ - public partial class ImportPipelineSourceProperties : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(PipelineSourceType)) - { - writer.WritePropertyName("type"); - writer.WriteStringValue(PipelineSourceType.Value.ToString()); - } - if (Optional.IsDefined(Uri)) - { - writer.WritePropertyName("uri"); - writer.WriteStringValue(Uri.AbsoluteUri); - } - writer.WritePropertyName("keyVaultUri"); - writer.WriteStringValue(KeyVaultUri.AbsoluteUri); - writer.WriteEndObject(); - } - - internal static ImportPipelineSourceProperties DeserializeImportPipelineSourceProperties(JsonElement element) - { - Optional type = default; - Optional uri = default; - Uri keyVaultUri = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("type")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - type = new PipelineSourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("uri")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - uri = null; - continue; - } - uri = new Uri(property.Value.GetString()); - continue; - } - if (property.NameEquals("keyVaultUri")) - { - keyVaultUri = new Uri(property.Value.GetString()); - continue; - } - } - return new ImportPipelineSourceProperties(Optional.ToNullable(type), uri.Value, keyVaultUri); - } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ImportPipelineSourceProperties.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ImportPipelineSourceProperties.cs deleted file mode 100644 index 1beb4a8f13bf..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/ImportPipelineSourceProperties.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerRegistry.Models -{ - /// The properties of the import pipeline source. - public partial class ImportPipelineSourceProperties - { - /// Initializes a new instance of ImportPipelineSourceProperties. - /// They key vault secret uri to obtain the source storage SAS token. - /// is null. - public ImportPipelineSourceProperties(Uri keyVaultUri) - { - Argument.AssertNotNull(keyVaultUri, nameof(keyVaultUri)); - - KeyVaultUri = keyVaultUri; - } - - /// Initializes a new instance of ImportPipelineSourceProperties. - /// The type of source for the import pipeline. - /// - /// The source uri of the import pipeline. - /// When 'AzureStorageBlob': "https://accountName.blob.core.windows.net/containerName/blobName" - /// When 'AzureStorageBlobContainer': "https://accountName.blob.core.windows.net/containerName" - /// - /// They key vault secret uri to obtain the source storage SAS token. - internal ImportPipelineSourceProperties(PipelineSourceType? pipelineSourceType, Uri uri, Uri keyVaultUri) - { - PipelineSourceType = pipelineSourceType; - Uri = uri; - KeyVaultUri = keyVaultUri; - } - - /// The type of source for the import pipeline. - public PipelineSourceType? PipelineSourceType { get; set; } - /// - /// The source uri of the import pipeline. - /// When 'AzureStorageBlob': "https://accountName.blob.core.windows.net/containerName/blobName" - /// When 'AzureStorageBlobContainer': "https://accountName.blob.core.windows.net/containerName" - /// - public Uri Uri { get; set; } - /// They key vault secret uri to obtain the source storage SAS token. - public Uri KeyVaultUri { get; set; } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineOption.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineOption.cs deleted file mode 100644 index b713d0966450..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineOption.cs +++ /dev/null @@ -1,57 +0,0 @@ -// 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 PipelineOption. - public readonly partial struct PipelineOption : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public PipelineOption(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string OverwriteTagsValue = "OverwriteTags"; - private const string OverwriteBlobsValue = "OverwriteBlobs"; - private const string DeleteSourceBlobOnSuccessValue = "DeleteSourceBlobOnSuccess"; - private const string ContinueOnErrorsValue = "ContinueOnErrors"; - - /// OverwriteTags. - public static PipelineOption OverwriteTags { get; } = new PipelineOption(OverwriteTagsValue); - /// OverwriteBlobs. - public static PipelineOption OverwriteBlobs { get; } = new PipelineOption(OverwriteBlobsValue); - /// DeleteSourceBlobOnSuccess. - public static PipelineOption DeleteSourceBlobOnSuccess { get; } = new PipelineOption(DeleteSourceBlobOnSuccessValue); - /// ContinueOnErrors. - public static PipelineOption ContinueOnErrors { get; } = new PipelineOption(ContinueOnErrorsValue); - /// Determines if two values are the same. - public static bool operator ==(PipelineOption left, PipelineOption right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(PipelineOption left, PipelineOption right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator PipelineOption(string value) => new PipelineOption(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is PipelineOption other && Equals(other); - /// - public bool Equals(PipelineOption 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/PipelineProgress.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineProgress.Serialization.cs deleted file mode 100644 index aa774b47df6c..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineProgress.Serialization.cs +++ /dev/null @@ -1,29 +0,0 @@ -// 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 -{ - internal partial class PipelineProgress - { - internal static PipelineProgress DeserializePipelineProgress(JsonElement element) - { - Optional percentage = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("percentage")) - { - percentage = property.Value.GetString(); - continue; - } - } - return new PipelineProgress(percentage.Value); - } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineProgress.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineProgress.cs deleted file mode 100644 index dc0d408cff37..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineProgress.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.ContainerRegistry.Models -{ - /// The PipelineProgress. - internal partial class PipelineProgress - { - /// Initializes a new instance of PipelineProgress. - internal PipelineProgress() - { - } - - /// Initializes a new instance of PipelineProgress. - /// The percentage complete of the copy operation. - internal PipelineProgress(string percentage) - { - Percentage = percentage; - } - - /// The percentage complete of the copy operation. - public string Percentage { get; } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunContent.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunContent.Serialization.cs deleted file mode 100644 index f8c76ffa7d96..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunContent.Serialization.cs +++ /dev/null @@ -1,115 +0,0 @@ -// 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; - -namespace Azure.ResourceManager.ContainerRegistry.Models -{ - public partial class PipelineRunContent : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(PipelineResourceId)) - { - writer.WritePropertyName("pipelineResourceId"); - writer.WriteStringValue(PipelineResourceId); - } - if (Optional.IsCollectionDefined(Artifacts)) - { - writer.WritePropertyName("artifacts"); - writer.WriteStartArray(); - foreach (var item in Artifacts) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(Source)) - { - writer.WritePropertyName("source"); - writer.WriteObjectValue(Source); - } - if (Optional.IsDefined(Target)) - { - writer.WritePropertyName("target"); - writer.WriteObjectValue(Target); - } - if (Optional.IsDefined(CatalogDigest)) - { - writer.WritePropertyName("catalogDigest"); - writer.WriteStringValue(CatalogDigest); - } - writer.WriteEndObject(); - } - - internal static PipelineRunContent DeserializePipelineRunContent(JsonElement element) - { - Optional pipelineResourceId = default; - Optional> artifacts = default; - Optional source = default; - Optional target = default; - Optional catalogDigest = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("pipelineResourceId")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - pipelineResourceId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("artifacts")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - artifacts = array; - continue; - } - if (property.NameEquals("source")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - source = PipelineRunSourceProperties.DeserializePipelineRunSourceProperties(property.Value); - continue; - } - if (property.NameEquals("target")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - target = PipelineRunTargetProperties.DeserializePipelineRunTargetProperties(property.Value); - continue; - } - if (property.NameEquals("catalogDigest")) - { - catalogDigest = property.Value.GetString(); - continue; - } - } - return new PipelineRunContent(pipelineResourceId.Value, Optional.ToList(artifacts), source.Value, target.Value, catalogDigest.Value); - } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunContent.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunContent.cs deleted file mode 100644 index 1d75557b2201..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunContent.cs +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerRegistry.Models -{ - /// The request properties provided for a pipeline run. - public partial class PipelineRunContent - { - /// Initializes a new instance of PipelineRunContent. - public PipelineRunContent() - { - Artifacts = new ChangeTrackingList(); - } - - /// Initializes a new instance of PipelineRunContent. - /// The resource ID of the pipeline to run. - /// - /// List of source artifacts to be transferred by the pipeline. - /// Specify an image by repository ('hello-world'). This will use the 'latest' tag. - /// Specify an image by tag ('hello-world:latest'). - /// Specify an image by sha256-based manifest digest ('hello-world@sha256:abc123'). - /// - /// The source properties of the pipeline run. - /// The target properties of the pipeline run. - /// The digest of the tar used to transfer the artifacts. - internal PipelineRunContent(ResourceIdentifier pipelineResourceId, IList artifacts, PipelineRunSourceProperties source, PipelineRunTargetProperties target, string catalogDigest) - { - PipelineResourceId = pipelineResourceId; - Artifacts = artifacts; - Source = source; - Target = target; - CatalogDigest = catalogDigest; - } - - /// The resource ID of the pipeline to run. - public ResourceIdentifier PipelineResourceId { get; set; } - /// - /// List of source artifacts to be transferred by the pipeline. - /// Specify an image by repository ('hello-world'). This will use the 'latest' tag. - /// Specify an image by tag ('hello-world:latest'). - /// Specify an image by sha256-based manifest digest ('hello-world@sha256:abc123'). - /// - public IList Artifacts { get; } - /// The source properties of the pipeline run. - public PipelineRunSourceProperties Source { get; set; } - /// The target properties of the pipeline run. - public PipelineRunTargetProperties Target { get; set; } - /// The digest of the tar used to transfer the artifacts. - public string CatalogDigest { get; set; } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunListResult.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunListResult.Serialization.cs deleted file mode 100644 index 213e12bdd2a6..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunListResult.Serialization.cs +++ /dev/null @@ -1,47 +0,0 @@ -// 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 PipelineRunListResult - { - internal static PipelineRunListResult DeserializePipelineRunListResult(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(ContainerRegistryPipelineRunData.DeserializeContainerRegistryPipelineRunData(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new PipelineRunListResult(Optional.ToList(value), nextLink.Value); - } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunListResult.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunListResult.cs deleted file mode 100644 index 4697bb3679bc..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunListResult.cs +++ /dev/null @@ -1,37 +0,0 @@ -// 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 pipeline runs for a container registry. - internal partial class PipelineRunListResult - { - /// Initializes a new instance of PipelineRunListResult. - internal PipelineRunListResult() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of PipelineRunListResult. - /// The list of pipeline runs. Since this list may be incomplete, the nextLink field should be used to request the next list of pipeline runs. - /// The URI that can be used to request the next list of pipeline runs. - internal PipelineRunListResult(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// The list of pipeline runs. Since this list may be incomplete, the nextLink field should be used to request the next list of pipeline runs. - public IReadOnlyList Value { get; } - /// The URI that can be used to request the next list of pipeline runs. - public string NextLink { get; } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunResult.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunResult.Serialization.cs deleted file mode 100644 index ea04a27ab19c..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunResult.Serialization.cs +++ /dev/null @@ -1,125 +0,0 @@ -// 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; - -namespace Azure.ResourceManager.ContainerRegistry.Models -{ - public partial class PipelineRunResult - { - internal static PipelineRunResult DeserializePipelineRunResult(JsonElement element) - { - Optional status = default; - Optional> importedArtifacts = default; - Optional progress = default; - Optional startTime = default; - Optional finishTime = default; - Optional source = default; - Optional target = default; - Optional catalogDigest = default; - Optional trigger = default; - Optional pipelineRunErrorMessage = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("status")) - { - status = property.Value.GetString(); - continue; - } - if (property.NameEquals("importedArtifacts")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - importedArtifacts = array; - continue; - } - if (property.NameEquals("progress")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - progress = PipelineProgress.DeserializePipelineProgress(property.Value); - continue; - } - if (property.NameEquals("startTime")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - startTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("finishTime")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - finishTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("source")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - source = ImportPipelineSourceProperties.DeserializeImportPipelineSourceProperties(property.Value); - continue; - } - if (property.NameEquals("target")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - target = ExportPipelineTargetProperties.DeserializeExportPipelineTargetProperties(property.Value); - continue; - } - if (property.NameEquals("catalogDigest")) - { - catalogDigest = property.Value.GetString(); - continue; - } - if (property.NameEquals("trigger")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - trigger = PipelineTriggerDescriptor.DeserializePipelineTriggerDescriptor(property.Value); - continue; - } - if (property.NameEquals("pipelineRunErrorMessage")) - { - pipelineRunErrorMessage = property.Value.GetString(); - continue; - } - } - return new PipelineRunResult(status.Value, Optional.ToList(importedArtifacts), progress.Value, Optional.ToNullable(startTime), Optional.ToNullable(finishTime), source.Value, target.Value, catalogDigest.Value, trigger.Value, pipelineRunErrorMessage.Value); - } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunResult.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunResult.cs deleted file mode 100644 index 9aa6c71cb8b2..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunResult.cs +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerRegistry.Models -{ - /// The response properties returned for a pipeline run. - public partial class PipelineRunResult - { - /// Initializes a new instance of PipelineRunResult. - internal PipelineRunResult() - { - ImportedArtifacts = new ChangeTrackingList(); - } - - /// Initializes a new instance of PipelineRunResult. - /// The current status of the pipeline run. - /// The artifacts imported in the pipeline run. - /// The current progress of the copy operation. - /// The time the pipeline run started. - /// The time the pipeline run finished. - /// The source of the pipeline run. - /// The target of the pipeline run. - /// The digest of the tar used to transfer the artifacts. - /// The trigger that caused the pipeline run. - /// The detailed error message for the pipeline run in the case of failure. - internal PipelineRunResult(string status, IReadOnlyList importedArtifacts, PipelineProgress progress, DateTimeOffset? startOn, DateTimeOffset? finishOn, ImportPipelineSourceProperties source, ExportPipelineTargetProperties target, string catalogDigest, PipelineTriggerDescriptor trigger, string pipelineRunErrorMessage) - { - Status = status; - ImportedArtifacts = importedArtifacts; - Progress = progress; - StartOn = startOn; - FinishOn = finishOn; - Source = source; - Target = target; - CatalogDigest = catalogDigest; - Trigger = trigger; - PipelineRunErrorMessage = pipelineRunErrorMessage; - } - - /// The current status of the pipeline run. - public string Status { get; } - /// The artifacts imported in the pipeline run. - public IReadOnlyList ImportedArtifacts { get; } - /// The current progress of the copy operation. - internal PipelineProgress Progress { get; } - /// The percentage complete of the copy operation. - public string ProgressPercentage - { - get => Progress?.Percentage; - } - - /// The time the pipeline run started. - public DateTimeOffset? StartOn { get; } - /// The time the pipeline run finished. - public DateTimeOffset? FinishOn { get; } - /// The source of the pipeline run. - public ImportPipelineSourceProperties Source { get; } - /// The target of the pipeline run. - public ExportPipelineTargetProperties Target { get; } - /// The digest of the tar used to transfer the artifacts. - public string CatalogDigest { get; } - /// The trigger that caused the pipeline run. - internal PipelineTriggerDescriptor Trigger { get; } - /// The timestamp when the source update happened. - public DateTimeOffset? SourceTriggerTimestamp - { - get => Trigger?.SourceTriggerTimestamp; - } - - /// The detailed error message for the pipeline run in the case of failure. - public string PipelineRunErrorMessage { get; } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunSourceProperties.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunSourceProperties.Serialization.cs deleted file mode 100644 index 79bd6b2613a8..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunSourceProperties.Serialization.cs +++ /dev/null @@ -1,56 +0,0 @@ -// 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 PipelineRunSourceProperties : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(SourceType)) - { - writer.WritePropertyName("type"); - writer.WriteStringValue(SourceType.Value.ToString()); - } - if (Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"); - writer.WriteStringValue(Name); - } - writer.WriteEndObject(); - } - - internal static PipelineRunSourceProperties DeserializePipelineRunSourceProperties(JsonElement element) - { - Optional type = default; - Optional name = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("type")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - type = new PipelineRunSourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - } - return new PipelineRunSourceProperties(Optional.ToNullable(type), name.Value); - } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunSourceProperties.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunSourceProperties.cs deleted file mode 100644 index 6c5c4c6f7036..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunSourceProperties.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.ContainerRegistry.Models -{ - /// The PipelineRunSourceProperties. - public partial class PipelineRunSourceProperties - { - /// Initializes a new instance of PipelineRunSourceProperties. - public PipelineRunSourceProperties() - { - } - - /// Initializes a new instance of PipelineRunSourceProperties. - /// The type of the source. - /// The name of the source. - internal PipelineRunSourceProperties(PipelineRunSourceType? sourceType, string name) - { - SourceType = sourceType; - Name = name; - } - - /// The type of the source. - public PipelineRunSourceType? SourceType { get; set; } - /// The name of the source. - public string Name { get; set; } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunSourceType.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunSourceType.cs deleted file mode 100644 index fc28fbd2f070..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunSourceType.cs +++ /dev/null @@ -1,48 +0,0 @@ -// 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 type of the source. - public readonly partial struct PipelineRunSourceType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public PipelineRunSourceType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AzureStorageBlobValue = "AzureStorageBlob"; - - /// AzureStorageBlob. - public static PipelineRunSourceType AzureStorageBlob { get; } = new PipelineRunSourceType(AzureStorageBlobValue); - /// Determines if two values are the same. - public static bool operator ==(PipelineRunSourceType left, PipelineRunSourceType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(PipelineRunSourceType left, PipelineRunSourceType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator PipelineRunSourceType(string value) => new PipelineRunSourceType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is PipelineRunSourceType other && Equals(other); - /// - public bool Equals(PipelineRunSourceType 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/PipelineRunTargetProperties.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunTargetProperties.Serialization.cs deleted file mode 100644 index 24632fd21b63..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunTargetProperties.Serialization.cs +++ /dev/null @@ -1,56 +0,0 @@ -// 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 PipelineRunTargetProperties : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(TargetType)) - { - writer.WritePropertyName("type"); - writer.WriteStringValue(TargetType.Value.ToString()); - } - if (Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"); - writer.WriteStringValue(Name); - } - writer.WriteEndObject(); - } - - internal static PipelineRunTargetProperties DeserializePipelineRunTargetProperties(JsonElement element) - { - Optional type = default; - Optional name = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("type")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - type = new PipelineRunTargetType(property.Value.GetString()); - continue; - } - if (property.NameEquals("name")) - { - name = property.Value.GetString(); - continue; - } - } - return new PipelineRunTargetProperties(Optional.ToNullable(type), name.Value); - } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunTargetProperties.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunTargetProperties.cs deleted file mode 100644 index ffbdebc15210..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunTargetProperties.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.ContainerRegistry.Models -{ - /// The PipelineRunTargetProperties. - public partial class PipelineRunTargetProperties - { - /// Initializes a new instance of PipelineRunTargetProperties. - public PipelineRunTargetProperties() - { - } - - /// Initializes a new instance of PipelineRunTargetProperties. - /// The type of the target. - /// The name of the target. - internal PipelineRunTargetProperties(PipelineRunTargetType? targetType, string name) - { - TargetType = targetType; - Name = name; - } - - /// The type of the target. - public PipelineRunTargetType? TargetType { get; set; } - /// The name of the target. - public string Name { get; set; } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunTargetType.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunTargetType.cs deleted file mode 100644 index 905254380e34..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineRunTargetType.cs +++ /dev/null @@ -1,48 +0,0 @@ -// 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 type of the target. - public readonly partial struct PipelineRunTargetType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public PipelineRunTargetType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AzureStorageBlobValue = "AzureStorageBlob"; - - /// AzureStorageBlob. - public static PipelineRunTargetType AzureStorageBlob { get; } = new PipelineRunTargetType(AzureStorageBlobValue); - /// Determines if two values are the same. - public static bool operator ==(PipelineRunTargetType left, PipelineRunTargetType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(PipelineRunTargetType left, PipelineRunTargetType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator PipelineRunTargetType(string value) => new PipelineRunTargetType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is PipelineRunTargetType other && Equals(other); - /// - public bool Equals(PipelineRunTargetType 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/PipelineSourceTriggerDescriptor.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineSourceTriggerDescriptor.Serialization.cs deleted file mode 100644 index 52993917b68e..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineSourceTriggerDescriptor.Serialization.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.ContainerRegistry.Models -{ - internal partial class PipelineSourceTriggerDescriptor - { - internal static PipelineSourceTriggerDescriptor DeserializePipelineSourceTriggerDescriptor(JsonElement element) - { - Optional timestamp = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("timestamp")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - timestamp = property.Value.GetDateTimeOffset("O"); - continue; - } - } - return new PipelineSourceTriggerDescriptor(Optional.ToNullable(timestamp)); - } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineSourceTriggerDescriptor.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineSourceTriggerDescriptor.cs deleted file mode 100644 index 27939eca4c74..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineSourceTriggerDescriptor.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.ResourceManager.ContainerRegistry.Models -{ - /// The PipelineSourceTriggerDescriptor. - internal partial class PipelineSourceTriggerDescriptor - { - /// Initializes a new instance of PipelineSourceTriggerDescriptor. - internal PipelineSourceTriggerDescriptor() - { - } - - /// Initializes a new instance of PipelineSourceTriggerDescriptor. - /// The timestamp when the source update happened. - internal PipelineSourceTriggerDescriptor(DateTimeOffset? timestamp) - { - Timestamp = timestamp; - } - - /// The timestamp when the source update happened. - public DateTimeOffset? Timestamp { get; } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineSourceTriggerProperties.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineSourceTriggerProperties.Serialization.cs deleted file mode 100644 index 17608fd26af1..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineSourceTriggerProperties.Serialization.cs +++ /dev/null @@ -1,37 +0,0 @@ -// 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 -{ - internal partial class PipelineSourceTriggerProperties : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("status"); - writer.WriteStringValue(Status.ToString()); - writer.WriteEndObject(); - } - - internal static PipelineSourceTriggerProperties DeserializePipelineSourceTriggerProperties(JsonElement element) - { - ContainerRegistryTriggerStatus status = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("status")) - { - status = new ContainerRegistryTriggerStatus(property.Value.GetString()); - continue; - } - } - return new PipelineSourceTriggerProperties(status); - } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineSourceTriggerProperties.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineSourceTriggerProperties.cs deleted file mode 100644 index 9fd8994a720e..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineSourceTriggerProperties.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.ContainerRegistry.Models -{ - /// The PipelineSourceTriggerProperties. - internal partial class PipelineSourceTriggerProperties - { - /// Initializes a new instance of PipelineSourceTriggerProperties. - /// The current status of the source trigger. - public PipelineSourceTriggerProperties(ContainerRegistryTriggerStatus status) - { - Status = status; - } - - /// The current status of the source trigger. - public ContainerRegistryTriggerStatus Status { get; set; } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineSourceType.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineSourceType.cs deleted file mode 100644 index f07d8862bd00..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineSourceType.cs +++ /dev/null @@ -1,48 +0,0 @@ -// 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 type of source for the import pipeline. - public readonly partial struct PipelineSourceType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public PipelineSourceType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AzureStorageBlobContainerValue = "AzureStorageBlobContainer"; - - /// AzureStorageBlobContainer. - public static PipelineSourceType AzureStorageBlobContainer { get; } = new PipelineSourceType(AzureStorageBlobContainerValue); - /// Determines if two values are the same. - public static bool operator ==(PipelineSourceType left, PipelineSourceType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(PipelineSourceType left, PipelineSourceType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator PipelineSourceType(string value) => new PipelineSourceType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is PipelineSourceType other && Equals(other); - /// - public bool Equals(PipelineSourceType 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/PipelineTriggerDescriptor.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineTriggerDescriptor.Serialization.cs deleted file mode 100644 index e8f1178681ee..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineTriggerDescriptor.Serialization.cs +++ /dev/null @@ -1,34 +0,0 @@ -// 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 -{ - internal partial class PipelineTriggerDescriptor - { - internal static PipelineTriggerDescriptor DeserializePipelineTriggerDescriptor(JsonElement element) - { - Optional sourceTrigger = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("sourceTrigger")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - sourceTrigger = PipelineSourceTriggerDescriptor.DeserializePipelineSourceTriggerDescriptor(property.Value); - continue; - } - } - return new PipelineTriggerDescriptor(sourceTrigger.Value); - } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineTriggerDescriptor.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineTriggerDescriptor.cs deleted file mode 100644 index a80cca083965..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineTriggerDescriptor.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.ResourceManager.ContainerRegistry.Models -{ - /// The PipelineTriggerDescriptor. - internal partial class PipelineTriggerDescriptor - { - /// Initializes a new instance of PipelineTriggerDescriptor. - internal PipelineTriggerDescriptor() - { - } - - /// Initializes a new instance of PipelineTriggerDescriptor. - /// The source trigger that caused the pipeline run. - internal PipelineTriggerDescriptor(PipelineSourceTriggerDescriptor sourceTrigger) - { - SourceTrigger = sourceTrigger; - } - - /// The source trigger that caused the pipeline run. - internal PipelineSourceTriggerDescriptor SourceTrigger { get; } - /// The timestamp when the source update happened. - public DateTimeOffset? SourceTriggerTimestamp - { - get => SourceTrigger?.Timestamp; - } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineTriggerProperties.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineTriggerProperties.Serialization.cs deleted file mode 100644 index 3be9f3e33ff4..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineTriggerProperties.Serialization.cs +++ /dev/null @@ -1,45 +0,0 @@ -// 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 -{ - internal partial class PipelineTriggerProperties : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(SourceTrigger)) - { - writer.WritePropertyName("sourceTrigger"); - writer.WriteObjectValue(SourceTrigger); - } - writer.WriteEndObject(); - } - - internal static PipelineTriggerProperties DeserializePipelineTriggerProperties(JsonElement element) - { - Optional sourceTrigger = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("sourceTrigger")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - sourceTrigger = PipelineSourceTriggerProperties.DeserializePipelineSourceTriggerProperties(property.Value); - continue; - } - } - return new PipelineTriggerProperties(sourceTrigger.Value); - } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineTriggerProperties.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineTriggerProperties.cs deleted file mode 100644 index 3f570ea87203..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/PipelineTriggerProperties.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.ContainerRegistry.Models -{ - /// The PipelineTriggerProperties. - internal partial class PipelineTriggerProperties - { - /// Initializes a new instance of PipelineTriggerProperties. - public PipelineTriggerProperties() - { - } - - /// Initializes a new instance of PipelineTriggerProperties. - /// The source trigger properties of the pipeline. - internal PipelineTriggerProperties(PipelineSourceTriggerProperties sourceTrigger) - { - SourceTrigger = sourceTrigger; - } - - /// The source trigger properties of the pipeline. - internal PipelineSourceTriggerProperties SourceTrigger { get; set; } - /// The current status of the source trigger. - public ContainerRegistryTriggerStatus? SourceTriggerStatus - { - get => SourceTrigger is null ? default(ContainerRegistryTriggerStatus?) : SourceTrigger.Status; - set - { - SourceTrigger = value.HasValue ? new PipelineSourceTriggerProperties(value.Value) : null; - } - } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/TlsCertificateLocationType.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/TlsCertificateLocationType.cs deleted file mode 100644 index 6b05dc7f5da5..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/TlsCertificateLocationType.cs +++ /dev/null @@ -1,48 +0,0 @@ -// 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 type of certificate location. - public readonly partial struct TlsCertificateLocationType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public TlsCertificateLocationType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string LocalDirectoryValue = "LocalDirectory"; - - /// LocalDirectory. - public static TlsCertificateLocationType LocalDirectory { get; } = new TlsCertificateLocationType(LocalDirectoryValue); - /// Determines if two values are the same. - public static bool operator ==(TlsCertificateLocationType left, TlsCertificateLocationType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(TlsCertificateLocationType left, TlsCertificateLocationType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator TlsCertificateLocationType(string value) => new TlsCertificateLocationType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is TlsCertificateLocationType other && Equals(other); - /// - public bool Equals(TlsCertificateLocationType 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/TlsCertificateProperties.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/TlsCertificateProperties.Serialization.cs deleted file mode 100644 index 89df9afc3366..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/TlsCertificateProperties.Serialization.cs +++ /dev/null @@ -1,40 +0,0 @@ -// 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 TlsCertificateProperties - { - internal static TlsCertificateProperties DeserializeTlsCertificateProperties(JsonElement element) - { - Optional type = default; - Optional location = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("type")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - type = new TlsCertificateLocationType(property.Value.GetString()); - continue; - } - if (property.NameEquals("location")) - { - location = property.Value.GetString(); - continue; - } - } - return new TlsCertificateProperties(Optional.ToNullable(type), location.Value); - } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/TlsCertificateProperties.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/TlsCertificateProperties.cs deleted file mode 100644 index 9781c8d21f5d..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/TlsCertificateProperties.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.ContainerRegistry.Models -{ - /// The TLS certificate properties of the connected registry login server. - public partial class TlsCertificateProperties - { - /// Initializes a new instance of TlsCertificateProperties. - internal TlsCertificateProperties() - { - } - - /// Initializes a new instance of TlsCertificateProperties. - /// The type of certificate location. - /// Indicates the location of the certificates. - internal TlsCertificateProperties(TlsCertificateLocationType? locationType, string certificateLocation) - { - LocationType = locationType; - CertificateLocation = certificateLocation; - } - - /// The type of certificate location. - public TlsCertificateLocationType? LocationType { get; } - /// Indicates the location of the certificates. - public string CertificateLocation { get; } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/TlsProperties.Serialization.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/TlsProperties.Serialization.cs deleted file mode 100644 index 0984311c889e..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/TlsProperties.Serialization.cs +++ /dev/null @@ -1,45 +0,0 @@ -// 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 TlsProperties - { - internal static TlsProperties DeserializeTlsProperties(JsonElement element) - { - Optional status = default; - Optional certificate = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("status")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - status = new TlsStatus(property.Value.GetString()); - continue; - } - if (property.NameEquals("certificate")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - certificate = TlsCertificateProperties.DeserializeTlsCertificateProperties(property.Value); - continue; - } - } - return new TlsProperties(Optional.ToNullable(status), certificate.Value); - } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/TlsProperties.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/TlsProperties.cs deleted file mode 100644 index 9ea1868a8bcf..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/TlsProperties.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.ContainerRegistry.Models -{ - /// The TLS properties of the connected registry login server. - public partial class TlsProperties - { - /// Initializes a new instance of TlsProperties. - internal TlsProperties() - { - } - - /// Initializes a new instance of TlsProperties. - /// Indicates whether HTTPS is enabled for the login server. - /// The certificate used to configure HTTPS for the login server. - internal TlsProperties(TlsStatus? status, TlsCertificateProperties certificate) - { - Status = status; - Certificate = certificate; - } - - /// Indicates whether HTTPS is enabled for the login server. - public TlsStatus? Status { get; } - /// The certificate used to configure HTTPS for the login server. - public TlsCertificateProperties Certificate { get; } - } -} diff --git a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/TlsStatus.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/TlsStatus.cs deleted file mode 100644 index d66e92d98f22..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/Models/TlsStatus.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.ContainerRegistry.Models -{ - /// Indicates whether HTTPS is enabled for the login server. - public readonly partial struct TlsStatus : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public TlsStatus(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string EnabledValue = "Enabled"; - private const string DisabledValue = "Disabled"; - - /// Enabled. - public static TlsStatus Enabled { get; } = new TlsStatus(EnabledValue); - /// Disabled. - public static TlsStatus Disabled { get; } = new TlsStatus(DisabledValue); - /// Determines if two values are the same. - public static bool operator ==(TlsStatus left, TlsStatus right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(TlsStatus left, TlsStatus right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator TlsStatus(string value) => new TlsStatus(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is TlsStatus other && Equals(other); - /// - public bool Equals(TlsStatus 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/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/ConnectedRegistriesRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ConnectedRegistriesRestOperations.cs deleted file mode 100644 index 05537ff75da2..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ConnectedRegistriesRestOperations.cs +++ /dev/null @@ -1,614 +0,0 @@ -// 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 ConnectedRegistriesRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of ConnectedRegistriesRestOperations. - /// 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 ConnectedRegistriesRestOperations(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 ?? "2022-02-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string registryName, string filter) - { - 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("/connectedRegistries", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (filter != null) - { - uri.AppendQuery("$filter", filter, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// 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 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) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); - - using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ConnectedRegistryListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ConnectedRegistryListResult.DeserializeConnectedRegistryListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// 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 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) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); - - using var message = CreateListRequest(subscriptionId, resourceGroupName, registryName, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ConnectedRegistryListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ConnectedRegistryListResult.DeserializeConnectedRegistryListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName) - { - 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("/connectedRegistries/", false); - uri.AppendPath(connectedRegistryName, 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 connected registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. - /// 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) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); - Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, registryName, connectedRegistryName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ConnectedRegistryData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ConnectedRegistryData.DeserializeConnectedRegistryData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ConnectedRegistryData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// 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 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) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); - Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, registryName, connectedRegistryName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ConnectedRegistryData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ConnectedRegistryData.DeserializeConnectedRegistryData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ConnectedRegistryData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, ConnectedRegistryData 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("/connectedRegistries/", false); - uri.AppendPath(connectedRegistryName, 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 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 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) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); - Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, registryName, connectedRegistryName, 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 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 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) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); - Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, registryName, connectedRegistryName, 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(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName) - { - 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("/connectedRegistries/", false); - uri.AppendPath(connectedRegistryName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// 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 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) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); - Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, registryName, connectedRegistryName); - 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 connected registry from a container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. - /// 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) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); - Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, registryName, connectedRegistryName); - _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(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName, ConnectedRegistryPatch 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("/connectedRegistries/", false); - uri.AppendPath(connectedRegistryName, 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 connected registry with the specified parameters. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. - /// 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) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); - Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); - Argument.AssertNotNull(patch, nameof(patch)); - - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, registryName, connectedRegistryName, 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 connected registry with the specified parameters. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. - /// 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) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); - Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); - Argument.AssertNotNull(patch, nameof(patch)); - - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, registryName, connectedRegistryName, patch); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeactivateRequest(string subscriptionId, string resourceGroupName, string registryName, string connectedRegistryName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - 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("/connectedRegistries/", false); - uri.AppendPath(connectedRegistryName, true); - uri.AppendPath("/deactivate", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Deactivates the connected registry instance. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. - /// 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) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); - Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); - - using var message = CreateDeactivateRequest(subscriptionId, resourceGroupName, registryName, connectedRegistryName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Deactivates the connected registry instance. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. - /// 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) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); - Argument.AssertNotNullOrEmpty(connectedRegistryName, nameof(connectedRegistryName)); - - using var message = CreateDeactivateRequest(subscriptionId, resourceGroupName, registryName, connectedRegistryName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string registryName, string filter) - { - 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 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 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) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, registryName, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ConnectedRegistryListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ConnectedRegistryListResult.DeserializeConnectedRegistryListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// 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 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) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, registryName, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ConnectedRegistryListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ConnectedRegistryListResult.DeserializeConnectedRegistryListResult(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 deleted file mode 100644 index eef72a069263..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ExportPipelinesRestOperations.cs +++ /dev/null @@ -1,445 +0,0 @@ -// 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 ExportPipelinesRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of ExportPipelinesRestOperations. - /// 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 ExportPipelinesRestOperations(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 ?? "2022-02-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListRequest(string 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("/exportPipelines", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// 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 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) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - 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: - { - ExportPipelineListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ExportPipelineListResult.DeserializeExportPipelineListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// 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 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) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - 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: - { - ExportPipelineListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ExportPipelineListResult.DeserializeExportPipelineListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string registryName, string exportPipelineName) - { - 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("/exportPipelines/", false); - uri.AppendPath(exportPipelineName, 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 export pipeline. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. - /// 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) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); - Argument.AssertNotNullOrEmpty(exportPipelineName, nameof(exportPipelineName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, registryName, exportPipelineName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ExportPipelineData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ExportPipelineData.DeserializeExportPipelineData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ExportPipelineData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// 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 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) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); - Argument.AssertNotNullOrEmpty(exportPipelineName, nameof(exportPipelineName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, registryName, exportPipelineName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ExportPipelineData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ExportPipelineData.DeserializeExportPipelineData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ExportPipelineData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string registryName, string exportPipelineName, ExportPipelineData 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("/exportPipelines/", false); - uri.AppendPath(exportPipelineName, 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 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 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) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); - Argument.AssertNotNullOrEmpty(exportPipelineName, nameof(exportPipelineName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, registryName, exportPipelineName, 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 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 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) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); - Argument.AssertNotNullOrEmpty(exportPipelineName, nameof(exportPipelineName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, registryName, exportPipelineName, 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(string subscriptionId, string resourceGroupName, string registryName, string exportPipelineName) - { - 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("/exportPipelines/", false); - uri.AppendPath(exportPipelineName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// 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 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) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); - Argument.AssertNotNullOrEmpty(exportPipelineName, nameof(exportPipelineName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, registryName, exportPipelineName); - 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 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 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) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); - Argument.AssertNotNullOrEmpty(exportPipelineName, nameof(exportPipelineName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, registryName, exportPipelineName); - _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 CreateListNextPageRequest(string nextLink, string 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 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 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) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - 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: - { - ExportPipelineListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ExportPipelineListResult.DeserializeExportPipelineListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// 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 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) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - 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: - { - ExportPipelineListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ExportPipelineListResult.DeserializeExportPipelineListResult(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/ImportPipelinesRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ImportPipelinesRestOperations.cs deleted file mode 100644 index bfdb5ba99d48..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/ImportPipelinesRestOperations.cs +++ /dev/null @@ -1,445 +0,0 @@ -// 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 ImportPipelinesRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of ImportPipelinesRestOperations. - /// 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 ImportPipelinesRestOperations(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 ?? "2022-02-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListRequest(string 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("/importPipelines", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// 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 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) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - 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: - { - ImportPipelineListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ImportPipelineListResult.DeserializeImportPipelineListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// 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 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) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - 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: - { - ImportPipelineListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ImportPipelineListResult.DeserializeImportPipelineListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string registryName, string importPipelineName) - { - 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("/importPipelines/", false); - uri.AppendPath(importPipelineName, 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 import pipeline. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. - /// 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) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); - Argument.AssertNotNullOrEmpty(importPipelineName, nameof(importPipelineName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, registryName, importPipelineName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ImportPipelineData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ImportPipelineData.DeserializeImportPipelineData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ImportPipelineData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// 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 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) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); - Argument.AssertNotNullOrEmpty(importPipelineName, nameof(importPipelineName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, registryName, importPipelineName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ImportPipelineData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ImportPipelineData.DeserializeImportPipelineData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ImportPipelineData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string registryName, string importPipelineName, ImportPipelineData 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("/importPipelines/", false); - uri.AppendPath(importPipelineName, 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 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 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) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); - Argument.AssertNotNullOrEmpty(importPipelineName, nameof(importPipelineName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, registryName, importPipelineName, 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 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 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) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); - Argument.AssertNotNullOrEmpty(importPipelineName, nameof(importPipelineName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, registryName, importPipelineName, 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(string subscriptionId, string resourceGroupName, string registryName, string importPipelineName) - { - 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("/importPipelines/", false); - uri.AppendPath(importPipelineName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// 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 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) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); - Argument.AssertNotNullOrEmpty(importPipelineName, nameof(importPipelineName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, registryName, importPipelineName); - 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 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 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) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); - Argument.AssertNotNullOrEmpty(importPipelineName, nameof(importPipelineName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, registryName, importPipelineName); - _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 CreateListNextPageRequest(string nextLink, string 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 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 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) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - 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: - { - ImportPipelineListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ImportPipelineListResult.DeserializeImportPipelineListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// 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 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) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - 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: - { - ImportPipelineListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ImportPipelineListResult.DeserializeImportPipelineListResult(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/PipelineRunsRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/PipelineRunsRestOperations.cs deleted file mode 100644 index a21317630665..000000000000 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/PipelineRunsRestOperations.cs +++ /dev/null @@ -1,445 +0,0 @@ -// 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 PipelineRunsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of PipelineRunsRestOperations. - /// 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 PipelineRunsRestOperations(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 ?? "2022-02-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListRequest(string 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("/pipelineRuns", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// 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 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) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - 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: - { - PipelineRunListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PipelineRunListResult.DeserializePipelineRunListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// 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 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) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - 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: - { - PipelineRunListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PipelineRunListResult.DeserializePipelineRunListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string registryName, string pipelineRunName) - { - 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("/pipelineRuns/", false); - uri.AppendPath(pipelineRunName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// 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 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) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); - Argument.AssertNotNullOrEmpty(pipelineRunName, nameof(pipelineRunName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, registryName, pipelineRunName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ContainerRegistryPipelineRunData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ContainerRegistryPipelineRunData.DeserializeContainerRegistryPipelineRunData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ContainerRegistryPipelineRunData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// 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 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) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); - Argument.AssertNotNullOrEmpty(pipelineRunName, nameof(pipelineRunName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, registryName, pipelineRunName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ContainerRegistryPipelineRunData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ContainerRegistryPipelineRunData.DeserializeContainerRegistryPipelineRunData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ContainerRegistryPipelineRunData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string registryName, string pipelineRunName, ContainerRegistryPipelineRunData 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("/pipelineRuns/", false); - uri.AppendPath(pipelineRunName, 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 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 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) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); - Argument.AssertNotNullOrEmpty(pipelineRunName, nameof(pipelineRunName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, registryName, pipelineRunName, 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 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 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) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); - Argument.AssertNotNullOrEmpty(pipelineRunName, nameof(pipelineRunName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, registryName, pipelineRunName, 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(string subscriptionId, string resourceGroupName, string registryName, string pipelineRunName) - { - 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("/pipelineRuns/", false); - uri.AppendPath(pipelineRunName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// 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 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) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); - Argument.AssertNotNullOrEmpty(pipelineRunName, nameof(pipelineRunName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, registryName, pipelineRunName); - 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 pipeline run from a container registry. - /// The Microsoft Azure subscription ID. - /// The name of the resource group to which the container registry belongs. - /// 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) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(registryName, nameof(registryName)); - Argument.AssertNotNullOrEmpty(pipelineRunName, nameof(pipelineRunName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, registryName, pipelineRunName); - _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 CreateListNextPageRequest(string nextLink, string 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 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 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) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - 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: - { - PipelineRunListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PipelineRunListResult.DeserializePipelineRunListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// 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 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) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - 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: - { - PipelineRunListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PipelineRunListResult.DeserializePipelineRunListResult(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/PrivateEndpointConnectionsRestOperations.cs b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs index e211278ef219..d2b3c9f1cb48 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 ?? "2022-12-01"; _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..ae88621fe5d4 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 ?? "2022-12-01"; _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..c063caadd71c 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 ?? "2022-12-01"; _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..b96161c9e402 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 ?? "2022-12-01"; _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..d2979e295952 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 ?? "2022-12-01"; _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..023b5a7d63c6 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 ?? "2022-12-01"; _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 eb4c2b5d8aa9..ab04a9f37f1c 100644 --- a/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ScopeMapCollection.cs +++ b/sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/src/Generated/ScopeMapCollection.cs @@ -73,8 +73,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; @@ -106,8 +106,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; @@ -136,7 +136,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()); @@ -165,7 +165,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()); @@ -192,7 +192,7 @@ async Task> FirstPageFunc(int? pageSizeHint) scope.Start(); try { - var response = await _scopeMapRestClient.ListAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _scopeMapRestClient.ListAsync(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); return Page.FromValues(response.Value.Value.Select(value => new ScopeMapResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -207,7 +207,7 @@ async Task> NextPageFunc(string nextLink, int? pageSizeHi scope.Start(); try { - var response = await _scopeMapRestClient.ListNextPageAsync(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _scopeMapRestClient.ListNextPageAsync(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); return Page.FromValues(response.Value.Value.Select(value => new ScopeMapResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -234,7 +234,7 @@ Page FirstPageFunc(int? pageSizeHint) scope.Start(); try { - var response = _scopeMapRestClient.List(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); + var response = _scopeMapRestClient.List(Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken: cancellationToken); return Page.FromValues(response.Value.Value.Select(value => new ScopeMapResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -249,7 +249,7 @@ Page NextPageFunc(string nextLink, int? pageSizeHint) scope.Start(); try { - var response = _scopeMapRestClient.ListNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); + var response = _scopeMapRestClient.ListNextPage(nextLink, Guid.Parse(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken: cancellationToken); return Page.FromValues(response.Value.Value.Select(value => new ScopeMapResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) @@ -278,7 +278,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) @@ -305,7 +305,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