diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ContainerRegistryManagementClient.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ContainerRegistryManagementClient.cs index aef476e7690e..d888edd3d85b 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ContainerRegistryManagementClient.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ContainerRegistryManagementClient.cs @@ -66,31 +66,16 @@ public partial class ContainerRegistryManagementClient : ServiceClient public bool? GenerateClientRequestId { get; set; } - /// - /// Gets the IExportPipelinesOperations. - /// - public virtual IExportPipelinesOperations ExportPipelines { get; private set; } - /// /// Gets the IRegistriesOperations. /// public virtual IRegistriesOperations Registries { get; private set; } - /// - /// Gets the IImportPipelinesOperations. - /// - public virtual IImportPipelinesOperations ImportPipelines { get; private set; } - /// /// Gets the IOperations. /// public virtual IOperations Operations { get; private set; } - /// - /// Gets the IPipelineRunsOperations. - /// - public virtual IPipelineRunsOperations PipelineRuns { get; private set; } - /// /// Gets the IPrivateEndpointConnectionsOperations. /// @@ -126,16 +111,6 @@ public partial class ContainerRegistryManagementClient : ServiceClient public virtual ITasksOperations Tasks { get; private set; } - /// - /// Gets the IScopeMapsOperations. - /// - public virtual IScopeMapsOperations ScopeMaps { get; private set; } - - /// - /// Gets the ITokensOperations. - /// - public virtual ITokensOperations Tokens { get; private set; } - /// /// Initializes a new instance of the ContainerRegistryManagementClient class. /// @@ -377,11 +352,8 @@ public ContainerRegistryManagementClient(System.Uri baseUri, ServiceClientCreden /// private void Initialize() { - ExportPipelines = new ExportPipelinesOperations(this); Registries = new RegistriesOperations(this); - ImportPipelines = new ImportPipelinesOperations(this); Operations = new Operations(this); - PipelineRuns = new PipelineRunsOperations(this); PrivateEndpointConnections = new PrivateEndpointConnectionsOperations(this); Replications = new ReplicationsOperations(this); Webhooks = new WebhooksOperations(this); @@ -389,8 +361,6 @@ private void Initialize() Runs = new RunsOperations(this); TaskRuns = new TaskRunsOperations(this); Tasks = new TasksOperations(this); - ScopeMaps = new ScopeMapsOperations(this); - Tokens = new TokensOperations(this); BaseUri = new System.Uri("https://management.azure.com"); AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ExportPipelinesOperations.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ExportPipelinesOperations.cs deleted file mode 100644 index 80b8740ad2b1..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ExportPipelinesOperations.cs +++ /dev/null @@ -1,1232 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.ContainerRegistry -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - - /// - /// ExportPipelinesOperations operations. - /// - internal partial class ExportPipelinesOperations : IServiceOperations, IExportPipelinesOperations - { - /// - /// Initializes a new instance of the ExportPipelinesOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal ExportPipelinesOperations(ContainerRegistryManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the ContainerRegistryManagementClient - /// - public ContainerRegistryManagementClient Client { get; private set; } - - /// - /// Gets the properties of the export pipeline. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the export pipeline. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string registryName, string exportPipelineName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - } - if (registryName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "registryName"); - } - if (registryName != null) - { - if (registryName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "registryName", 50); - } - if (registryName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "registryName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(registryName, "^[a-zA-Z0-9]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); - } - } - if (exportPipelineName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "exportPipelineName"); - } - if (exportPipelineName != null) - { - if (exportPipelineName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "exportPipelineName", 50); - } - if (exportPipelineName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "exportPipelineName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(exportPipelineName, "^[a-zA-Z0-9]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "exportPipelineName", "^[a-zA-Z0-9]*$"); - } - } - string apiVersion = "2019-12-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("registryName", registryName); - tracingParameters.Add("exportPipelineName", exportPipelineName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); - _url = _url.Replace("{exportPipelineName}", System.Uri.EscapeDataString(exportPipelineName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Creates an export pipeline for a container registry with the specified - /// parameters. - /// - /// - /// 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 headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string registryName, string exportPipelineName, ExportPipeline exportPipelineCreateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, registryName, exportPipelineName, exportPipelineCreateParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes an export pipeline from a container registry. - /// - /// - /// 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 headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string exportPipelineName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, registryName, exportPipelineName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Lists all export pipelines for the specified container registry. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - } - if (registryName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "registryName"); - } - if (registryName != null) - { - if (registryName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "registryName", 50); - } - if (registryName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "registryName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(registryName, "^[a-zA-Z0-9]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); - } - } - string apiVersion = "2019-12-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("registryName", registryName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Creates an export pipeline for a container registry with the specified - /// parameters. - /// - /// - /// 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. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string registryName, string exportPipelineName, ExportPipeline exportPipelineCreateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - } - if (registryName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "registryName"); - } - if (registryName != null) - { - if (registryName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "registryName", 50); - } - if (registryName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "registryName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(registryName, "^[a-zA-Z0-9]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); - } - } - if (exportPipelineName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "exportPipelineName"); - } - if (exportPipelineName != null) - { - if (exportPipelineName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "exportPipelineName", 50); - } - if (exportPipelineName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "exportPipelineName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(exportPipelineName, "^[a-zA-Z0-9]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "exportPipelineName", "^[a-zA-Z0-9]*$"); - } - } - if (exportPipelineCreateParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "exportPipelineCreateParameters"); - } - if (exportPipelineCreateParameters != null) - { - exportPipelineCreateParameters.Validate(); - } - string apiVersion = "2019-12-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("registryName", registryName); - tracingParameters.Add("exportPipelineName", exportPipelineName); - tracingParameters.Add("exportPipelineCreateParameters", exportPipelineCreateParameters); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); - _url = _url.Replace("{exportPipelineName}", System.Uri.EscapeDataString(exportPipelineName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(exportPipelineCreateParameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(exportPipelineCreateParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Deletes an export pipeline from a container registry. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the export pipeline. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string exportPipelineName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - } - if (registryName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "registryName"); - } - if (registryName != null) - { - if (registryName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "registryName", 50); - } - if (registryName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "registryName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(registryName, "^[a-zA-Z0-9]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); - } - } - if (exportPipelineName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "exportPipelineName"); - } - if (exportPipelineName != null) - { - if (exportPipelineName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "exportPipelineName", 50); - } - if (exportPipelineName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "exportPipelineName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(exportPipelineName, "^[a-zA-Z0-9]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "exportPipelineName", "^[a-zA-Z0-9]*$"); - } - } - string apiVersion = "2019-12-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("registryName", registryName); - tracingParameters.Add("exportPipelineName", exportPipelineName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/exportPipelines/{exportPipelineName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); - _url = _url.Replace("{exportPipelineName}", System.Uri.EscapeDataString(exportPipelineName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Lists all export pipelines for the specified container registry. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (nextPageLink == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ExportPipelinesOperationsExtensions.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ExportPipelinesOperationsExtensions.cs deleted file mode 100644 index 252bfca65bd2..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ExportPipelinesOperationsExtensions.cs +++ /dev/null @@ -1,338 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.ContainerRegistry -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - - /// - /// Extension methods for ExportPipelinesOperations. - /// - public static partial class ExportPipelinesOperationsExtensions - { - /// - /// Gets the properties of the export pipeline. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the export pipeline. - /// - public static ExportPipeline Get(this IExportPipelinesOperations operations, string resourceGroupName, string registryName, string exportPipelineName) - { - return operations.GetAsync(resourceGroupName, registryName, exportPipelineName).GetAwaiter().GetResult(); - } - - /// - /// Gets the properties of the export pipeline. - /// - /// - /// The operations group for this extension method. - /// - /// - /// 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. - /// - public static async System.Threading.Tasks.Task GetAsync(this IExportPipelinesOperations operations, string resourceGroupName, string registryName, string exportPipelineName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, registryName, exportPipelineName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates an export pipeline for a container registry with the specified - /// parameters. - /// - /// - /// The operations group for this extension method. - /// - /// - /// 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. - /// - public static ExportPipeline Create(this IExportPipelinesOperations operations, string resourceGroupName, string registryName, string exportPipelineName, ExportPipeline exportPipelineCreateParameters) - { - return operations.CreateAsync(resourceGroupName, registryName, exportPipelineName, exportPipelineCreateParameters).GetAwaiter().GetResult(); - } - - /// - /// Creates an export pipeline for a container registry with the specified - /// parameters. - /// - /// - /// The operations group for this extension method. - /// - /// - /// 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. - /// - public static async System.Threading.Tasks.Task CreateAsync(this IExportPipelinesOperations operations, string resourceGroupName, string registryName, string exportPipelineName, ExportPipeline exportPipelineCreateParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, registryName, exportPipelineName, exportPipelineCreateParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes an export pipeline from a container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the export pipeline. - /// - public static void Delete(this IExportPipelinesOperations operations, string resourceGroupName, string registryName, string exportPipelineName) - { - operations.DeleteAsync(resourceGroupName, registryName, exportPipelineName).GetAwaiter().GetResult(); - } - - /// - /// Deletes an export pipeline from a container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// 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. - /// - public static async System.Threading.Tasks.Task DeleteAsync(this IExportPipelinesOperations operations, string resourceGroupName, string registryName, string exportPipelineName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, registryName, exportPipelineName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Lists all export pipelines for the specified container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - public static IPage List(this IExportPipelinesOperations operations, string resourceGroupName, string registryName) - { - return operations.ListAsync(resourceGroupName, registryName).GetAwaiter().GetResult(); - } - - /// - /// Lists all export pipelines for the specified container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task> ListAsync(this IExportPipelinesOperations operations, string resourceGroupName, string registryName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, registryName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates an export pipeline for a container registry with the specified - /// parameters. - /// - /// - /// The operations group for this extension method. - /// - /// - /// 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. - /// - public static ExportPipeline BeginCreate(this IExportPipelinesOperations operations, string resourceGroupName, string registryName, string exportPipelineName, ExportPipeline exportPipelineCreateParameters) - { - return operations.BeginCreateAsync(resourceGroupName, registryName, exportPipelineName, exportPipelineCreateParameters).GetAwaiter().GetResult(); - } - - /// - /// Creates an export pipeline for a container registry with the specified - /// parameters. - /// - /// - /// The operations group for this extension method. - /// - /// - /// 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. - /// - public static async System.Threading.Tasks.Task BeginCreateAsync(this IExportPipelinesOperations operations, string resourceGroupName, string registryName, string exportPipelineName, ExportPipeline exportPipelineCreateParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateWithHttpMessagesAsync(resourceGroupName, registryName, exportPipelineName, exportPipelineCreateParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes an export pipeline from a container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the export pipeline. - /// - public static void BeginDelete(this IExportPipelinesOperations operations, string resourceGroupName, string registryName, string exportPipelineName) - { - operations.BeginDeleteAsync(resourceGroupName, registryName, exportPipelineName).GetAwaiter().GetResult(); - } - - /// - /// Deletes an export pipeline from a container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// 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. - /// - public static async System.Threading.Tasks.Task BeginDeleteAsync(this IExportPipelinesOperations operations, string resourceGroupName, string registryName, string exportPipelineName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, registryName, exportPipelineName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Lists all export pipelines for the specified container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IExportPipelinesOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all export pipelines for the specified container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task> ListNextAsync(this IExportPipelinesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IContainerRegistryManagementClient.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IContainerRegistryManagementClient.cs index 1fe3ea64da17..928631c1028c 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IContainerRegistryManagementClient.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IContainerRegistryManagementClient.cs @@ -63,31 +63,16 @@ public partial interface IContainerRegistryManagementClient : System.IDisposable bool? GenerateClientRequestId { get; set; } - /// - /// Gets the IExportPipelinesOperations. - /// - IExportPipelinesOperations ExportPipelines { get; } - /// /// Gets the IRegistriesOperations. /// IRegistriesOperations Registries { get; } - /// - /// Gets the IImportPipelinesOperations. - /// - IImportPipelinesOperations ImportPipelines { get; } - /// /// Gets the IOperations. /// IOperations Operations { get; } - /// - /// Gets the IPipelineRunsOperations. - /// - IPipelineRunsOperations PipelineRuns { get; } - /// /// Gets the IPrivateEndpointConnectionsOperations. /// @@ -123,15 +108,5 @@ public partial interface IContainerRegistryManagementClient : System.IDisposable /// ITasksOperations Tasks { get; } - /// - /// Gets the IScopeMapsOperations. - /// - IScopeMapsOperations ScopeMaps { get; } - - /// - /// Gets the ITokensOperations. - /// - ITokensOperations Tokens { get; } - } } diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IExportPipelinesOperations.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IExportPipelinesOperations.cs deleted file mode 100644 index a8fc29370f52..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IExportPipelinesOperations.cs +++ /dev/null @@ -1,221 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.ContainerRegistry -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - - /// - /// ExportPipelinesOperations operations. - /// - public partial interface IExportPipelinesOperations - { - /// - /// Gets the properties of the export pipeline. - /// - /// - /// 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 headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string registryName, string exportPipelineName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates an export pipeline for a container registry with the - /// specified parameters. - /// - /// - /// 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 headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string registryName, string exportPipelineName, ExportPipeline exportPipelineCreateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes an export pipeline from a container registry. - /// - /// - /// 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 headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string exportPipelineName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists all export pipelines for the specified container registry. - /// - /// - /// The name of the resource group to which the container registry - /// belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates an export pipeline for a container registry with the - /// specified parameters. - /// - /// - /// 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 headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string registryName, string exportPipelineName, ExportPipeline exportPipelineCreateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes an export pipeline from a container registry. - /// - /// - /// 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 headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string exportPipelineName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists all export pipelines for the specified container registry. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IImportPipelinesOperations.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IImportPipelinesOperations.cs deleted file mode 100644 index 83082e1e9694..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IImportPipelinesOperations.cs +++ /dev/null @@ -1,221 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.ContainerRegistry -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - - /// - /// ImportPipelinesOperations operations. - /// - public partial interface IImportPipelinesOperations - { - /// - /// Gets the properties of the import pipeline. - /// - /// - /// 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 headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string registryName, string importPipelineName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates an import pipeline for a container registry with the - /// specified parameters. - /// - /// - /// 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 headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string registryName, string importPipelineName, ImportPipeline importPipelineCreateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes an import pipeline from a container registry. - /// - /// - /// 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 headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string importPipelineName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists all import pipelines for the specified container registry. - /// - /// - /// The name of the resource group to which the container registry - /// belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates an import pipeline for a container registry with the - /// specified parameters. - /// - /// - /// 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 headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string registryName, string importPipelineName, ImportPipeline importPipelineCreateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes an import pipeline from a container registry. - /// - /// - /// 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 headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string importPipelineName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists all import pipelines for the specified container registry. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IPipelineRunsOperations.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IPipelineRunsOperations.cs deleted file mode 100644 index 2237e79d1f3a..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IPipelineRunsOperations.cs +++ /dev/null @@ -1,229 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.ContainerRegistry -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - - /// - /// PipelineRunsOperations operations. - /// - public partial interface IPipelineRunsOperations - { - /// - /// Gets the detailed information for a given pipeline run. - /// - /// - /// 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 headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string registryName, string pipelineRunName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates a pipeline run for a container registry with the specified - /// parameters - /// - /// - /// 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 request parameters for a pipeline run. - /// - /// - /// How the pipeline run should be forced to recreate even if the - /// pipeline run configuration has not changed. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string registryName, string pipelineRunName, PipelineRunRequest request = default(PipelineRunRequest), string forceUpdateTag = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes a pipeline run from a container registry. - /// - /// - /// 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 headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string pipelineRunName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists all the pipeline runs for the specified container registry. - /// - /// - /// The name of the resource group to which the container registry - /// belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates a pipeline run for a container registry with the specified - /// parameters - /// - /// - /// 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 request parameters for a pipeline run. - /// - /// - /// How the pipeline run should be forced to recreate even if the - /// pipeline run configuration has not changed. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string registryName, string pipelineRunName, PipelineRunRequest request = default(PipelineRunRequest), string forceUpdateTag = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes a pipeline run from a container registry. - /// - /// - /// 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 headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string pipelineRunName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists all the pipeline runs for the specified container registry. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IPrivateEndpointConnectionsOperations.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IPrivateEndpointConnectionsOperations.cs index d5a537f49b92..a53c022224ed 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IPrivateEndpointConnectionsOperations.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IPrivateEndpointConnectionsOperations.cs @@ -23,8 +23,7 @@ namespace Microsoft.Azure.Management.ContainerRegistry public partial interface IPrivateEndpointConnectionsOperations { /// - /// Get the specified private endpoint connection associated with the - /// container registry. + /// List all private endpoint connections in a container registry. /// /// /// The name of the resource group to which the container registry @@ -33,9 +32,6 @@ public partial interface IPrivateEndpointConnectionsOperations /// /// The name of the container registry. /// - /// - /// The name of the private endpoint connection. - /// /// /// The headers that will be added to request. /// @@ -51,10 +47,10 @@ public partial interface IPrivateEndpointConnectionsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string registryName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Update the state of specified private endpoint connection - /// associated with the container registry. + /// Get the specified private endpoint connection associated with the + /// container registry. /// /// /// The name of the resource group to which the container registry @@ -66,13 +62,6 @@ public partial interface IPrivateEndpointConnectionsOperations /// /// The name of the private endpoint connection. /// - /// - /// The resource of private endpoint. - /// - /// - /// A collection of information about the state of the connection - /// between service consumer and provider. - /// /// /// The headers that will be added to request. /// @@ -88,10 +77,10 @@ public partial interface IPrivateEndpointConnectionsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, string privateEndpointConnectionName, PrivateEndpoint privateEndpoint = default(PrivateEndpoint), PrivateLinkServiceConnectionState privateLinkServiceConnectionState = default(PrivateLinkServiceConnectionState), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string registryName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes the specified private endpoint connection associated with - /// the container registry. + /// Update the state of specified private endpoint connection + /// associated with the container registry. /// /// /// The name of the resource group to which the container registry @@ -103,6 +92,13 @@ public partial interface IPrivateEndpointConnectionsOperations /// /// The name of the private endpoint connection. /// + /// + /// The resource of private endpoint. + /// + /// + /// A collection of information about the state of the connection + /// between service consumer and provider. + /// /// /// The headers that will be added to request. /// @@ -112,12 +108,16 @@ public partial interface IPrivateEndpointConnectionsOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, string privateEndpointConnectionName, PrivateEndpoint privateEndpoint = default(PrivateEndpoint), PrivateLinkServiceConnectionState privateLinkServiceConnectionState = default(PrivateLinkServiceConnectionState), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List all private endpoint connections in a container registry. + /// Deletes the specified private endpoint connection associated with + /// the container registry. /// /// /// The name of the resource group to which the container registry @@ -126,6 +126,9 @@ public partial interface IPrivateEndpointConnectionsOperations /// /// The name of the container registry. /// + /// + /// The name of the private endpoint connection. + /// /// /// The headers that will be added to request. /// @@ -135,13 +138,10 @@ public partial interface IPrivateEndpointConnectionsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Update the state of specified private endpoint connection /// associated with the container registry. diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IRegistriesOperations.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IRegistriesOperations.cs index e7674224a5d1..d7c5267db13d 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IRegistriesOperations.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IRegistriesOperations.cs @@ -75,15 +75,9 @@ public partial interface IRegistriesOperations /// System.Threading.Tasks.Task> CheckNameAvailabilityWithHttpMessagesAsync(string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the properties of the specified container registry. + /// Lists all the container registries under the specified + /// subscription. /// - /// - /// The name of the resource group to which the container registry - /// belongs. - /// - /// - /// The name of the container registry. - /// /// /// The headers that will be added to request. /// @@ -99,20 +93,15 @@ public partial interface IRegistriesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates a container registry with the specified parameters. + /// Lists all the container registries under the specified resource + /// group. /// /// /// The name of the resource group to which the container registry /// belongs. /// - /// - /// The name of the container registry. - /// - /// - /// The parameters for creating a container registry. - /// /// /// The headers that will be added to request. /// @@ -128,9 +117,9 @@ public partial interface IRegistriesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string registryName, Registry registry, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes a container registry. + /// Gets the properties of the specified container registry. /// /// /// The name of the resource group to which the container registry @@ -148,12 +137,15 @@ public partial interface IRegistriesOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Updates a container registry with the specified parameters. + /// Creates a container registry with the specified parameters. /// /// /// The name of the resource group to which the container registry @@ -162,8 +154,8 @@ public partial interface IRegistriesOperations /// /// The name of the container registry. /// - /// - /// The parameters for updating a container registry. + /// + /// The parameters for creating a container registry. /// /// /// The headers that will be added to request. @@ -180,15 +172,17 @@ public partial interface IRegistriesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, RegistryUpdateParameters registryUpdateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string registryName, Registry registry, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists all the container registries under the specified resource - /// group. + /// Deletes a container registry. /// /// /// The name of the resource group to which the container registry /// belongs. /// + /// + /// The name of the container registry. + /// /// /// The headers that will be added to request. /// @@ -198,17 +192,23 @@ public partial interface IRegistriesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists all the container registries under the specified - /// subscription. + /// Updates a container registry with the specified parameters. /// + /// + /// The name of the resource group to which the container registry + /// belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The parameters for updating a container registry. + /// /// /// The headers that will be added to request. /// @@ -224,9 +224,9 @@ public partial interface IRegistriesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, RegistryUpdateParameters registryUpdateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists the login credentials for the specified container registry. + /// Gets the quota usages for the specified container registry. /// /// /// The name of the resource group to which the container registry @@ -250,10 +250,9 @@ public partial interface IRegistriesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> ListCredentialsWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ListUsagesWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Regenerates one of the login credentials for the specified - /// container registry. + /// Lists the private link resources for a container registry. /// /// /// The name of the resource group to which the container registry @@ -262,11 +261,6 @@ public partial interface IRegistriesOperations /// /// The name of the container registry. /// - /// - /// Specifies name of the password which should be regenerated -- - /// password or password2. Possible values include: 'password', - /// 'password2' - /// /// /// The headers that will be added to request. /// @@ -282,9 +276,10 @@ public partial interface IRegistriesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> RegenerateCredentialWithHttpMessagesAsync(string resourceGroupName, string registryName, PasswordName name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListPrivateLinkResourcesWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the quota usages for the specified container registry. + /// Gets a private link resource by a specified group name for a + /// container registry. /// /// /// The name of the resource group to which the container registry @@ -293,13 +288,16 @@ public partial interface IRegistriesOperations /// /// The name of the container registry. /// + /// + /// The name of the private link resource. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -308,9 +306,9 @@ public partial interface IRegistriesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> ListUsagesWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetPrivateLinkResourceWithHttpMessagesAsync(string resourceGroupName, string registryName, string groupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists the private link resources for a container registry. + /// Lists the login credentials for the specified container registry. /// /// /// The name of the resource group to which the container registry @@ -334,10 +332,10 @@ public partial interface IRegistriesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListPrivateLinkResourcesWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ListCredentialsWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Schedules a new run based on the request parameters and add it to - /// the run queue. + /// Regenerates one of the login credentials for the specified + /// container registry. /// /// /// The name of the resource group to which the container registry @@ -346,8 +344,10 @@ public partial interface IRegistriesOperations /// /// The name of the container registry. /// - /// - /// The parameters of a run that needs to scheduled. + /// + /// Specifies name of the password which should be regenerated -- + /// password or password2. Possible values include: 'password', + /// 'password2' /// /// /// The headers that will be added to request. @@ -355,7 +355,7 @@ public partial interface IRegistriesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -364,10 +364,10 @@ public partial interface IRegistriesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> ScheduleRunWithHttpMessagesAsync(string resourceGroupName, string registryName, RunRequest runRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> RegenerateCredentialWithHttpMessagesAsync(string resourceGroupName, string registryName, PasswordName name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get the upload location for the user to be able to upload the - /// source. + /// Schedules a new run based on the request parameters and add it to + /// the run queue. /// /// /// The name of the resource group to which the container registry @@ -376,6 +376,9 @@ public partial interface IRegistriesOperations /// /// The name of the container registry. /// + /// + /// The parameters of a run that needs to scheduled. + /// /// /// The headers that will be added to request. /// @@ -391,9 +394,10 @@ public partial interface IRegistriesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetBuildSourceUploadUrlWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ScheduleRunWithHttpMessagesAsync(string resourceGroupName, string registryName, RunRequest runRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Generate keys for a token of a specified container registry. + /// Get the upload location for the user to be able to upload the + /// source. /// /// /// The name of the resource group to which the container registry @@ -402,16 +406,13 @@ public partial interface IRegistriesOperations /// /// The name of the container registry. /// - /// - /// The parameters for generating credentials. - /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -420,7 +421,7 @@ public partial interface IRegistriesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GenerateCredentialsWithHttpMessagesAsync(string resourceGroupName, string registryName, GenerateCredentialsParameters generateCredentialsParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetBuildSourceUploadUrlWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Copies an image to this container registry from the specified /// container registry. @@ -561,17 +562,11 @@ public partial interface IRegistriesOperations /// System.Threading.Tasks.Task> BeginScheduleRunWithHttpMessagesAsync(string resourceGroupName, string registryName, RunRequest runRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Generate keys for a token of a specified container registry. + /// Lists all the container registries under the specified + /// subscription. /// - /// - /// The name of the resource group to which the container registry - /// belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The parameters for generating credentials. + /// + /// The NextLink from the previous successful call to List operation. /// /// /// The headers that will be added to request. @@ -588,7 +583,7 @@ public partial interface IRegistriesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> BeginGenerateCredentialsWithHttpMessagesAsync(string resourceGroupName, string registryName, GenerateCredentialsParameters generateCredentialsParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists all the container registries under the specified resource /// group. @@ -613,29 +608,6 @@ public partial interface IRegistriesOperations /// System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists all the container registries under the specified - /// subscription. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Lists the private link resources for a container registry. /// /// diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IReplicationsOperations.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IReplicationsOperations.cs index 82c545f99789..8f7f5ec4b483 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IReplicationsOperations.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IReplicationsOperations.cs @@ -22,6 +22,32 @@ namespace Microsoft.Azure.Management.ContainerRegistry /// public partial interface IReplicationsOperations { + /// + /// Lists all the replications for the specified container registry. + /// + /// + /// The name of the resource group to which the container registry + /// belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets the properties of the specified replication. /// @@ -150,32 +176,6 @@ public partial interface IReplicationsOperations /// System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, string replicationName, IDictionary tags = default(IDictionary), bool? regionEndpointEnabled = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists all the replications for the specified container registry. - /// - /// - /// The name of the resource group to which the container registry - /// belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Creates a replication for a container registry with the specified /// parameters. /// diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IScopeMapsOperations.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IScopeMapsOperations.cs deleted file mode 100644 index 66c6295a2d43..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IScopeMapsOperations.cs +++ /dev/null @@ -1,305 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.ContainerRegistry -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - - /// - /// ScopeMapsOperations operations. - /// - public partial interface IScopeMapsOperations - { - /// - /// Gets the properties of the specified scope map. - /// - /// - /// The name of the resource group to which the container registry - /// belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the scope map. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string registryName, string scopeMapName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates a scope map for a container registry with the specified - /// parameters. - /// - /// - /// The name of the resource group to which the container registry - /// belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the scope map. - /// - /// - /// The list of scoped permissions for registry artifacts. - /// E.g. repositories/repository-name/content/read, - /// repositories/repository-name/metadata/write - /// - /// - /// The user friendly description of the scope map. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string registryName, string scopeMapName, IList actions, string description = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes a scope map from a container registry. - /// - /// - /// The name of the resource group to which the container registry - /// belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the scope map. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string scopeMapName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Updates a scope map with the specified parameters. - /// - /// - /// The name of the resource group to which the container registry - /// belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the scope map. - /// - /// - /// The user friendly description of the scope map. - /// - /// - /// The list of scope permissions for registry artifacts. - /// E.g. repositories/repository-name/pull, - /// repositories/repository-name/delete - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, string scopeMapName, string description = default(string), IList actions = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists all the scope maps for the specified container registry. - /// - /// - /// The name of the resource group to which the container registry - /// belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates a scope map for a container registry with the specified - /// parameters. - /// - /// - /// The name of the resource group to which the container registry - /// belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the scope map. - /// - /// - /// The list of scoped permissions for registry artifacts. - /// E.g. repositories/repository-name/content/read, - /// repositories/repository-name/metadata/write - /// - /// - /// The user friendly description of the scope map. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string registryName, string scopeMapName, IList actions, string description = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes a scope map from a container registry. - /// - /// - /// The name of the resource group to which the container registry - /// belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the scope map. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string scopeMapName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Updates a scope map with the specified parameters. - /// - /// - /// The name of the resource group to which the container registry - /// belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the scope map. - /// - /// - /// The user friendly description of the scope map. - /// - /// - /// The list of scope permissions for registry artifacts. - /// E.g. repositories/repository-name/pull, - /// repositories/repository-name/delete - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, string scopeMapName, string description = default(string), IList actions = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists all the scope maps for the specified container registry. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ITaskRunsOperations.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ITaskRunsOperations.cs index a0d3336155e9..d59f582b399c 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ITaskRunsOperations.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ITaskRunsOperations.cs @@ -33,7 +33,7 @@ public partial interface ITaskRunsOperations /// The name of the container registry. /// /// - /// The run request name. + /// The name of the task run. /// /// /// The headers that will be added to request. @@ -63,7 +63,7 @@ public partial interface ITaskRunsOperations /// The name of the container registry. /// /// - /// The name of task run. + /// The name of the task run. /// /// /// The parameters of a run that needs to scheduled. @@ -95,7 +95,7 @@ public partial interface ITaskRunsOperations /// The name of the container registry. /// /// - /// The task run name. + /// The name of the task run. /// /// /// The headers that will be added to request. @@ -121,7 +121,7 @@ public partial interface ITaskRunsOperations /// The name of the container registry. /// /// - /// The task run name. + /// The name of the task run. /// /// /// The parameters for updating a task run. @@ -154,7 +154,7 @@ public partial interface ITaskRunsOperations /// The name of the container registry. /// /// - /// The run request name. + /// The name of the task run. /// /// /// The headers that will be added to request. @@ -210,7 +210,7 @@ public partial interface ITaskRunsOperations /// The name of the container registry. /// /// - /// The name of task run. + /// The name of the task run. /// /// /// The parameters of a run that needs to scheduled. @@ -242,7 +242,7 @@ public partial interface ITaskRunsOperations /// The name of the container registry. /// /// - /// The task run name. + /// The name of the task run. /// /// /// The headers that will be added to request. @@ -268,7 +268,7 @@ public partial interface ITaskRunsOperations /// The name of the container registry. /// /// - /// The task run name. + /// The name of the task run. /// /// /// The parameters for updating a task run. diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ITokensOperations.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ITokensOperations.cs deleted file mode 100644 index 54ea4e6b411e..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ITokensOperations.cs +++ /dev/null @@ -1,285 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.ContainerRegistry -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - - /// - /// TokensOperations operations. - /// - public partial interface ITokensOperations - { - /// - /// Gets the properties of the specified token. - /// - /// - /// The name of the resource group to which the container registry - /// belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the token. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string registryName, string tokenName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates a token for a container registry with the specified - /// parameters. - /// - /// - /// The name of the resource group to which the container registry - /// belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the token. - /// - /// - /// The parameters for creating a token. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string registryName, string tokenName, Token tokenCreateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes a token from a container registry. - /// - /// - /// The name of the resource group to which the container registry - /// belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the token. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string tokenName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Updates a token with the specified parameters. - /// - /// - /// The name of the resource group to which the container registry - /// belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the token. - /// - /// - /// The parameters for updating a token. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, string tokenName, TokenUpdateParameters tokenUpdateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists all the tokens for the specified container registry. - /// - /// - /// The name of the resource group to which the container registry - /// belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates a token for a container registry with the specified - /// parameters. - /// - /// - /// The name of the resource group to which the container registry - /// belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the token. - /// - /// - /// The parameters for creating a token. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string registryName, string tokenName, Token tokenCreateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes a token from a container registry. - /// - /// - /// The name of the resource group to which the container registry - /// belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the token. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string tokenName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Updates a token with the specified parameters. - /// - /// - /// The name of the resource group to which the container registry - /// belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the token. - /// - /// - /// The parameters for updating a token. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, string tokenName, TokenUpdateParameters tokenUpdateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists all the tokens for the specified container registry. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IWebhooksOperations.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IWebhooksOperations.cs index d25434e61058..39f96404e10f 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IWebhooksOperations.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IWebhooksOperations.cs @@ -23,7 +23,7 @@ namespace Microsoft.Azure.Management.ContainerRegistry public partial interface IWebhooksOperations { /// - /// Gets the properties of the specified webhook. + /// Lists all the webhooks for the specified container registry. /// /// /// The name of the resource group to which the container registry @@ -32,9 +32,6 @@ public partial interface IWebhooksOperations /// /// The name of the container registry. /// - /// - /// The name of the webhook. - /// /// /// The headers that will be added to request. /// @@ -50,10 +47,9 @@ public partial interface IWebhooksOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string registryName, string webhookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates a webhook for a container registry with the specified - /// parameters. + /// Gets the properties of the specified webhook. /// /// /// The name of the resource group to which the container registry @@ -65,9 +61,6 @@ public partial interface IWebhooksOperations /// /// The name of the webhook. /// - /// - /// The parameters for creating a webhook. - /// /// /// The headers that will be added to request. /// @@ -83,9 +76,10 @@ public partial interface IWebhooksOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string registryName, string webhookName, WebhookCreateParameters webhookCreateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string registryName, string webhookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes a webhook from a container registry. + /// Creates a webhook for a container registry with the specified + /// parameters. /// /// /// The name of the resource group to which the container registry @@ -97,6 +91,9 @@ public partial interface IWebhooksOperations /// /// The name of the webhook. /// + /// + /// The parameters for creating a webhook. + /// /// /// The headers that will be added to request. /// @@ -106,12 +103,15 @@ public partial interface IWebhooksOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string webhookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string registryName, string webhookName, WebhookCreateParameters webhookCreateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Updates a webhook with the specified parameters. + /// Deletes a webhook from a container registry. /// /// /// The name of the resource group to which the container registry @@ -123,9 +123,6 @@ public partial interface IWebhooksOperations /// /// The name of the webhook. /// - /// - /// The parameters for updating a webhook. - /// /// /// The headers that will be added to request. /// @@ -135,15 +132,12 @@ public partial interface IWebhooksOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, string webhookName, WebhookUpdateParameters webhookUpdateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string webhookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists all the webhooks for the specified container registry. + /// Updates a webhook with the specified parameters. /// /// /// The name of the resource group to which the container registry @@ -152,6 +146,12 @@ public partial interface IWebhooksOperations /// /// The name of the container registry. /// + /// + /// The name of the webhook. + /// + /// + /// The parameters for updating a webhook. + /// /// /// The headers that will be added to request. /// @@ -167,7 +167,7 @@ public partial interface IWebhooksOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, string webhookName, WebhookUpdateParameters webhookUpdateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Triggers a ping event to be sent to the webhook. /// @@ -198,8 +198,7 @@ public partial interface IWebhooksOperations /// System.Threading.Tasks.Task> PingWithHttpMessagesAsync(string resourceGroupName, string registryName, string webhookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the configuration of service URI and custom headers for the - /// webhook. + /// Lists recent events for the specified webhook. /// /// /// The name of the resource group to which the container registry @@ -226,9 +225,10 @@ public partial interface IWebhooksOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetCallbackConfigWithHttpMessagesAsync(string resourceGroupName, string registryName, string webhookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListEventsWithHttpMessagesAsync(string resourceGroupName, string registryName, string webhookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists recent events for the specified webhook. + /// Gets the configuration of service URI and custom headers for the + /// webhook. /// /// /// The name of the resource group to which the container registry @@ -255,7 +255,7 @@ public partial interface IWebhooksOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListEventsWithHttpMessagesAsync(string resourceGroupName, string registryName, string webhookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetCallbackConfigWithHttpMessagesAsync(string resourceGroupName, string registryName, string webhookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Creates a webhook for a container registry with the specified /// parameters. diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ImportPipelinesOperations.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ImportPipelinesOperations.cs deleted file mode 100644 index fc2ea4219a99..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ImportPipelinesOperations.cs +++ /dev/null @@ -1,1232 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.ContainerRegistry -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - - /// - /// ImportPipelinesOperations operations. - /// - internal partial class ImportPipelinesOperations : IServiceOperations, IImportPipelinesOperations - { - /// - /// Initializes a new instance of the ImportPipelinesOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal ImportPipelinesOperations(ContainerRegistryManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the ContainerRegistryManagementClient - /// - public ContainerRegistryManagementClient Client { get; private set; } - - /// - /// Gets the properties of the import pipeline. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the import pipeline. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string registryName, string importPipelineName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - } - if (registryName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "registryName"); - } - if (registryName != null) - { - if (registryName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "registryName", 50); - } - if (registryName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "registryName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(registryName, "^[a-zA-Z0-9]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); - } - } - if (importPipelineName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "importPipelineName"); - } - if (importPipelineName != null) - { - if (importPipelineName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "importPipelineName", 50); - } - if (importPipelineName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "importPipelineName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(importPipelineName, "^[a-zA-Z0-9]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "importPipelineName", "^[a-zA-Z0-9]*$"); - } - } - string apiVersion = "2019-12-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("registryName", registryName); - tracingParameters.Add("importPipelineName", importPipelineName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); - _url = _url.Replace("{importPipelineName}", System.Uri.EscapeDataString(importPipelineName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Creates an import pipeline for a container registry with the specified - /// parameters. - /// - /// - /// 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 headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string registryName, string importPipelineName, ImportPipeline importPipelineCreateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, registryName, importPipelineName, importPipelineCreateParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes an import pipeline from a container registry. - /// - /// - /// 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 headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string importPipelineName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, registryName, importPipelineName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Lists all import pipelines for the specified container registry. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - } - if (registryName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "registryName"); - } - if (registryName != null) - { - if (registryName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "registryName", 50); - } - if (registryName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "registryName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(registryName, "^[a-zA-Z0-9]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); - } - } - string apiVersion = "2019-12-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("registryName", registryName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Creates an import pipeline for a container registry with the specified - /// parameters. - /// - /// - /// 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. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string registryName, string importPipelineName, ImportPipeline importPipelineCreateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - } - if (registryName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "registryName"); - } - if (registryName != null) - { - if (registryName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "registryName", 50); - } - if (registryName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "registryName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(registryName, "^[a-zA-Z0-9]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); - } - } - if (importPipelineName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "importPipelineName"); - } - if (importPipelineName != null) - { - if (importPipelineName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "importPipelineName", 50); - } - if (importPipelineName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "importPipelineName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(importPipelineName, "^[a-zA-Z0-9]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "importPipelineName", "^[a-zA-Z0-9]*$"); - } - } - if (importPipelineCreateParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "importPipelineCreateParameters"); - } - if (importPipelineCreateParameters != null) - { - importPipelineCreateParameters.Validate(); - } - string apiVersion = "2019-12-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("registryName", registryName); - tracingParameters.Add("importPipelineName", importPipelineName); - tracingParameters.Add("importPipelineCreateParameters", importPipelineCreateParameters); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); - _url = _url.Replace("{importPipelineName}", System.Uri.EscapeDataString(importPipelineName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(importPipelineCreateParameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(importPipelineCreateParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Deletes an import pipeline from a container registry. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the import pipeline. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string importPipelineName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - } - if (registryName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "registryName"); - } - if (registryName != null) - { - if (registryName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "registryName", 50); - } - if (registryName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "registryName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(registryName, "^[a-zA-Z0-9]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); - } - } - if (importPipelineName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "importPipelineName"); - } - if (importPipelineName != null) - { - if (importPipelineName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "importPipelineName", 50); - } - if (importPipelineName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "importPipelineName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(importPipelineName, "^[a-zA-Z0-9]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "importPipelineName", "^[a-zA-Z0-9]*$"); - } - } - string apiVersion = "2019-12-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("registryName", registryName); - tracingParameters.Add("importPipelineName", importPipelineName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importPipelines/{importPipelineName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); - _url = _url.Replace("{importPipelineName}", System.Uri.EscapeDataString(importPipelineName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Lists all import pipelines for the specified container registry. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (nextPageLink == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ImportPipelinesOperationsExtensions.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ImportPipelinesOperationsExtensions.cs deleted file mode 100644 index 3a9d58b429cf..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ImportPipelinesOperationsExtensions.cs +++ /dev/null @@ -1,338 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.ContainerRegistry -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - - /// - /// Extension methods for ImportPipelinesOperations. - /// - public static partial class ImportPipelinesOperationsExtensions - { - /// - /// Gets the properties of the import pipeline. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the import pipeline. - /// - public static ImportPipeline Get(this IImportPipelinesOperations operations, string resourceGroupName, string registryName, string importPipelineName) - { - return operations.GetAsync(resourceGroupName, registryName, importPipelineName).GetAwaiter().GetResult(); - } - - /// - /// Gets the properties of the import pipeline. - /// - /// - /// The operations group for this extension method. - /// - /// - /// 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. - /// - public static async System.Threading.Tasks.Task GetAsync(this IImportPipelinesOperations operations, string resourceGroupName, string registryName, string importPipelineName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, registryName, importPipelineName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates an import pipeline for a container registry with the specified - /// parameters. - /// - /// - /// The operations group for this extension method. - /// - /// - /// 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. - /// - public static ImportPipeline Create(this IImportPipelinesOperations operations, string resourceGroupName, string registryName, string importPipelineName, ImportPipeline importPipelineCreateParameters) - { - return operations.CreateAsync(resourceGroupName, registryName, importPipelineName, importPipelineCreateParameters).GetAwaiter().GetResult(); - } - - /// - /// Creates an import pipeline for a container registry with the specified - /// parameters. - /// - /// - /// The operations group for this extension method. - /// - /// - /// 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. - /// - public static async System.Threading.Tasks.Task CreateAsync(this IImportPipelinesOperations operations, string resourceGroupName, string registryName, string importPipelineName, ImportPipeline importPipelineCreateParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, registryName, importPipelineName, importPipelineCreateParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes an import pipeline from a container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the import pipeline. - /// - public static void Delete(this IImportPipelinesOperations operations, string resourceGroupName, string registryName, string importPipelineName) - { - operations.DeleteAsync(resourceGroupName, registryName, importPipelineName).GetAwaiter().GetResult(); - } - - /// - /// Deletes an import pipeline from a container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// 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. - /// - public static async System.Threading.Tasks.Task DeleteAsync(this IImportPipelinesOperations operations, string resourceGroupName, string registryName, string importPipelineName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, registryName, importPipelineName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Lists all import pipelines for the specified container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - public static IPage List(this IImportPipelinesOperations operations, string resourceGroupName, string registryName) - { - return operations.ListAsync(resourceGroupName, registryName).GetAwaiter().GetResult(); - } - - /// - /// Lists all import pipelines for the specified container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task> ListAsync(this IImportPipelinesOperations operations, string resourceGroupName, string registryName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, registryName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates an import pipeline for a container registry with the specified - /// parameters. - /// - /// - /// The operations group for this extension method. - /// - /// - /// 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. - /// - public static ImportPipeline BeginCreate(this IImportPipelinesOperations operations, string resourceGroupName, string registryName, string importPipelineName, ImportPipeline importPipelineCreateParameters) - { - return operations.BeginCreateAsync(resourceGroupName, registryName, importPipelineName, importPipelineCreateParameters).GetAwaiter().GetResult(); - } - - /// - /// Creates an import pipeline for a container registry with the specified - /// parameters. - /// - /// - /// The operations group for this extension method. - /// - /// - /// 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. - /// - public static async System.Threading.Tasks.Task BeginCreateAsync(this IImportPipelinesOperations operations, string resourceGroupName, string registryName, string importPipelineName, ImportPipeline importPipelineCreateParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateWithHttpMessagesAsync(resourceGroupName, registryName, importPipelineName, importPipelineCreateParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes an import pipeline from a container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the import pipeline. - /// - public static void BeginDelete(this IImportPipelinesOperations operations, string resourceGroupName, string registryName, string importPipelineName) - { - operations.BeginDeleteAsync(resourceGroupName, registryName, importPipelineName).GetAwaiter().GetResult(); - } - - /// - /// Deletes an import pipeline from a container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// 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. - /// - public static async System.Threading.Tasks.Task BeginDeleteAsync(this IImportPipelinesOperations operations, string resourceGroupName, string registryName, string importPipelineName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, registryName, importPipelineName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Lists all import pipelines for the specified container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IImportPipelinesOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all import pipelines for the specified container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task> ListNextAsync(this IImportPipelinesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ActiveDirectoryObject.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ActiveDirectoryObject.cs deleted file mode 100644 index 4f16bf0328d1..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ActiveDirectoryObject.cs +++ /dev/null @@ -1,68 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.ContainerRegistry.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// The Active Directory Object that will be used for authenticating the - /// token of a container registry. - /// - public partial class ActiveDirectoryObject - { - /// - /// Initializes a new instance of the ActiveDirectoryObject class. - /// - public ActiveDirectoryObject() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ActiveDirectoryObject class. - /// - /// The user/group/application object ID for - /// Active Directory Object that will be used for authenticating the - /// token of a container registry. - /// The tenant ID of user/group/application - /// object Active Directory Object that will be used for authenticating - /// the token of a container registry. - public ActiveDirectoryObject(string objectId = default(string), string tenantId = default(string)) - { - ObjectId = objectId; - TenantId = tenantId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the user/group/application object ID for Active - /// Directory Object that will be used for authenticating the token of - /// a container registry. - /// - [JsonProperty(PropertyName = "objectId")] - public string ObjectId { get; set; } - - /// - /// Gets or sets the tenant ID of user/group/application object Active - /// Directory Object that will be used for authenticating the token of - /// a container registry. - /// - [JsonProperty(PropertyName = "tenantId")] - public string TenantId { get; set; } - - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/AgentPool.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/AgentPool.cs index d75d5917e799..919fb470fabd 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/AgentPool.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/AgentPool.cs @@ -41,6 +41,8 @@ public AgentPool() /// The name of the resource. /// The type of the resource. /// The tags of the resource. + /// Metadata pertaining to creation and last + /// modification of the resource. /// The count of agent machine /// The Tier of agent machine /// The OS of agent machine. Possible values include: @@ -50,8 +52,8 @@ public AgentPool() /// The provisioning state of this /// agent pool. Possible values include: 'Creating', 'Updating', /// 'Deleting', 'Succeeded', 'Failed', 'Canceled' - public AgentPool(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), int? count = default(int?), string tier = default(string), string os = default(string), string virtualNetworkSubnetResourceId = default(string), string provisioningState = default(string)) - : base(location, id, name, type, tags) + public AgentPool(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), SystemData systemData = default(SystemData), int? count = default(int?), string tier = default(string), string os = default(string), string virtualNetworkSubnetResourceId = default(string), string provisioningState = default(string)) + : base(location, id, name, type, tags, systemData) { Count = count; Tier = tier; diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/BaseImageTrigger.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/BaseImageTrigger.cs index 0f02163a9999..7d0a3d925649 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/BaseImageTrigger.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/BaseImageTrigger.cs @@ -40,7 +40,7 @@ public BaseImageTrigger() /// Base image update triggers. Possible values include: 'Default', /// 'Token' /// The current status of trigger. Possible values - /// include: 'Enabled', 'Disabled' + /// include: 'Disabled', 'Enabled' public BaseImageTrigger(string baseImageTriggerType, string name, string updateTriggerEndpoint = default(string), string updateTriggerPayloadType = default(string), string status = default(string)) { BaseImageTriggerType = baseImageTriggerType; @@ -78,7 +78,7 @@ public BaseImageTrigger() /// /// Gets or sets the current status of trigger. Possible values - /// include: 'Enabled', 'Disabled' + /// include: 'Disabled', 'Enabled' /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/BaseImageTriggerUpdateParameters.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/BaseImageTriggerUpdateParameters.cs index a7d2b3c695ff..15c9593a64a6 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/BaseImageTriggerUpdateParameters.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/BaseImageTriggerUpdateParameters.cs @@ -42,7 +42,7 @@ public BaseImageTriggerUpdateParameters() /// Base image update triggers. Possible values include: 'Default', /// 'Token' /// The current status of trigger. Possible values - /// include: 'Enabled', 'Disabled' + /// include: 'Disabled', 'Enabled' public BaseImageTriggerUpdateParameters(string name, string baseImageTriggerType = default(string), string updateTriggerEndpoint = default(string), string updateTriggerPayloadType = default(string), string status = default(string)) { BaseImageTriggerType = baseImageTriggerType; @@ -80,7 +80,7 @@ public BaseImageTriggerUpdateParameters() /// /// Gets or sets the current status of trigger. Possible values - /// include: 'Enabled', 'Disabled' + /// include: 'Disabled', 'Enabled' /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenCertificateName.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/CreatedByType.cs similarity index 62% rename from sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenCertificateName.cs rename to sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/CreatedByType.cs index a975121ef70d..e47c39c72395 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenCertificateName.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/CreatedByType.cs @@ -12,11 +12,13 @@ namespace Microsoft.Azure.Management.ContainerRegistry.Models { /// - /// Defines values for TokenCertificateName. + /// Defines values for CreatedByType. /// - public static class TokenCertificateName + public static class CreatedByType { - public const string Certificate1 = "certificate1"; - public const string Certificate2 = "certificate2"; + public const string User = "User"; + public const string Application = "Application"; + public const string ManagedIdentity = "ManagedIdentity"; + public const string Key = "Key"; } } diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/DockerBuildRequest.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/DockerBuildRequest.cs index 95987281ab3e..2b0288b3f924 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/DockerBuildRequest.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/DockerBuildRequest.cs @@ -40,6 +40,8 @@ public DockerBuildRequest() /// archiving is enabled for the run or not. /// The dedicated agent pool for the /// run. + /// The template that describes the + /// repository and tag information for run log artifact. /// The fully qualified image names including /// the repository and tag. /// The value of this property indicates @@ -60,8 +62,8 @@ public DockerBuildRequest() /// calling listBuildSourceUploadUrl API. /// The properties that describes a set of /// credentials that will be used when this run is invoked. - public DockerBuildRequest(string dockerFilePath, PlatformProperties platform, bool? isArchiveEnabled = default(bool?), string agentPoolName = default(string), IList imageNames = default(IList), bool? isPushEnabled = default(bool?), bool? noCache = default(bool?), string target = default(string), IList arguments = default(IList), int? timeout = default(int?), AgentProperties agentConfiguration = default(AgentProperties), string sourceLocation = default(string), Credentials credentials = default(Credentials)) - : base(isArchiveEnabled, agentPoolName) + public DockerBuildRequest(string dockerFilePath, PlatformProperties platform, bool? isArchiveEnabled = default(bool?), string agentPoolName = default(string), string logTemplate = default(string), IList imageNames = default(IList), bool? isPushEnabled = default(bool?), bool? noCache = default(bool?), string target = default(string), IList arguments = default(IList), int? timeout = default(int?), AgentProperties agentConfiguration = default(AgentProperties), string sourceLocation = default(string), Credentials credentials = default(Credentials)) + : base(isArchiveEnabled, agentPoolName, logTemplate) { ImageNames = imageNames; IsPushEnabled = isPushEnabled; diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/EncodedTaskRunRequest.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/EncodedTaskRunRequest.cs index 16d681bed82e..1446871fdafb 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/EncodedTaskRunRequest.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/EncodedTaskRunRequest.cs @@ -40,6 +40,8 @@ public EncodedTaskRunRequest() /// archiving is enabled for the run or not. /// The dedicated agent pool for the /// run. + /// The template that describes the + /// repository and tag information for run log artifact. /// Base64 encoded value of the /// parameters/values file content. /// The collection of overridable values that can @@ -53,8 +55,8 @@ public EncodedTaskRunRequest() /// calling listBuildSourceUploadUrl API. /// The properties that describes a set of /// credentials that will be used when this run is invoked. - public EncodedTaskRunRequest(string encodedTaskContent, PlatformProperties platform, bool? isArchiveEnabled = default(bool?), string agentPoolName = default(string), string encodedValuesContent = default(string), IList values = default(IList), int? timeout = default(int?), AgentProperties agentConfiguration = default(AgentProperties), string sourceLocation = default(string), Credentials credentials = default(Credentials)) - : base(isArchiveEnabled, agentPoolName) + public EncodedTaskRunRequest(string encodedTaskContent, PlatformProperties platform, bool? isArchiveEnabled = default(bool?), string agentPoolName = default(string), string logTemplate = default(string), string encodedValuesContent = default(string), IList values = default(IList), int? timeout = default(int?), AgentProperties agentConfiguration = default(AgentProperties), string sourceLocation = default(string), Credentials credentials = default(Credentials)) + : base(isArchiveEnabled, agentPoolName, logTemplate) { EncodedTaskContent = encodedTaskContent; EncodedValuesContent = encodedValuesContent; diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ErrorResponseBody.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ErrorResponseBody.cs index 6771c39a5d34..caa04c6fa291 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ErrorResponseBody.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ErrorResponseBody.cs @@ -12,6 +12,8 @@ namespace Microsoft.Azure.Management.ContainerRegistry.Models { using Microsoft.Rest; using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -35,7 +37,7 @@ public ErrorResponseBody() /// target of the particular error. /// an array of additional nested error response /// info objects, as described by this contract. - public ErrorResponseBody(string code, string message, string target = default(string), InnerErrorDescription details = default(InnerErrorDescription)) + public ErrorResponseBody(string code, string message, string target = default(string), IList details = default(IList)) { Code = code; Message = message; @@ -72,7 +74,7 @@ public ErrorResponseBody() /// objects, as described by this contract. /// [JsonProperty(PropertyName = "details")] - public InnerErrorDescription Details { get; set; } + public IList Details { get; set; } /// /// Validate the object. @@ -92,7 +94,13 @@ public virtual void Validate() } if (Details != null) { - Details.Validate(); + foreach (var element in Details) + { + if (element != null) + { + element.Validate(); + } + } } } } diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ExportPipeline.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ExportPipeline.cs deleted file mode 100644 index a4723490d9ce..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ExportPipeline.cs +++ /dev/null @@ -1,116 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.ContainerRegistry.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// An object that represents an export pipeline for a container registry. - /// - [Rest.Serialization.JsonTransformation] - public partial class ExportPipeline : ProxyResource - { - /// - /// Initializes a new instance of the ExportPipeline class. - /// - public ExportPipeline() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ExportPipeline class. - /// - /// The target properties of the export - /// pipeline. - /// The resource ID. - /// The name of the resource. - /// The type of the resource. - /// The location of the export pipeline. - /// The identity 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. Possible values - /// include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', - /// 'Canceled' - public ExportPipeline(ExportPipelineTargetProperties target, string id = default(string), string name = default(string), string type = default(string), string location = default(string), IdentityProperties identity = default(IdentityProperties), IList options = default(IList), string provisioningState = default(string)) - : base(id, name, type) - { - Location = location; - Identity = identity; - Target = target; - Options = options; - ProvisioningState = provisioningState; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the location of the export pipeline. - /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } - - /// - /// Gets or sets the identity of the export pipeline. - /// - [JsonProperty(PropertyName = "identity")] - public IdentityProperties Identity { get; set; } - - /// - /// Gets or sets the target properties of the export pipeline. - /// - [JsonProperty(PropertyName = "properties.target")] - public ExportPipelineTargetProperties Target { get; set; } - - /// - /// Gets or sets the list of all options configured for the pipeline. - /// - [JsonProperty(PropertyName = "properties.options")] - public IList Options { get; set; } - - /// - /// Gets the provisioning state of the pipeline at the time the - /// operation was called. Possible values include: 'Creating', - /// 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Target == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Target"); - } - if (Target != null) - { - Target.Validate(); - } - } - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ExportPipelineTargetProperties.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ExportPipelineTargetProperties.cs deleted file mode 100644 index 83ded1a7bca8..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ExportPipelineTargetProperties.cs +++ /dev/null @@ -1,94 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.ContainerRegistry.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// The properties of the export pipeline target. - /// - public partial class ExportPipelineTargetProperties - { - /// - /// Initializes a new instance of the ExportPipelineTargetProperties - /// class. - /// - public ExportPipelineTargetProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ExportPipelineTargetProperties - /// class. - /// - /// They key vault secret uri to obtain the - /// target storage SAS token. - /// 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" - public ExportPipelineTargetProperties(string keyVaultUri, string type = default(string), string uri = default(string)) - { - Type = type; - Uri = uri; - KeyVaultUri = keyVaultUri; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the type of target for the export pipeline. - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - - /// - /// Gets or sets 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" - /// - [JsonProperty(PropertyName = "uri")] - public string Uri { get; set; } - - /// - /// Gets or sets they key vault secret uri to obtain the target storage - /// SAS token. - /// - [JsonProperty(PropertyName = "keyVaultUri")] - public string KeyVaultUri { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (KeyVaultUri == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "KeyVaultUri"); - } - } - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PipelineSourceTriggerDescriptor.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ExportPolicy.cs similarity index 52% rename from sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PipelineSourceTriggerDescriptor.cs rename to sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ExportPolicy.cs index 7d689a6c7113..f2752f56cd9a 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PipelineSourceTriggerDescriptor.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ExportPolicy.cs @@ -13,26 +13,28 @@ namespace Microsoft.Azure.Management.ContainerRegistry.Models using Newtonsoft.Json; using System.Linq; - public partial class PipelineSourceTriggerDescriptor + /// + /// The export policy for a container registry. + /// + public partial class ExportPolicy { /// - /// Initializes a new instance of the PipelineSourceTriggerDescriptor - /// class. + /// Initializes a new instance of the ExportPolicy class. /// - public PipelineSourceTriggerDescriptor() + public ExportPolicy() { CustomInit(); } /// - /// Initializes a new instance of the PipelineSourceTriggerDescriptor - /// class. + /// Initializes a new instance of the ExportPolicy class. /// - /// The timestamp when the source update - /// happened. - public PipelineSourceTriggerDescriptor(System.DateTime? timestamp = default(System.DateTime?)) + /// The value that indicates whether the policy is + /// enabled or not. Possible values include: 'enabled', + /// 'disabled' + public ExportPolicy(string status = default(string)) { - Timestamp = timestamp; + Status = status; CustomInit(); } @@ -42,10 +44,11 @@ public PipelineSourceTriggerDescriptor() partial void CustomInit(); /// - /// Gets or sets the timestamp when the source update happened. + /// Gets or sets the value that indicates whether the policy is enabled + /// or not. Possible values include: 'enabled', 'disabled' /// - [JsonProperty(PropertyName = "timestamp")] - public System.DateTime? Timestamp { get; set; } + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } } } diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenStatus.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ExportPolicyStatus.cs similarity index 86% rename from sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenStatus.cs rename to sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ExportPolicyStatus.cs index 66e28887889e..b68e668327fd 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenStatus.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ExportPolicyStatus.cs @@ -12,9 +12,9 @@ namespace Microsoft.Azure.Management.ContainerRegistry.Models { /// - /// Defines values for TokenStatus. + /// Defines values for ExportPolicyStatus. /// - public static class TokenStatus + public static class ExportPolicyStatus { public const string Enabled = "enabled"; public const string Disabled = "disabled"; diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/FileTaskRunRequest.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/FileTaskRunRequest.cs index b74153c8b378..167e780e7407 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/FileTaskRunRequest.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/FileTaskRunRequest.cs @@ -40,6 +40,8 @@ public FileTaskRunRequest() /// archiving is enabled for the run or not. /// The dedicated agent pool for the /// run. + /// The template that describes the + /// repository and tag information for run log artifact. /// The values/parameters file path /// relative to the source. /// The collection of overridable values that can @@ -53,8 +55,8 @@ public FileTaskRunRequest() /// calling listBuildSourceUploadUrl API. /// The properties that describes a set of /// credentials that will be used when this run is invoked. - public FileTaskRunRequest(string taskFilePath, PlatformProperties platform, bool? isArchiveEnabled = default(bool?), string agentPoolName = default(string), string valuesFilePath = default(string), IList values = default(IList), int? timeout = default(int?), AgentProperties agentConfiguration = default(AgentProperties), string sourceLocation = default(string), Credentials credentials = default(Credentials)) - : base(isArchiveEnabled, agentPoolName) + public FileTaskRunRequest(string taskFilePath, PlatformProperties platform, bool? isArchiveEnabled = default(bool?), string agentPoolName = default(string), string logTemplate = default(string), string valuesFilePath = default(string), IList values = default(IList), int? timeout = default(int?), AgentProperties agentConfiguration = default(AgentProperties), string sourceLocation = default(string), Credentials credentials = default(Credentials)) + : base(isArchiveEnabled, agentPoolName, logTemplate) { TaskFilePath = taskFilePath; ValuesFilePath = valuesFilePath; diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/GenerateCredentialsParameters.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/GenerateCredentialsParameters.cs deleted file mode 100644 index 7df868657e6d..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/GenerateCredentialsParameters.cs +++ /dev/null @@ -1,78 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.ContainerRegistry.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// The parameters used to generate credentials for a specified token or - /// user of a container registry. - /// - public partial class GenerateCredentialsParameters - { - /// - /// Initializes a new instance of the GenerateCredentialsParameters - /// class. - /// - public GenerateCredentialsParameters() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the GenerateCredentialsParameters - /// class. - /// - /// The resource ID of the token for which - /// credentials have to be generated. - /// The expiry date of the generated credentials - /// after which the credentials become invalid. - /// Specifies name of the password which should be - /// regenerated if any -- password1 or password2. Possible values - /// include: 'password1', 'password2' - public GenerateCredentialsParameters(string tokenId = default(string), System.DateTime? expiry = default(System.DateTime?), string name = default(string)) - { - TokenId = tokenId; - Expiry = expiry; - Name = name; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the resource ID of the token for which credentials - /// have to be generated. - /// - [JsonProperty(PropertyName = "tokenId")] - public string TokenId { get; set; } - - /// - /// Gets or sets the expiry date of the generated credentials after - /// which the credentials become invalid. - /// - [JsonProperty(PropertyName = "expiry")] - public System.DateTime? Expiry { get; set; } - - /// - /// Gets or sets specifies name of the password which should be - /// regenerated if any -- password1 or password2. Possible values - /// include: 'password1', 'password2' - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/GenerateCredentialsResult.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/GenerateCredentialsResult.cs deleted file mode 100644 index 054a3ea3eabd..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/GenerateCredentialsResult.cs +++ /dev/null @@ -1,63 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.ContainerRegistry.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The response from the GenerateCredentials operation. - /// - public partial class GenerateCredentialsResult - { - /// - /// Initializes a new instance of the GenerateCredentialsResult class. - /// - public GenerateCredentialsResult() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the GenerateCredentialsResult class. - /// - /// The username for a container - /// registry. - /// The list of passwords for a container - /// registry. - public GenerateCredentialsResult(string username = default(string), IList passwords = default(IList)) - { - Username = username; - Passwords = passwords; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the username for a container registry. - /// - [JsonProperty(PropertyName = "username")] - public string Username { get; set; } - - /// - /// Gets or sets the list of passwords for a container registry. - /// - [JsonProperty(PropertyName = "passwords")] - public IList Passwords { get; set; } - - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ImportPipeline.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ImportPipeline.cs deleted file mode 100644 index 09c1ae805b87..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ImportPipeline.cs +++ /dev/null @@ -1,130 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.ContainerRegistry.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// An object that represents an import pipeline for a container registry. - /// - [Rest.Serialization.JsonTransformation] - public partial class ImportPipeline : ProxyResource - { - /// - /// Initializes a new instance of the ImportPipeline class. - /// - public ImportPipeline() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ImportPipeline class. - /// - /// The source properties of the import - /// pipeline. - /// The resource ID. - /// The name of the resource. - /// The type of the resource. - /// The location of the import pipeline. - /// The identity 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. Possible values - /// include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', - /// 'Canceled' - public ImportPipeline(ImportPipelineSourceProperties source, string id = default(string), string name = default(string), string type = default(string), string location = default(string), IdentityProperties identity = default(IdentityProperties), PipelineTriggerProperties trigger = default(PipelineTriggerProperties), IList options = default(IList), string provisioningState = default(string)) - : base(id, name, type) - { - Location = location; - Identity = identity; - Source = source; - Trigger = trigger; - Options = options; - ProvisioningState = provisioningState; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the location of the import pipeline. - /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } - - /// - /// Gets or sets the identity of the import pipeline. - /// - [JsonProperty(PropertyName = "identity")] - public IdentityProperties Identity { get; set; } - - /// - /// Gets or sets the source properties of the import pipeline. - /// - [JsonProperty(PropertyName = "properties.source")] - public ImportPipelineSourceProperties Source { get; set; } - - /// - /// Gets or sets the properties that describe the trigger of the import - /// pipeline. - /// - [JsonProperty(PropertyName = "properties.trigger")] - public PipelineTriggerProperties Trigger { get; set; } - - /// - /// Gets or sets the list of all options configured for the pipeline. - /// - [JsonProperty(PropertyName = "properties.options")] - public IList Options { get; set; } - - /// - /// Gets the provisioning state of the pipeline at the time the - /// operation was called. Possible values include: 'Creating', - /// 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Source == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Source"); - } - if (Source != null) - { - Source.Validate(); - } - if (Trigger != null) - { - Trigger.Validate(); - } - } - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ImportPipelineSourceProperties.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ImportPipelineSourceProperties.cs deleted file mode 100644 index 70d4711067f7..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ImportPipelineSourceProperties.cs +++ /dev/null @@ -1,95 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.ContainerRegistry.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// The properties of the import pipeline source. - /// - public partial class ImportPipelineSourceProperties - { - /// - /// Initializes a new instance of the ImportPipelineSourceProperties - /// class. - /// - public ImportPipelineSourceProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ImportPipelineSourceProperties - /// class. - /// - /// They key vault secret uri to obtain the - /// source storage SAS token. - /// The type of source for the import pipeline. - /// Possible values include: 'AzureStorageBlobContainer' - /// 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 ImportPipelineSourceProperties(string keyVaultUri, string type = default(string), string uri = default(string)) - { - Type = type; - Uri = uri; - KeyVaultUri = keyVaultUri; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the type of source for the import pipeline. Possible - /// values include: 'AzureStorageBlobContainer' - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - - /// - /// Gets or sets 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" - /// - [JsonProperty(PropertyName = "uri")] - public string Uri { get; set; } - - /// - /// Gets or sets they key vault secret uri to obtain the source storage - /// SAS token. - /// - [JsonProperty(PropertyName = "keyVaultUri")] - public string KeyVaultUri { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (KeyVaultUri == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "KeyVaultUri"); - } - } - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/KeyVaultProperties.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/KeyVaultProperties.cs index c0fd813bd132..e385ebadf09c 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/KeyVaultProperties.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/KeyVaultProperties.cs @@ -33,11 +33,17 @@ public KeyVaultProperties() /// used for encryption. /// The client id of the identity which will be /// used to access key vault. - public KeyVaultProperties(string keyIdentifier = default(string), string versionedKeyIdentifier = default(string), string identity = default(string)) + /// Auto key rotation status for a CMK + /// enabled registry. + /// Timestamp of the last + /// successful key rotation. + public KeyVaultProperties(string keyIdentifier = default(string), string versionedKeyIdentifier = default(string), string identity = default(string), bool? keyRotationEnabled = default(bool?), System.DateTime? lastKeyRotationTimestamp = default(System.DateTime?)) { KeyIdentifier = keyIdentifier; VersionedKeyIdentifier = versionedKeyIdentifier; Identity = identity; + KeyRotationEnabled = keyRotationEnabled; + LastKeyRotationTimestamp = lastKeyRotationTimestamp; CustomInit(); } @@ -66,5 +72,17 @@ public KeyVaultProperties() [JsonProperty(PropertyName = "identity")] public string Identity { get; set; } + /// + /// Gets auto key rotation status for a CMK enabled registry. + /// + [JsonProperty(PropertyName = "keyRotationEnabled")] + public bool? KeyRotationEnabled { get; private set; } + + /// + /// Gets timestamp of the last successful key rotation. + /// + [JsonProperty(PropertyName = "lastKeyRotationTimestamp")] + public System.DateTime? LastKeyRotationTimestamp { get; private set; } + } } diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PipelineRunTargetType.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/LastModifiedByType.cs similarity index 61% rename from sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PipelineRunTargetType.cs rename to sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/LastModifiedByType.cs index cd4a4a1d7925..7cb0f1c207ae 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PipelineRunTargetType.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/LastModifiedByType.cs @@ -12,10 +12,13 @@ namespace Microsoft.Azure.Management.ContainerRegistry.Models { /// - /// Defines values for PipelineRunTargetType. + /// Defines values for LastModifiedByType. /// - public static class PipelineRunTargetType + public static class LastModifiedByType { - public const string AzureStorageBlob = "AzureStorageBlob"; + public const string User = "User"; + public const string Application = "Application"; + public const string ManagedIdentity = "ManagedIdentity"; + public const string Key = "Key"; } } diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenPasswordName.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/NetworkRuleBypassOptions.cs similarity index 69% rename from sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenPasswordName.cs rename to sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/NetworkRuleBypassOptions.cs index 78d44e77dc4d..4b36386a2903 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenPasswordName.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/NetworkRuleBypassOptions.cs @@ -12,11 +12,11 @@ namespace Microsoft.Azure.Management.ContainerRegistry.Models { /// - /// Defines values for TokenPasswordName. + /// Defines values for NetworkRuleBypassOptions. /// - public static class TokenPasswordName + public static class NetworkRuleBypassOptions { - public const string Password1 = "password1"; - public const string Password2 = "password2"; + public const string AzureServices = "AzureServices"; + public const string None = "None"; } } diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/NetworkRuleSet.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/NetworkRuleSet.cs index 961245c8dfa6..3aab0ced0b95 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/NetworkRuleSet.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/NetworkRuleSet.cs @@ -35,13 +35,10 @@ public NetworkRuleSet() /// The default action of allow or deny /// when no other rules match. Possible values include: 'Allow', /// 'Deny' - /// The virtual network - /// rules. /// The IP ACL rules. - public NetworkRuleSet(string defaultAction, IList virtualNetworkRules = default(IList), IList ipRules = default(IList)) + public NetworkRuleSet(string defaultAction, IList ipRules = default(IList)) { DefaultAction = defaultAction; - VirtualNetworkRules = virtualNetworkRules; IpRules = ipRules; CustomInit(); } @@ -58,12 +55,6 @@ public NetworkRuleSet() [JsonProperty(PropertyName = "defaultAction")] public string DefaultAction { get; set; } - /// - /// Gets or sets the virtual network rules. - /// - [JsonProperty(PropertyName = "virtualNetworkRules")] - public IList VirtualNetworkRules { get; set; } - /// /// Gets or sets the IP ACL rules. /// @@ -82,9 +73,9 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.CannotBeNull, "DefaultAction"); } - if (VirtualNetworkRules != null) + if (IpRules != null) { - foreach (var element in VirtualNetworkRules) + foreach (var element in IpRules) { if (element != null) { @@ -92,16 +83,6 @@ public virtual void Validate() } } } - if (IpRules != null) - { - foreach (var element1 in IpRules) - { - if (element1 != null) - { - element1.Validate(); - } - } - } } } } diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/OperationDefinition.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/OperationDefinition.cs index e9bd9a0d7a97..bdffa50f24d6 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/OperationDefinition.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/OperationDefinition.cs @@ -40,12 +40,17 @@ public OperationDefinition() /// registry operation. /// The definition of Azure /// Monitoring service. - public OperationDefinition(string origin = default(string), string name = default(string), OperationDisplayDefinition display = default(OperationDisplayDefinition), OperationServiceSpecificationDefinition serviceSpecification = default(OperationServiceSpecificationDefinition)) + /// This property indicates if the operation + /// is an action or a data action + /// ref: + /// https://docs.microsoft.com/en-us/azure/role-based-access-control/role-definitions#management-and-data-operations + public OperationDefinition(string origin = default(string), string name = default(string), OperationDisplayDefinition display = default(OperationDisplayDefinition), OperationServiceSpecificationDefinition serviceSpecification = default(OperationServiceSpecificationDefinition), bool? isDataAction = default(bool?)) { Origin = origin; Name = name; Display = display; ServiceSpecification = serviceSpecification; + IsDataAction = isDataAction; CustomInit(); } @@ -80,5 +85,14 @@ public OperationDefinition() [JsonProperty(PropertyName = "properties.serviceSpecification")] public OperationServiceSpecificationDefinition ServiceSpecification { get; set; } + /// + /// Gets or sets this property indicates if the operation is an action + /// or a data action + /// ref: + /// https://docs.microsoft.com/en-us/azure/role-based-access-control/role-definitions#management-and-data-operations + /// + [JsonProperty(PropertyName = "isDataAction")] + public bool? IsDataAction { get; set; } + } } diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/OperationLogSpecificationDefinition.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/OperationLogSpecificationDefinition.cs new file mode 100644 index 000000000000..0dce199013d9 --- /dev/null +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/OperationLogSpecificationDefinition.cs @@ -0,0 +1,69 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.ContainerRegistry.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The definition of Azure Monitoring log. + /// + public partial class OperationLogSpecificationDefinition + { + /// + /// Initializes a new instance of the + /// OperationLogSpecificationDefinition class. + /// + public OperationLogSpecificationDefinition() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// OperationLogSpecificationDefinition class. + /// + /// Log name. + /// Log display name. + /// Log blob duration. + public OperationLogSpecificationDefinition(string name = default(string), string displayName = default(string), string blobDuration = default(string)) + { + Name = name; + DisplayName = displayName; + BlobDuration = blobDuration; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets log name. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets log display name. + /// + [JsonProperty(PropertyName = "displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets log blob duration. + /// + [JsonProperty(PropertyName = "blobDuration")] + public string BlobDuration { get; set; } + + } +} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/OperationServiceSpecificationDefinition.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/OperationServiceSpecificationDefinition.cs index b38c70091a26..779b8be36fe2 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/OperationServiceSpecificationDefinition.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/OperationServiceSpecificationDefinition.cs @@ -35,9 +35,12 @@ public OperationServiceSpecificationDefinition() /// /// A list of Azure Monitoring /// metrics definition. - public OperationServiceSpecificationDefinition(IList metricSpecifications = default(IList)) + /// A list of Azure Monitoring log + /// definitions. + public OperationServiceSpecificationDefinition(IList metricSpecifications = default(IList), IList logSpecifications = default(IList)) { MetricSpecifications = metricSpecifications; + LogSpecifications = logSpecifications; CustomInit(); } @@ -52,5 +55,11 @@ public OperationServiceSpecificationDefinition() [JsonProperty(PropertyName = "metricSpecifications")] public IList MetricSpecifications { get; set; } + /// + /// Gets or sets a list of Azure Monitoring log definitions. + /// + [JsonProperty(PropertyName = "logSpecifications")] + public IList LogSpecifications { get; set; } + } } diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PipelineRunSourceProperties.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PackageType.cs similarity index 55% rename from sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PipelineRunSourceProperties.cs rename to sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PackageType.cs index 879c0083ec86..86530fba0611 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PipelineRunSourceProperties.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PackageType.cs @@ -13,28 +13,28 @@ namespace Microsoft.Azure.Management.ContainerRegistry.Models using Newtonsoft.Json; using System.Linq; - public partial class PipelineRunSourceProperties + /// + /// The properties of a package type. + /// + public partial class PackageType { /// - /// Initializes a new instance of the PipelineRunSourceProperties - /// class. + /// Initializes a new instance of the PackageType class. /// - public PipelineRunSourceProperties() + public PackageType() { CustomInit(); } /// - /// Initializes a new instance of the PipelineRunSourceProperties - /// class. + /// Initializes a new instance of the PackageType class. /// - /// The type of the source. Possible values include: - /// 'AzureStorageBlob' - /// The name of the source. - public PipelineRunSourceProperties(string type = default(string), string name = default(string)) + /// The name of the package type. + /// The endpoint of the package type. + public PackageType(string name = default(string), string endpoint = default(string)) { - Type = type; Name = name; + Endpoint = endpoint; CustomInit(); } @@ -44,17 +44,16 @@ public PipelineRunSourceProperties() partial void CustomInit(); /// - /// Gets or sets the type of the source. Possible values include: - /// 'AzureStorageBlob' + /// Gets or sets the name of the package type. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } /// - /// Gets or sets the name of the source. + /// Gets the endpoint of the package type. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [JsonProperty(PropertyName = "endpoint")] + public string Endpoint { get; private set; } } } diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PipelineOptions.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PipelineOptions.cs deleted file mode 100644 index b5861e4d9cd7..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PipelineOptions.cs +++ /dev/null @@ -1,24 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.ContainerRegistry.Models -{ - - /// - /// Defines values for PipelineOptions. - /// - public static class PipelineOptions - { - public const string OverwriteTags = "OverwriteTags"; - public const string OverwriteBlobs = "OverwriteBlobs"; - public const string DeleteSourceBlobOnSuccess = "DeleteSourceBlobOnSuccess"; - public const string ContinueOnErrors = "ContinueOnErrors"; - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PipelineRun.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PipelineRun.cs deleted file mode 100644 index f6fc687cdcdf..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PipelineRun.cs +++ /dev/null @@ -1,103 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.ContainerRegistry.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// An object that represents a pipeline run for a container registry. - /// - [Rest.Serialization.JsonTransformation] - public partial class PipelineRun : ProxyResource - { - /// - /// Initializes a new instance of the PipelineRun class. - /// - public PipelineRun() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the PipelineRun class. - /// - /// The resource ID. - /// The name of the resource. - /// The type of the resource. - /// The provisioning state of a - /// pipeline run. Possible values include: 'Creating', 'Updating', - /// 'Deleting', 'Succeeded', 'Failed', 'Canceled' - /// 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. - public PipelineRun(string id = default(string), string name = default(string), string type = default(string), string provisioningState = default(string), PipelineRunRequest request = default(PipelineRunRequest), PipelineRunResponse response = default(PipelineRunResponse), string forceUpdateTag = default(string)) - : base(id, name, type) - { - ProvisioningState = provisioningState; - Request = request; - Response = response; - ForceUpdateTag = forceUpdateTag; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the provisioning state of a pipeline run. Possible values - /// include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', - /// 'Canceled' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } - - /// - /// Gets or sets the request parameters for a pipeline run. - /// - [JsonProperty(PropertyName = "properties.request")] - public PipelineRunRequest Request { get; set; } - - /// - /// Gets the response of a pipeline run. - /// - [JsonProperty(PropertyName = "properties.response")] - public PipelineRunResponse Response { get; private set; } - - /// - /// Gets or sets how the pipeline run should be forced to recreate even - /// if the pipeline run configuration has not changed. - /// - [JsonProperty(PropertyName = "properties.forceUpdateTag")] - public string ForceUpdateTag { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Response != null) - { - Response.Validate(); - } - } - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PipelineRunRequest.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PipelineRunRequest.cs deleted file mode 100644 index f4243732926f..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PipelineRunRequest.cs +++ /dev/null @@ -1,101 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.ContainerRegistry.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The request properties provided for a pipeline run. - /// - public partial class PipelineRunRequest - { - /// - /// Initializes a new instance of the PipelineRunRequest class. - /// - public PipelineRunRequest() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the PipelineRunRequest class. - /// - /// 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. - public PipelineRunRequest(string pipelineResourceId = default(string), IList artifacts = default(IList), PipelineRunSourceProperties source = default(PipelineRunSourceProperties), PipelineRunTargetProperties target = default(PipelineRunTargetProperties), string catalogDigest = default(string)) - { - PipelineResourceId = pipelineResourceId; - Artifacts = artifacts; - Source = source; - Target = target; - CatalogDigest = catalogDigest; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the resource ID of the pipeline to run. - /// - [JsonProperty(PropertyName = "pipelineResourceId")] - public string PipelineResourceId { get; set; } - - /// - /// Gets or sets 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'). - /// - [JsonProperty(PropertyName = "artifacts")] - public IList Artifacts { get; set; } - - /// - /// Gets or sets the source properties of the pipeline run. - /// - [JsonProperty(PropertyName = "source")] - public PipelineRunSourceProperties Source { get; set; } - - /// - /// Gets or sets the target properties of the pipeline run. - /// - [JsonProperty(PropertyName = "target")] - public PipelineRunTargetProperties Target { get; set; } - - /// - /// Gets or sets the digest of the tar used to transfer the artifacts. - /// - [JsonProperty(PropertyName = "catalogDigest")] - public string CatalogDigest { get; set; } - - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PipelineRunResponse.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PipelineRunResponse.cs deleted file mode 100644 index ba7b97f5bbda..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PipelineRunResponse.cs +++ /dev/null @@ -1,150 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.ContainerRegistry.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The response properties returned for a pipeline run. - /// - public partial class PipelineRunResponse - { - /// - /// Initializes a new instance of the PipelineRunResponse class. - /// - public PipelineRunResponse() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the PipelineRunResponse class. - /// - /// 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. - public PipelineRunResponse(string status = default(string), IList importedArtifacts = default(IList), ProgressProperties progress = default(ProgressProperties), System.DateTime? startTime = default(System.DateTime?), System.DateTime? finishTime = default(System.DateTime?), ImportPipelineSourceProperties source = default(ImportPipelineSourceProperties), ExportPipelineTargetProperties target = default(ExportPipelineTargetProperties), string catalogDigest = default(string), PipelineTriggerDescriptor trigger = default(PipelineTriggerDescriptor), string pipelineRunErrorMessage = default(string)) - { - Status = status; - ImportedArtifacts = importedArtifacts; - Progress = progress; - StartTime = startTime; - FinishTime = finishTime; - Source = source; - Target = target; - CatalogDigest = catalogDigest; - Trigger = trigger; - PipelineRunErrorMessage = pipelineRunErrorMessage; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the current status of the pipeline run. - /// - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } - - /// - /// Gets or sets the artifacts imported in the pipeline run. - /// - [JsonProperty(PropertyName = "importedArtifacts")] - public IList ImportedArtifacts { get; set; } - - /// - /// Gets or sets the current progress of the copy operation. - /// - [JsonProperty(PropertyName = "progress")] - public ProgressProperties Progress { get; set; } - - /// - /// Gets or sets the time the pipeline run started. - /// - [JsonProperty(PropertyName = "startTime")] - public System.DateTime? StartTime { get; set; } - - /// - /// Gets or sets the time the pipeline run finished. - /// - [JsonProperty(PropertyName = "finishTime")] - public System.DateTime? FinishTime { get; set; } - - /// - /// Gets or sets the source of the pipeline run. - /// - [JsonProperty(PropertyName = "source")] - public ImportPipelineSourceProperties Source { get; set; } - - /// - /// Gets or sets the target of the pipeline run. - /// - [JsonProperty(PropertyName = "target")] - public ExportPipelineTargetProperties Target { get; set; } - - /// - /// Gets or sets the digest of the tar used to transfer the artifacts. - /// - [JsonProperty(PropertyName = "catalogDigest")] - public string CatalogDigest { get; set; } - - /// - /// Gets or sets the trigger that caused the pipeline run. - /// - [JsonProperty(PropertyName = "trigger")] - public PipelineTriggerDescriptor Trigger { get; set; } - - /// - /// Gets or sets the detailed error message for the pipeline run in the - /// case of failure. - /// - [JsonProperty(PropertyName = "pipelineRunErrorMessage")] - public string PipelineRunErrorMessage { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Source != null) - { - Source.Validate(); - } - if (Target != null) - { - Target.Validate(); - } - } - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PipelineRunTargetProperties.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PipelineRunTargetProperties.cs deleted file mode 100644 index 97452993008f..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PipelineRunTargetProperties.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.ContainerRegistry.Models -{ - using Newtonsoft.Json; - using System.Linq; - - public partial class PipelineRunTargetProperties - { - /// - /// Initializes a new instance of the PipelineRunTargetProperties - /// class. - /// - public PipelineRunTargetProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the PipelineRunTargetProperties - /// class. - /// - /// The type of the target. Possible values include: - /// 'AzureStorageBlob' - /// The name of the target. - public PipelineRunTargetProperties(string type = default(string), string name = default(string)) - { - Type = type; - Name = name; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the type of the target. Possible values include: - /// 'AzureStorageBlob' - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - - /// - /// Gets or sets the name of the target. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PipelineSourceTriggerProperties.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PipelineSourceTriggerProperties.cs deleted file mode 100644 index 2ef545e96b78..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PipelineSourceTriggerProperties.cs +++ /dev/null @@ -1,66 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.ContainerRegistry.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - public partial class PipelineSourceTriggerProperties - { - /// - /// Initializes a new instance of the PipelineSourceTriggerProperties - /// class. - /// - public PipelineSourceTriggerProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the PipelineSourceTriggerProperties - /// class. - /// - /// The current status of the source trigger. - /// Possible values include: 'Enabled', 'Disabled' - public PipelineSourceTriggerProperties(string status) - { - Status = status; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the current status of the source trigger. Possible - /// values include: 'Enabled', 'Disabled' - /// - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Status == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Status"); - } - } - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PipelineSourceType.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PipelineSourceType.cs deleted file mode 100644 index 11135f3778e4..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PipelineSourceType.cs +++ /dev/null @@ -1,21 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.ContainerRegistry.Models -{ - - /// - /// Defines values for PipelineSourceType. - /// - public static class PipelineSourceType - { - public const string AzureStorageBlobContainer = "AzureStorageBlobContainer"; - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PipelineTriggerDescriptor.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PipelineTriggerDescriptor.cs deleted file mode 100644 index a3c074e25276..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PipelineTriggerDescriptor.cs +++ /dev/null @@ -1,49 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.ContainerRegistry.Models -{ - using Newtonsoft.Json; - using System.Linq; - - public partial class PipelineTriggerDescriptor - { - /// - /// Initializes a new instance of the PipelineTriggerDescriptor class. - /// - public PipelineTriggerDescriptor() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the PipelineTriggerDescriptor class. - /// - /// The source trigger that caused the - /// pipeline run. - public PipelineTriggerDescriptor(PipelineSourceTriggerDescriptor sourceTrigger = default(PipelineSourceTriggerDescriptor)) - { - SourceTrigger = sourceTrigger; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the source trigger that caused the pipeline run. - /// - [JsonProperty(PropertyName = "sourceTrigger")] - public PipelineSourceTriggerDescriptor SourceTrigger { get; set; } - - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PipelineTriggerProperties.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PipelineTriggerProperties.cs deleted file mode 100644 index 1bf32b1e75ef..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PipelineTriggerProperties.cs +++ /dev/null @@ -1,62 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.ContainerRegistry.Models -{ - using Newtonsoft.Json; - using System.Linq; - - public partial class PipelineTriggerProperties - { - /// - /// Initializes a new instance of the PipelineTriggerProperties class. - /// - public PipelineTriggerProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the PipelineTriggerProperties class. - /// - /// The source trigger properties of the - /// pipeline. - public PipelineTriggerProperties(PipelineSourceTriggerProperties sourceTrigger = default(PipelineSourceTriggerProperties)) - { - SourceTrigger = sourceTrigger; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the source trigger properties of the pipeline. - /// - [JsonProperty(PropertyName = "sourceTrigger")] - public PipelineSourceTriggerProperties SourceTrigger { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (SourceTrigger != null) - { - SourceTrigger.Validate(); - } - } - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Policies.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Policies.cs index 28ea311fd652..ffc21b38951c 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Policies.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Policies.cs @@ -35,11 +35,14 @@ public Policies() /// registry. /// The retention policy for a container /// registry. - public Policies(QuarantinePolicy quarantinePolicy = default(QuarantinePolicy), TrustPolicy trustPolicy = default(TrustPolicy), RetentionPolicy retentionPolicy = default(RetentionPolicy)) + /// The export policy for a container + /// registry. + public Policies(QuarantinePolicy quarantinePolicy = default(QuarantinePolicy), TrustPolicy trustPolicy = default(TrustPolicy), RetentionPolicy retentionPolicy = default(RetentionPolicy), ExportPolicy exportPolicy = default(ExportPolicy)) { QuarantinePolicy = quarantinePolicy; TrustPolicy = trustPolicy; RetentionPolicy = retentionPolicy; + ExportPolicy = exportPolicy; CustomInit(); } @@ -66,5 +69,11 @@ public Policies() [JsonProperty(PropertyName = "retentionPolicy")] public RetentionPolicy RetentionPolicy { get; set; } + /// + /// Gets or sets the export policy for a container registry. + /// + [JsonProperty(PropertyName = "exportPolicy")] + public ExportPolicy ExportPolicy { get; set; } + } } diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PrivateEndpointConnection.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PrivateEndpointConnection.cs index aa11d266054f..7f170f8c2f4b 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PrivateEndpointConnection.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PrivateEndpointConnection.cs @@ -36,6 +36,8 @@ public PrivateEndpointConnection() /// The resource ID. /// The name of the resource. /// The type of the resource. + /// Metadata pertaining to creation and last + /// modification of the resource. /// The resource of private /// endpoint. /// A collection of @@ -44,8 +46,8 @@ public PrivateEndpointConnection() /// The provisioning state of private /// endpoint connection resource. Possible values include: 'Creating', /// 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' - public PrivateEndpointConnection(string id = default(string), string name = default(string), string type = default(string), PrivateEndpoint privateEndpoint = default(PrivateEndpoint), PrivateLinkServiceConnectionState privateLinkServiceConnectionState = default(PrivateLinkServiceConnectionState), string provisioningState = default(string)) - : base(id, name, type) + public PrivateEndpointConnection(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), PrivateEndpoint privateEndpoint = default(PrivateEndpoint), PrivateLinkServiceConnectionState privateLinkServiceConnectionState = default(PrivateLinkServiceConnectionState), string provisioningState = default(string)) + : base(id, name, type, systemData) { PrivateEndpoint = privateEndpoint; PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ProgressProperties.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ProgressProperties.cs deleted file mode 100644 index 8eb6bd01f24c..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ProgressProperties.cs +++ /dev/null @@ -1,49 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.ContainerRegistry.Models -{ - using Newtonsoft.Json; - using System.Linq; - - public partial class ProgressProperties - { - /// - /// Initializes a new instance of the ProgressProperties class. - /// - public ProgressProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ProgressProperties class. - /// - /// The percentage complete of the copy - /// operation. - public ProgressProperties(string percentage = default(string)) - { - Percentage = percentage; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the percentage complete of the copy operation. - /// - [JsonProperty(PropertyName = "percentage")] - public string Percentage { get; set; } - - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ProxyResource.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ProxyResource.cs index f5febadd4c36..14e8a35517ad 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ProxyResource.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ProxyResource.cs @@ -35,11 +35,14 @@ public ProxyResource() /// The resource ID. /// The name of the resource. /// The type of the resource. - public ProxyResource(string id = default(string), string name = default(string), string type = default(string)) + /// Metadata pertaining to creation and last + /// modification of the resource. + public ProxyResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData)) { Id = id; Name = name; Type = type; + SystemData = systemData; CustomInit(); } @@ -66,5 +69,12 @@ public ProxyResource() [JsonProperty(PropertyName = "type")] public string Type { get; private set; } + /// + /// Gets metadata pertaining to creation and last modification of the + /// resource. + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + } } diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Registry.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Registry.cs index c0349a967ee8..737d49afccc0 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Registry.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Registry.cs @@ -41,6 +41,8 @@ public Registry() /// The name of the resource. /// The type of the resource. /// The tags of the resource. + /// Metadata pertaining to creation and last + /// modification of the resource. /// The identity of the container /// registry. /// The URL that can be used to log into the @@ -55,8 +57,6 @@ public Registry() /// time the operation was called. /// The value that indicates whether the /// admin user is enabled. - /// The properties of the storage account - /// for the container registry. Only applicable to Classic SKU. /// The network rule set for a container /// registry. /// The policies for a container @@ -72,8 +72,14 @@ public Registry() /// Whether or not public network /// access is allowed for the container registry. Possible values /// include: 'Enabled', 'Disabled' - public Registry(string location, Sku sku, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), IdentityProperties identity = default(IdentityProperties), string loginServer = default(string), System.DateTime? creationDate = default(System.DateTime?), string provisioningState = default(string), Status status = default(Status), bool? adminUserEnabled = default(bool?), StorageAccountProperties storageAccount = default(StorageAccountProperties), NetworkRuleSet networkRuleSet = default(NetworkRuleSet), Policies policies = default(Policies), EncryptionProperty encryption = default(EncryptionProperty), bool? dataEndpointEnabled = default(bool?), IList dataEndpointHostNames = default(IList), IList privateEndpointConnections = default(IList), string publicNetworkAccess = default(string)) - : base(location, id, name, type, tags) + /// Whether to allow trusted + /// Azure services to access a network restricted registry. Possible + /// values include: 'AzureServices', 'None' + /// Whether or not zone redundancy is + /// enabled for this container registry. Possible values include: + /// 'Enabled', 'Disabled' + public Registry(string location, Sku sku, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), SystemData systemData = default(SystemData), IdentityProperties identity = default(IdentityProperties), string loginServer = default(string), System.DateTime? creationDate = default(System.DateTime?), string provisioningState = default(string), Status status = default(Status), bool? adminUserEnabled = default(bool?), NetworkRuleSet networkRuleSet = default(NetworkRuleSet), Policies policies = default(Policies), EncryptionProperty encryption = default(EncryptionProperty), bool? dataEndpointEnabled = default(bool?), IList dataEndpointHostNames = default(IList), IList privateEndpointConnections = default(IList), string publicNetworkAccess = default(string), string networkRuleBypassOptions = default(string), string zoneRedundancy = default(string)) + : base(location, id, name, type, tags, systemData) { Sku = sku; Identity = identity; @@ -82,7 +88,6 @@ public Registry() ProvisioningState = provisioningState; Status = status; AdminUserEnabled = adminUserEnabled; - StorageAccount = storageAccount; NetworkRuleSet = networkRuleSet; Policies = policies; Encryption = encryption; @@ -90,6 +95,8 @@ public Registry() DataEndpointHostNames = dataEndpointHostNames; PrivateEndpointConnections = privateEndpointConnections; PublicNetworkAccess = publicNetworkAccess; + NetworkRuleBypassOptions = networkRuleBypassOptions; + ZoneRedundancy = zoneRedundancy; CustomInit(); } @@ -144,13 +151,6 @@ public Registry() [JsonProperty(PropertyName = "properties.adminUserEnabled")] public bool? AdminUserEnabled { get; set; } - /// - /// Gets or sets the properties of the storage account for the - /// container registry. Only applicable to Classic SKU. - /// - [JsonProperty(PropertyName = "properties.storageAccount")] - public StorageAccountProperties StorageAccount { get; set; } - /// /// Gets or sets the network rule set for a container registry. /// @@ -197,6 +197,21 @@ public Registry() [JsonProperty(PropertyName = "properties.publicNetworkAccess")] public string PublicNetworkAccess { get; set; } + /// + /// Gets or sets whether to allow trusted Azure services to access a + /// network restricted registry. Possible values include: + /// 'AzureServices', 'None' + /// + [JsonProperty(PropertyName = "properties.networkRuleBypassOptions")] + public string NetworkRuleBypassOptions { get; set; } + + /// + /// Gets or sets whether or not zone redundancy is enabled for this + /// container registry. Possible values include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "properties.zoneRedundancy")] + public string ZoneRedundancy { get; set; } + /// /// Validate the object. /// @@ -214,10 +229,6 @@ public override void Validate() { Sku.Validate(); } - if (StorageAccount != null) - { - StorageAccount.Validate(); - } if (NetworkRuleSet != null) { NetworkRuleSet.Validate(); diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/RegistryUpdateParameters.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/RegistryUpdateParameters.cs index 8154ddfae8a9..f1ec2ce55e0f 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/RegistryUpdateParameters.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/RegistryUpdateParameters.cs @@ -34,10 +34,10 @@ public RegistryUpdateParameters() /// /// Initializes a new instance of the RegistryUpdateParameters class. /// - /// The tags for the container registry. - /// The SKU of the container registry. /// The identity of the container /// registry. + /// The tags for the container registry. + /// The SKU of the container registry. /// The value that indicates whether the /// admin user is enabled. /// The network rule set for a container @@ -51,17 +51,21 @@ public RegistryUpdateParameters() /// Whether or not public network /// access is allowed for the container registry. Possible values /// include: 'Enabled', 'Disabled' - public RegistryUpdateParameters(IDictionary tags = default(IDictionary), Sku sku = default(Sku), IdentityProperties identity = default(IdentityProperties), bool? adminUserEnabled = default(bool?), NetworkRuleSet networkRuleSet = default(NetworkRuleSet), Policies policies = default(Policies), EncryptionProperty encryption = default(EncryptionProperty), bool? dataEndpointEnabled = default(bool?), string publicNetworkAccess = default(string)) + /// Whether to allow trusted + /// Azure services to access a network restricted registry. Possible + /// values include: 'AzureServices', 'None' + public RegistryUpdateParameters(IdentityProperties identity = default(IdentityProperties), IDictionary tags = default(IDictionary), Sku sku = default(Sku), bool? adminUserEnabled = default(bool?), NetworkRuleSet networkRuleSet = default(NetworkRuleSet), Policies policies = default(Policies), EncryptionProperty encryption = default(EncryptionProperty), bool? dataEndpointEnabled = default(bool?), string publicNetworkAccess = default(string), string networkRuleBypassOptions = default(string)) { + Identity = identity; Tags = tags; Sku = sku; - Identity = identity; AdminUserEnabled = adminUserEnabled; NetworkRuleSet = networkRuleSet; Policies = policies; Encryption = encryption; DataEndpointEnabled = dataEndpointEnabled; PublicNetworkAccess = publicNetworkAccess; + NetworkRuleBypassOptions = networkRuleBypassOptions; CustomInit(); } @@ -70,6 +74,12 @@ public RegistryUpdateParameters() /// partial void CustomInit(); + /// + /// Gets or sets the identity of the container registry. + /// + [JsonProperty(PropertyName = "identity")] + public IdentityProperties Identity { get; set; } + /// /// Gets or sets the tags for the container registry. /// @@ -82,12 +92,6 @@ public RegistryUpdateParameters() [JsonProperty(PropertyName = "sku")] public Sku Sku { get; set; } - /// - /// Gets or sets the identity of the container registry. - /// - [JsonProperty(PropertyName = "identity")] - public IdentityProperties Identity { get; set; } - /// /// Gets or sets the value that indicates whether the admin user is /// enabled. @@ -128,6 +132,14 @@ public RegistryUpdateParameters() [JsonProperty(PropertyName = "properties.publicNetworkAccess")] public string PublicNetworkAccess { get; set; } + /// + /// Gets or sets whether to allow trusted Azure services to access a + /// network restricted registry. Possible values include: + /// 'AzureServices', 'None' + /// + [JsonProperty(PropertyName = "properties.networkRuleBypassOptions")] + public string NetworkRuleBypassOptions { get; set; } + /// /// Validate the object. /// diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Replication.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Replication.cs index 6b4c57b49dbf..8b592867a340 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Replication.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Replication.cs @@ -40,6 +40,8 @@ public Replication() /// The name of the resource. /// The type of the resource. /// The tags of the resource. + /// Metadata pertaining to creation and last + /// modification of the resource. /// The provisioning state of the /// replication at the time the operation was called. Possible values /// include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', @@ -51,12 +53,16 @@ public Replication() /// routed to a replication whose regional endpoint is disabled, /// however its data will continue to be synced with other /// replications. - public Replication(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string provisioningState = default(string), Status status = default(Status), bool? regionEndpointEnabled = default(bool?)) - : base(location, id, name, type, tags) + /// Whether or not zone redundancy is + /// enabled for this container registry replication. Possible values + /// include: 'Enabled', 'Disabled' + public Replication(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), SystemData systemData = default(SystemData), string provisioningState = default(string), Status status = default(Status), bool? regionEndpointEnabled = default(bool?), string zoneRedundancy = default(string)) + : base(location, id, name, type, tags, systemData) { ProvisioningState = provisioningState; Status = status; RegionEndpointEnabled = regionEndpointEnabled; + ZoneRedundancy = zoneRedundancy; CustomInit(); } @@ -89,6 +95,14 @@ public Replication() [JsonProperty(PropertyName = "properties.regionEndpointEnabled")] public bool? RegionEndpointEnabled { get; set; } + /// + /// Gets or sets whether or not zone redundancy is enabled for this + /// container registry replication. Possible values include: 'Enabled', + /// 'Disabled' + /// + [JsonProperty(PropertyName = "properties.zoneRedundancy")] + public string ZoneRedundancy { get; set; } + /// /// Validate the object. /// diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Resource.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Resource.cs index d391546c45b6..7237c43ef357 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Resource.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Resource.cs @@ -39,13 +39,16 @@ public Resource() /// The name of the resource. /// The type of the resource. /// The tags of the resource. - public Resource(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary)) + /// Metadata pertaining to creation and last + /// modification of the resource. + public Resource(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), SystemData systemData = default(SystemData)) { Id = id; Name = name; Type = type; Location = location; Tags = tags; + SystemData = systemData; CustomInit(); } @@ -85,6 +88,13 @@ public Resource() [JsonProperty(PropertyName = "tags")] public IDictionary Tags { get; set; } + /// + /// Gets metadata pertaining to creation and last modification of the + /// resource. + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + /// /// Validate the object. /// diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Run.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Run.cs index 6bbd29be30e5..992d9205f9a0 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Run.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Run.cs @@ -37,6 +37,8 @@ public Run() /// The resource ID. /// The name of the resource. /// The type of the resource. + /// Metadata pertaining to creation and last + /// modification of the resource. /// The unique identifier for the run. /// The current status of the run. Possible values /// include: 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', @@ -74,13 +76,15 @@ public Run() /// backend systems after the run is scheduled. /// The update trigger token passed /// for the Run. + /// The image description for the log + /// artifact. /// The provisioning state of a run. /// Possible values include: 'Creating', 'Updating', 'Deleting', /// 'Succeeded', 'Failed', 'Canceled' /// The value that indicates whether /// archiving is enabled or not. - public Run(string id = default(string), string name = default(string), string type = default(string), string runId = default(string), string status = default(string), System.DateTime? lastUpdatedTime = default(System.DateTime?), string runType = default(string), string agentPoolName = default(string), System.DateTime? createTime = default(System.DateTime?), System.DateTime? startTime = default(System.DateTime?), System.DateTime? finishTime = default(System.DateTime?), IList outputImages = default(IList), string task = default(string), ImageUpdateTrigger imageUpdateTrigger = default(ImageUpdateTrigger), SourceTriggerDescriptor sourceTrigger = default(SourceTriggerDescriptor), TimerTriggerDescriptor timerTrigger = default(TimerTriggerDescriptor), PlatformProperties platform = default(PlatformProperties), AgentProperties agentConfiguration = default(AgentProperties), string sourceRegistryAuth = default(string), IList customRegistries = default(IList), string runErrorMessage = default(string), string updateTriggerToken = default(string), string provisioningState = default(string), bool? isArchiveEnabled = default(bool?)) - : base(id, name, type) + public Run(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string runId = default(string), string status = default(string), System.DateTime? lastUpdatedTime = default(System.DateTime?), string runType = default(string), string agentPoolName = default(string), System.DateTime? createTime = default(System.DateTime?), System.DateTime? startTime = default(System.DateTime?), System.DateTime? finishTime = default(System.DateTime?), IList outputImages = default(IList), string task = default(string), ImageUpdateTrigger imageUpdateTrigger = default(ImageUpdateTrigger), SourceTriggerDescriptor sourceTrigger = default(SourceTriggerDescriptor), TimerTriggerDescriptor timerTrigger = default(TimerTriggerDescriptor), PlatformProperties platform = default(PlatformProperties), AgentProperties agentConfiguration = default(AgentProperties), string sourceRegistryAuth = default(string), IList customRegistries = default(IList), string runErrorMessage = default(string), string updateTriggerToken = default(string), ImageDescriptor logArtifact = default(ImageDescriptor), string provisioningState = default(string), bool? isArchiveEnabled = default(bool?)) + : base(id, name, type, systemData) { RunId = runId; Status = status; @@ -101,6 +105,7 @@ public Run() CustomRegistries = customRegistries; RunErrorMessage = runErrorMessage; UpdateTriggerToken = updateTriggerToken; + LogArtifact = logArtifact; ProvisioningState = provisioningState; IsArchiveEnabled = isArchiveEnabled; CustomInit(); @@ -235,6 +240,12 @@ public Run() [JsonProperty(PropertyName = "properties.updateTriggerToken")] public string UpdateTriggerToken { get; set; } + /// + /// Gets the image description for the log artifact. + /// + [JsonProperty(PropertyName = "properties.logArtifact")] + public ImageDescriptor LogArtifact { get; private set; } + /// /// Gets or sets the provisioning state of a run. Possible values /// include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/RunRequest.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/RunRequest.cs index 8051516beb11..243c5c39b2a1 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/RunRequest.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/RunRequest.cs @@ -33,10 +33,13 @@ public RunRequest() /// archiving is enabled for the run or not. /// The dedicated agent pool for the /// run. - public RunRequest(bool? isArchiveEnabled = default(bool?), string agentPoolName = default(string)) + /// The template that describes the + /// repository and tag information for run log artifact. + public RunRequest(bool? isArchiveEnabled = default(bool?), string agentPoolName = default(string), string logTemplate = default(string)) { IsArchiveEnabled = isArchiveEnabled; AgentPoolName = agentPoolName; + LogTemplate = logTemplate; CustomInit(); } @@ -58,5 +61,12 @@ public RunRequest() [JsonProperty(PropertyName = "agentPoolName")] public string AgentPoolName { get; set; } + /// + /// Gets or sets the template that describes the repository and tag + /// information for run log artifact. + /// + [JsonProperty(PropertyName = "logTemplate")] + public string LogTemplate { get; set; } + } } diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ScopeMap.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ScopeMap.cs deleted file mode 100644 index 1e361dca433d..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ScopeMap.cs +++ /dev/null @@ -1,116 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.ContainerRegistry.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// An object that represents a scope map for a container registry. - /// - [Rest.Serialization.JsonTransformation] - public partial class ScopeMap : ProxyResource - { - /// - /// Initializes a new instance of the ScopeMap class. - /// - public ScopeMap() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ScopeMap class. - /// - /// The list of scoped permissions for registry - /// artifacts. - /// E.g. repositories/repository-name/content/read, - /// repositories/repository-name/metadata/write - /// The resource ID. - /// The name of the resource. - /// The type of the resource. - /// The user friendly description of the - /// scope map. - /// The type of the scope map. E.g. BuildIn - /// scope map. - /// The creation date of scope map. - /// Provisioning state of the resource. - /// Possible values include: 'Creating', 'Updating', 'Deleting', - /// 'Succeeded', 'Failed', 'Canceled' - public ScopeMap(IList actions, string id = default(string), string name = default(string), string type = default(string), string description = default(string), string scopeMapType = default(string), System.DateTime? creationDate = default(System.DateTime?), string provisioningState = default(string)) - : base(id, name, type) - { - Description = description; - ScopeMapType = scopeMapType; - CreationDate = creationDate; - ProvisioningState = provisioningState; - Actions = actions; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the user friendly description of the scope map. - /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } - - /// - /// Gets the type of the scope map. E.g. BuildIn scope map. - /// - [JsonProperty(PropertyName = "properties.type")] - public string ScopeMapType { get; private set; } - - /// - /// Gets the creation date of scope map. - /// - [JsonProperty(PropertyName = "properties.creationDate")] - public System.DateTime? CreationDate { get; private set; } - - /// - /// Gets provisioning state of the resource. Possible values include: - /// 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', - /// 'Canceled' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } - - /// - /// Gets or sets the list of scoped permissions for registry artifacts. - /// E.g. repositories/repository-name/content/read, - /// repositories/repository-name/metadata/write - /// - [JsonProperty(PropertyName = "properties.actions")] - public IList Actions { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Actions == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Actions"); - } - } - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ScopeMapUpdateParameters.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ScopeMapUpdateParameters.cs deleted file mode 100644 index da1b18ca66b1..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ScopeMapUpdateParameters.cs +++ /dev/null @@ -1,70 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.ContainerRegistry.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The properties for updating the scope map. - /// - [Rest.Serialization.JsonTransformation] - public partial class ScopeMapUpdateParameters - { - /// - /// Initializes a new instance of the ScopeMapUpdateParameters class. - /// - public ScopeMapUpdateParameters() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ScopeMapUpdateParameters class. - /// - /// The user friendly description of the - /// scope map. - /// The list of scope permissions for registry - /// artifacts. - /// E.g. repositories/repository-name/pull, - /// repositories/repository-name/delete - public ScopeMapUpdateParameters(string description = default(string), IList actions = default(IList)) - { - Description = description; - Actions = actions; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the user friendly description of the scope map. - /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } - - /// - /// Gets or sets the list of scope permissions for registry artifacts. - /// E.g. repositories/repository-name/pull, - /// repositories/repository-name/delete - /// - [JsonProperty(PropertyName = "properties.actions")] - public IList Actions { get; set; } - - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/SourceTrigger.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/SourceTrigger.cs index 474f4051e7c9..f484086dd36e 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/SourceTrigger.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/SourceTrigger.cs @@ -38,7 +38,7 @@ public SourceTrigger() /// the trigger. /// The name of the trigger. /// The current status of trigger. Possible values - /// include: 'Enabled', 'Disabled' + /// include: 'Disabled', 'Enabled' public SourceTrigger(SourceProperties sourceRepository, IList sourceTriggerEvents, string name, string status = default(string)) { SourceRepository = sourceRepository; @@ -68,7 +68,7 @@ public SourceTrigger() /// /// Gets or sets the current status of trigger. Possible values - /// include: 'Enabled', 'Disabled' + /// include: 'Disabled', 'Enabled' /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/SourceTriggerUpdateParameters.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/SourceTriggerUpdateParameters.cs index 2f337f040550..a393cb88ff6f 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/SourceTriggerUpdateParameters.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/SourceTriggerUpdateParameters.cs @@ -40,7 +40,7 @@ public SourceTriggerUpdateParameters() /// The source event corresponding to /// the trigger. /// The current status of trigger. Possible values - /// include: 'Enabled', 'Disabled' + /// include: 'Disabled', 'Enabled' public SourceTriggerUpdateParameters(string name, SourceUpdateParameters sourceRepository = default(SourceUpdateParameters), IList sourceTriggerEvents = default(IList), string status = default(string)) { SourceRepository = sourceRepository; @@ -70,7 +70,7 @@ public SourceTriggerUpdateParameters() /// /// Gets or sets the current status of trigger. Possible values - /// include: 'Enabled', 'Disabled' + /// include: 'Disabled', 'Enabled' /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/SystemData.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/SystemData.cs new file mode 100644 index 000000000000..31a7e8d16c68 --- /dev/null +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/SystemData.cs @@ -0,0 +1,103 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.ContainerRegistry.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Metadata pertaining to creation and last modification of the resource. + /// + public partial class SystemData + { + /// + /// Initializes a new instance of the SystemData class. + /// + public SystemData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SystemData class. + /// + /// The identity that created the + /// resource. + /// The type of identity that created the + /// resource. Possible values include: 'User', 'Application', + /// 'ManagedIdentity', 'Key' + /// The timestamp of resource creation + /// (UTC). + /// The identity that last modified the + /// resource. + /// The type of identity that last + /// modified the resource. Possible values include: 'User', + /// 'Application', 'ManagedIdentity', 'Key' + /// The timestamp of resource modification + /// (UTC). + public SystemData(string createdBy = default(string), string createdByType = default(string), System.DateTime? createdAt = default(System.DateTime?), string lastModifiedBy = default(string), string lastModifiedByType = default(string), System.DateTime? lastModifiedAt = default(System.DateTime?)) + { + CreatedBy = createdBy; + CreatedByType = createdByType; + CreatedAt = createdAt; + LastModifiedBy = lastModifiedBy; + LastModifiedByType = lastModifiedByType; + LastModifiedAt = lastModifiedAt; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the identity that created the resource. + /// + [JsonProperty(PropertyName = "createdBy")] + public string CreatedBy { get; set; } + + /// + /// Gets or sets the type of identity that created the resource. + /// Possible values include: 'User', 'Application', 'ManagedIdentity', + /// 'Key' + /// + [JsonProperty(PropertyName = "createdByType")] + public string CreatedByType { get; set; } + + /// + /// Gets or sets the timestamp of resource creation (UTC). + /// + [JsonProperty(PropertyName = "createdAt")] + public System.DateTime? CreatedAt { get; set; } + + /// + /// Gets or sets the identity that last modified the resource. + /// + [JsonProperty(PropertyName = "lastModifiedBy")] + public string LastModifiedBy { get; set; } + + /// + /// Gets or sets the type of identity that last modified the resource. + /// Possible values include: 'User', 'Application', 'ManagedIdentity', + /// 'Key' + /// + [JsonProperty(PropertyName = "lastModifiedByType")] + public string LastModifiedByType { get; set; } + + /// + /// Gets or sets the timestamp of resource modification (UTC). + /// + [JsonProperty(PropertyName = "lastModifiedAt")] + public System.DateTime? LastModifiedAt { get; set; } + + } +} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Task.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Task.cs index 71b894648dd5..994810923220 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Task.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Task.cs @@ -37,13 +37,12 @@ public Task() /// /// The location of the resource. This cannot be /// changed after the resource is created. - /// The platform properties against which the - /// run has to happen. - /// The properties of a task step. /// The resource ID. /// The name of the resource. /// The type of the resource. /// The tags of the resource. + /// Metadata pertaining to creation and last + /// modification of the resource. /// Identity for the resource. /// The provisioning state of the task. /// Possible values include: 'Creating', 'Updating', 'Deleting', @@ -51,17 +50,24 @@ public Task() /// The creation date of task. /// The current status of task. Possible values /// include: 'Disabled', 'Enabled' + /// The platform properties against which the + /// run has to happen. /// The machine configuration of the /// run agent. /// The dedicated agent pool for the /// task. /// Run timeout in seconds. + /// The properties of a task step. /// The properties that describe all triggers for /// the task. /// The properties that describes a set of /// credentials that will be used when this run is invoked. - public Task(string location, PlatformProperties platform, TaskStepProperties step, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), IdentityProperties identity = default(IdentityProperties), string provisioningState = default(string), System.DateTime? creationDate = default(System.DateTime?), string status = default(string), AgentProperties agentConfiguration = default(AgentProperties), string agentPoolName = default(string), int? timeout = default(int?), TriggerProperties trigger = default(TriggerProperties), Credentials credentials = default(Credentials)) - : base(location, id, name, type, tags) + /// The template that describes the + /// repository and tag information for run log artifact. + /// The value of this property indicates + /// whether the task resource is system task or not. + public Task(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), SystemData systemData = default(SystemData), IdentityProperties identity = default(IdentityProperties), string provisioningState = default(string), System.DateTime? creationDate = default(System.DateTime?), string status = default(string), PlatformProperties platform = default(PlatformProperties), AgentProperties agentConfiguration = default(AgentProperties), string agentPoolName = default(string), int? timeout = default(int?), TaskStepProperties step = default(TaskStepProperties), TriggerProperties trigger = default(TriggerProperties), Credentials credentials = default(Credentials), string logTemplate = default(string), bool? isSystemTask = default(bool?)) + : base(location, id, name, type, tags, systemData) { Identity = identity; ProvisioningState = provisioningState; @@ -74,6 +80,8 @@ public Task() Step = step; Trigger = trigger; Credentials = credentials; + LogTemplate = logTemplate; + IsSystemTask = isSystemTask; CustomInit(); } @@ -154,6 +162,20 @@ public Task() [JsonProperty(PropertyName = "properties.credentials")] public Credentials Credentials { get; set; } + /// + /// Gets or sets the template that describes the repository and tag + /// information for run log artifact. + /// + [JsonProperty(PropertyName = "properties.logTemplate")] + public string LogTemplate { get; set; } + + /// + /// Gets or sets the value of this property indicates whether the task + /// resource is system task or not. + /// + [JsonProperty(PropertyName = "properties.isSystemTask")] + public bool? IsSystemTask { get; set; } + /// /// Validate the object. /// @@ -163,14 +185,6 @@ public Task() public override void Validate() { base.Validate(); - if (Platform == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Platform"); - } - if (Step == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Step"); - } if (Platform != null) { Platform.Validate(); diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TaskRun.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TaskRun.cs index 8a5fc76b53e8..b0c56d0f972a 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TaskRun.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TaskRun.cs @@ -13,8 +13,6 @@ namespace Microsoft.Azure.Management.ContainerRegistry.Models using Microsoft.Rest; using Microsoft.Rest.Serialization; using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -22,7 +20,7 @@ namespace Microsoft.Azure.Management.ContainerRegistry.Models /// The task run will have the information of request and result of a run. /// [Rest.Serialization.JsonTransformation] - public partial class TaskRun : Resource + public partial class TaskRun : ProxyResource { /// /// Initializes a new instance of the TaskRun class. @@ -35,12 +33,11 @@ public TaskRun() /// /// Initializes a new instance of the TaskRun class. /// - /// The location of the resource. This cannot be - /// changed after the resource is created. /// The resource ID. /// The name of the resource. /// The type of the resource. - /// The tags of the resource. + /// Metadata pertaining to creation and last + /// modification of the resource. /// Identity for the resource. /// The provisioning state of this task /// run. Possible values include: 'Creating', 'Updating', 'Deleting', @@ -50,14 +47,16 @@ public TaskRun() /// The result of this task run /// How the run should be forced to rerun /// even if the run request configuration has not changed - public TaskRun(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), IdentityProperties identity = default(IdentityProperties), string provisioningState = default(string), RunRequest runRequest = default(RunRequest), Run runResult = default(Run), string forceUpdateTag = default(string)) - : base(location, id, name, type, tags) + /// The location of the resource + public TaskRun(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), IdentityProperties identity = default(IdentityProperties), string provisioningState = default(string), RunRequest runRequest = default(RunRequest), Run runResult = default(Run), string forceUpdateTag = default(string), string location = default(string)) + : base(id, name, type, systemData) { Identity = identity; ProvisioningState = provisioningState; RunRequest = runRequest; RunResult = runResult; ForceUpdateTag = forceUpdateTag; + Location = location; CustomInit(); } @@ -99,15 +98,20 @@ public TaskRun() [JsonProperty(PropertyName = "properties.forceUpdateTag")] public string ForceUpdateTag { get; set; } + /// + /// Gets or sets the location of the resource + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + /// /// Validate the object. /// /// /// Thrown if validation fails /// - public override void Validate() + public virtual void Validate() { - base.Validate(); if (RunResult != null) { RunResult.Validate(); diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TaskRunRequest.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TaskRunRequest.cs index b73584fb8945..5485e038c367 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TaskRunRequest.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TaskRunRequest.cs @@ -36,10 +36,12 @@ public TaskRunRequest() /// archiving is enabled for the run or not. /// The dedicated agent pool for the /// run. + /// The template that describes the + /// repository and tag information for run log artifact. /// Set of overridable /// parameters that can be passed when running a Task. - public TaskRunRequest(string taskId, bool? isArchiveEnabled = default(bool?), string agentPoolName = default(string), OverrideTaskStepProperties overrideTaskStepProperties = default(OverrideTaskStepProperties)) - : base(isArchiveEnabled, agentPoolName) + public TaskRunRequest(string taskId, bool? isArchiveEnabled = default(bool?), string agentPoolName = default(string), string logTemplate = default(string), OverrideTaskStepProperties overrideTaskStepProperties = default(OverrideTaskStepProperties)) + : base(isArchiveEnabled, agentPoolName, logTemplate) { TaskId = taskId; OverrideTaskStepProperties = overrideTaskStepProperties; diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TaskRunUpdateParameters.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TaskRunUpdateParameters.cs index 82dc85f41db3..b8cfef8aa6c5 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TaskRunUpdateParameters.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TaskRunUpdateParameters.cs @@ -39,12 +39,14 @@ public TaskRunUpdateParameters() /// run /// How the run should be forced to rerun /// even if the run request configuration has not changed + /// The location of the resource /// The ARM resource tags. - public TaskRunUpdateParameters(IdentityProperties identity = default(IdentityProperties), RunRequest runRequest = default(RunRequest), string forceUpdateTag = default(string), IDictionary tags = default(IDictionary)) + public TaskRunUpdateParameters(IdentityProperties identity = default(IdentityProperties), RunRequest runRequest = default(RunRequest), string forceUpdateTag = default(string), string location = default(string), IDictionary tags = default(IDictionary)) { Identity = identity; RunRequest = runRequest; ForceUpdateTag = forceUpdateTag; + Location = location; Tags = tags; CustomInit(); } @@ -73,6 +75,12 @@ public TaskRunUpdateParameters() [JsonProperty(PropertyName = "properties.forceUpdateTag")] public string ForceUpdateTag { get; set; } + /// + /// Gets or sets the location of the resource + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + /// /// Gets or sets the ARM resource tags. /// diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TaskUpdateParameters.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TaskUpdateParameters.cs index 4fd793ec4095..21770ffa1a04 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TaskUpdateParameters.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TaskUpdateParameters.cs @@ -49,8 +49,10 @@ public TaskUpdateParameters() /// properties. /// The parameters that describes a set of /// credentials that will be used when this run is invoked. + /// The template that describes the + /// repository and tag information for run log artifact. /// The ARM resource tags. - public TaskUpdateParameters(IdentityProperties identity = default(IdentityProperties), string status = default(string), PlatformUpdateParameters platform = default(PlatformUpdateParameters), AgentProperties agentConfiguration = default(AgentProperties), string agentPoolName = default(string), int? timeout = default(int?), TaskStepUpdateParameters step = default(TaskStepUpdateParameters), TriggerUpdateParameters trigger = default(TriggerUpdateParameters), Credentials credentials = default(Credentials), IDictionary tags = default(IDictionary)) + public TaskUpdateParameters(IdentityProperties identity = default(IdentityProperties), string status = default(string), PlatformUpdateParameters platform = default(PlatformUpdateParameters), AgentProperties agentConfiguration = default(AgentProperties), string agentPoolName = default(string), int? timeout = default(int?), TaskStepUpdateParameters step = default(TaskStepUpdateParameters), TriggerUpdateParameters trigger = default(TriggerUpdateParameters), Credentials credentials = default(Credentials), string logTemplate = default(string), IDictionary tags = default(IDictionary)) { Identity = identity; Status = status; @@ -61,6 +63,7 @@ public TaskUpdateParameters() Step = step; Trigger = trigger; Credentials = credentials; + LogTemplate = logTemplate; Tags = tags; CustomInit(); } @@ -127,6 +130,13 @@ public TaskUpdateParameters() [JsonProperty(PropertyName = "properties.credentials")] public Credentials Credentials { get; set; } + /// + /// Gets or sets the template that describes the repository and tag + /// information for run log artifact. + /// + [JsonProperty(PropertyName = "properties.logTemplate")] + public string LogTemplate { get; set; } + /// /// Gets or sets the ARM resource tags. /// diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TimerTrigger.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TimerTrigger.cs index 67bb8fbe7d2e..5eccfcf912e4 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TimerTrigger.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TimerTrigger.cs @@ -34,7 +34,7 @@ public TimerTrigger() /// schedule /// The name of the trigger. /// The current status of trigger. Possible values - /// include: 'Enabled', 'Disabled' + /// include: 'Disabled', 'Enabled' public TimerTrigger(string schedule, string name, string status = default(string)) { Schedule = schedule; @@ -56,7 +56,7 @@ public TimerTrigger() /// /// Gets or sets the current status of trigger. Possible values - /// include: 'Enabled', 'Disabled' + /// include: 'Disabled', 'Enabled' /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TimerTriggerUpdateParameters.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TimerTriggerUpdateParameters.cs index 19d112045f76..9cbef21bd7b6 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TimerTriggerUpdateParameters.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TimerTriggerUpdateParameters.cs @@ -36,7 +36,7 @@ public TimerTriggerUpdateParameters() /// The CRON expression for the task /// schedule /// The current status of trigger. Possible values - /// include: 'Enabled', 'Disabled' + /// include: 'Disabled', 'Enabled' public TimerTriggerUpdateParameters(string name, string schedule = default(string), string status = default(string)) { Schedule = schedule; @@ -58,7 +58,7 @@ public TimerTriggerUpdateParameters() /// /// Gets or sets the current status of trigger. Possible values - /// include: 'Enabled', 'Disabled' + /// include: 'Disabled', 'Enabled' /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Token.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Token.cs deleted file mode 100644 index 2074653ee882..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Token.cs +++ /dev/null @@ -1,100 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.ContainerRegistry.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// An object that represents a token for a container registry. - /// - [Rest.Serialization.JsonTransformation] - public partial class Token : ProxyResource - { - /// - /// Initializes a new instance of the Token class. - /// - public Token() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Token class. - /// - /// The resource ID. - /// The name of the resource. - /// The type of the resource. - /// The creation date of scope map. - /// Provisioning state of the resource. - /// Possible values include: 'Creating', 'Updating', 'Deleting', - /// 'Succeeded', 'Failed', 'Canceled' - /// The resource ID of the scope map to which - /// the token will be associated with. - /// The credentials that can be used for - /// authenticating the token. - /// The status of the token example enabled or - /// disabled. Possible values include: 'enabled', 'disabled' - public Token(string id = default(string), string name = default(string), string type = default(string), System.DateTime? creationDate = default(System.DateTime?), string provisioningState = default(string), string scopeMapId = default(string), TokenCredentialsProperties credentials = default(TokenCredentialsProperties), string status = default(string)) - : base(id, name, type) - { - CreationDate = creationDate; - ProvisioningState = provisioningState; - ScopeMapId = scopeMapId; - Credentials = credentials; - Status = status; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the creation date of scope map. - /// - [JsonProperty(PropertyName = "properties.creationDate")] - public System.DateTime? CreationDate { get; private set; } - - /// - /// Gets provisioning state of the resource. Possible values include: - /// 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', - /// 'Canceled' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } - - /// - /// Gets or sets the resource ID of the scope map to which the token - /// will be associated with. - /// - [JsonProperty(PropertyName = "properties.scopeMapId")] - public string ScopeMapId { get; set; } - - /// - /// Gets or sets the credentials that can be used for authenticating - /// the token. - /// - [JsonProperty(PropertyName = "properties.credentials")] - public TokenCredentialsProperties Credentials { get; set; } - - /// - /// Gets or sets the status of the token example enabled or disabled. - /// Possible values include: 'enabled', 'disabled' - /// - [JsonProperty(PropertyName = "properties.status")] - public string Status { get; set; } - - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenCertificate.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenCertificate.cs deleted file mode 100644 index 58d68a397323..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenCertificate.cs +++ /dev/null @@ -1,81 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.ContainerRegistry.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// The properties of a certificate used for authenticating a token. - /// - public partial class TokenCertificate - { - /// - /// Initializes a new instance of the TokenCertificate class. - /// - public TokenCertificate() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the TokenCertificate class. - /// - /// Possible values include: 'certificate1', - /// 'certificate2' - /// The expiry datetime of the - /// certificate. - /// The thumbprint of the certificate. - /// Base 64 encoded string of the - /// public certificate1 in PEM format that will be used for - /// authenticating the token. - public TokenCertificate(string name = default(string), System.DateTime? expiry = default(System.DateTime?), string thumbprint = default(string), string encodedPemCertificate = default(string)) - { - Name = name; - Expiry = expiry; - Thumbprint = thumbprint; - EncodedPemCertificate = encodedPemCertificate; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets possible values include: 'certificate1', - /// 'certificate2' - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets the expiry datetime of the certificate. - /// - [JsonProperty(PropertyName = "expiry")] - public System.DateTime? Expiry { get; set; } - - /// - /// Gets or sets the thumbprint of the certificate. - /// - [JsonProperty(PropertyName = "thumbprint")] - public string Thumbprint { get; set; } - - /// - /// Gets or sets base 64 encoded string of the public certificate1 in - /// PEM format that will be used for authenticating the token. - /// - [JsonProperty(PropertyName = "encodedPemCertificate")] - public string EncodedPemCertificate { get; set; } - - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenCredentialsProperties.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenCredentialsProperties.cs deleted file mode 100644 index e3b5d93e14a8..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenCredentialsProperties.cs +++ /dev/null @@ -1,64 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.ContainerRegistry.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The properties of the credentials that can be used for authenticating - /// the token. - /// - public partial class TokenCredentialsProperties - { - /// - /// Initializes a new instance of the TokenCredentialsProperties class. - /// - public TokenCredentialsProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the TokenCredentialsProperties class. - /// - public TokenCredentialsProperties(ActiveDirectoryObject activeDirectoryObject = default(ActiveDirectoryObject), IList certificates = default(IList), IList passwords = default(IList)) - { - ActiveDirectoryObject = activeDirectoryObject; - Certificates = certificates; - Passwords = passwords; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "activeDirectoryObject")] - public ActiveDirectoryObject ActiveDirectoryObject { get; set; } - - /// - /// - [JsonProperty(PropertyName = "certificates")] - public IList Certificates { get; set; } - - /// - /// - [JsonProperty(PropertyName = "passwords")] - public IList Passwords { get; set; } - - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenPassword.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenPassword.cs deleted file mode 100644 index 55d2d276f1f8..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenPassword.cs +++ /dev/null @@ -1,79 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.ContainerRegistry.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// The password that will be used for authenticating the token of a - /// container registry. - /// - public partial class TokenPassword - { - /// - /// Initializes a new instance of the TokenPassword class. - /// - public TokenPassword() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the TokenPassword class. - /// - /// The creation datetime of the - /// password. - /// The expiry datetime of the password. - /// The password name "password1" or "password2". - /// Possible values include: 'password1', 'password2' - /// The password value. - public TokenPassword(System.DateTime? creationTime = default(System.DateTime?), System.DateTime? expiry = default(System.DateTime?), string name = default(string), string value = default(string)) - { - CreationTime = creationTime; - Expiry = expiry; - Name = name; - Value = value; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the creation datetime of the password. - /// - [JsonProperty(PropertyName = "creationTime")] - public System.DateTime? CreationTime { get; set; } - - /// - /// Gets or sets the expiry datetime of the password. - /// - [JsonProperty(PropertyName = "expiry")] - public System.DateTime? Expiry { get; set; } - - /// - /// Gets or sets the password name "password1" or "password2". Possible - /// values include: 'password1', 'password2' - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets the password value. - /// - [JsonProperty(PropertyName = "value")] - public string Value { get; private set; } - - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenUpdateParameters.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenUpdateParameters.cs deleted file mode 100644 index d79f50445396..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenUpdateParameters.cs +++ /dev/null @@ -1,76 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.ContainerRegistry.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// The parameters for updating a token. - /// - [Rest.Serialization.JsonTransformation] - public partial class TokenUpdateParameters - { - /// - /// Initializes a new instance of the TokenUpdateParameters class. - /// - public TokenUpdateParameters() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the TokenUpdateParameters class. - /// - /// The resource ID of the scope map to which - /// the token will be associated with. - /// The status of the token example enabled or - /// disabled. Possible values include: 'enabled', 'disabled' - /// The credentials that can be used for - /// authenticating the token. - public TokenUpdateParameters(string scopeMapId = default(string), string status = default(string), TokenCredentialsProperties credentials = default(TokenCredentialsProperties)) - { - ScopeMapId = scopeMapId; - Status = status; - Credentials = credentials; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the resource ID of the scope map to which the token - /// will be associated with. - /// - [JsonProperty(PropertyName = "properties.scopeMapId")] - public string ScopeMapId { get; set; } - - /// - /// Gets or sets the status of the token example enabled or disabled. - /// Possible values include: 'enabled', 'disabled' - /// - [JsonProperty(PropertyName = "properties.status")] - public string Status { get; set; } - - /// - /// Gets or sets the credentials that can be used for authenticating - /// the token. - /// - [JsonProperty(PropertyName = "properties.credentials")] - public TokenCredentialsProperties Credentials { get; set; } - - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TriggerStatus.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TriggerStatus.cs index 171f02814b0d..067d64b49005 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TriggerStatus.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TriggerStatus.cs @@ -16,7 +16,7 @@ namespace Microsoft.Azure.Management.ContainerRegistry.Models /// public static class TriggerStatus { - public const string Enabled = "Enabled"; public const string Disabled = "Disabled"; + public const string Enabled = "Enabled"; } } diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/VirtualNetworkRule.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/VirtualNetworkRule.cs deleted file mode 100644 index e49f825ac68d..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/VirtualNetworkRule.cs +++ /dev/null @@ -1,78 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.ContainerRegistry.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Virtual network rule. - /// - public partial class VirtualNetworkRule - { - /// - /// Initializes a new instance of the VirtualNetworkRule class. - /// - public VirtualNetworkRule() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the VirtualNetworkRule class. - /// - /// Resource ID of a subnet, for - /// example: - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. - /// The action of virtual network rule. Possible - /// values include: 'Allow' - public VirtualNetworkRule(string virtualNetworkResourceId, string action = default(string)) - { - Action = action; - VirtualNetworkResourceId = virtualNetworkResourceId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the action of virtual network rule. Possible values - /// include: 'Allow' - /// - [JsonProperty(PropertyName = "action")] - public string Action { get; set; } - - /// - /// Gets or sets resource ID of a subnet, for example: - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. - /// - [JsonProperty(PropertyName = "id")] - public string VirtualNetworkResourceId { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (VirtualNetworkResourceId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "VirtualNetworkResourceId"); - } - } - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Webhook.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Webhook.cs index 4d4b1278c712..16481626eae7 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Webhook.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Webhook.cs @@ -42,6 +42,8 @@ public Webhook() /// The name of the resource. /// The type of the resource. /// The tags of the resource. + /// Metadata pertaining to creation and last + /// modification of the resource. /// The status of the webhook at the time the /// operation was called. Possible values include: 'enabled', /// 'disabled' @@ -53,8 +55,8 @@ public Webhook() /// webhook at the time the operation was called. Possible values /// include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', /// 'Canceled' - public Webhook(string location, IList actions, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string status = default(string), string scope = default(string), string provisioningState = default(string)) - : base(location, id, name, type, tags) + public Webhook(string location, IList actions, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), SystemData systemData = default(SystemData), string status = default(string), string scope = default(string), string provisioningState = default(string)) + : base(location, id, name, type, tags, systemData) { Status = status; Scope = scope; diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PipelineRunSourceType.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ZoneRedundancy.cs similarity index 72% rename from sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PipelineRunSourceType.cs rename to sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ZoneRedundancy.cs index ea27aeb95f3f..a6679ec65785 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PipelineRunSourceType.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ZoneRedundancy.cs @@ -12,10 +12,11 @@ namespace Microsoft.Azure.Management.ContainerRegistry.Models { /// - /// Defines values for PipelineRunSourceType. + /// Defines values for ZoneRedundancy. /// - public static class PipelineRunSourceType + public static class ZoneRedundancy { - public const string AzureStorageBlob = "AzureStorageBlob"; + public const string Enabled = "Enabled"; + public const string Disabled = "Disabled"; } } diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Operations.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Operations.cs index caa4c24149c7..772f7c18c8fa 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Operations.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Operations.cs @@ -69,7 +69,7 @@ internal Operations(ContainerRegistryManagementClient client) /// public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - string apiVersion = "2019-12-01-preview"; + string apiVersion = "2021-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/PipelineRunsOperations.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/PipelineRunsOperations.cs deleted file mode 100644 index 7fb9b25bb4fb..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/PipelineRunsOperations.cs +++ /dev/null @@ -1,1238 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.ContainerRegistry -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - - /// - /// PipelineRunsOperations operations. - /// - internal partial class PipelineRunsOperations : IServiceOperations, IPipelineRunsOperations - { - /// - /// Initializes a new instance of the PipelineRunsOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal PipelineRunsOperations(ContainerRegistryManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the ContainerRegistryManagementClient - /// - public ContainerRegistryManagementClient Client { get; private set; } - - /// - /// Gets the detailed information for a given pipeline run. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the pipeline run. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string registryName, string pipelineRunName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - } - if (registryName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "registryName"); - } - if (registryName != null) - { - if (registryName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "registryName", 50); - } - if (registryName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "registryName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(registryName, "^[a-zA-Z0-9]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); - } - } - if (pipelineRunName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "pipelineRunName"); - } - if (pipelineRunName != null) - { - if (pipelineRunName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "pipelineRunName", 50); - } - if (pipelineRunName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "pipelineRunName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(pipelineRunName, "^[a-zA-Z0-9]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "pipelineRunName", "^[a-zA-Z0-9]*$"); - } - } - string apiVersion = "2019-12-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("registryName", registryName); - tracingParameters.Add("pipelineRunName", pipelineRunName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); - _url = _url.Replace("{pipelineRunName}", System.Uri.EscapeDataString(pipelineRunName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Creates a pipeline run for a container registry with the specified - /// parameters - /// - /// - /// 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 request parameters for a pipeline run. - /// - /// - /// How the pipeline run should be forced to recreate even if the pipeline run - /// configuration has not changed. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string registryName, string pipelineRunName, PipelineRunRequest request = default(PipelineRunRequest), string forceUpdateTag = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, registryName, pipelineRunName, request, forceUpdateTag, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes a pipeline run from a container registry. - /// - /// - /// 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 headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string pipelineRunName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, registryName, pipelineRunName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Lists all the pipeline runs for the specified container registry. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - } - if (registryName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "registryName"); - } - if (registryName != null) - { - if (registryName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "registryName", 50); - } - if (registryName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "registryName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(registryName, "^[a-zA-Z0-9]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); - } - } - string apiVersion = "2019-12-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("registryName", registryName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Creates a pipeline run for a container registry with the specified - /// parameters - /// - /// - /// 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 request parameters for a pipeline run. - /// - /// - /// How the pipeline run should be forced to recreate even if the pipeline run - /// configuration has not changed. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string registryName, string pipelineRunName, PipelineRunRequest request = default(PipelineRunRequest), string forceUpdateTag = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - } - if (registryName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "registryName"); - } - if (registryName != null) - { - if (registryName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "registryName", 50); - } - if (registryName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "registryName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(registryName, "^[a-zA-Z0-9]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); - } - } - if (pipelineRunName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "pipelineRunName"); - } - if (pipelineRunName != null) - { - if (pipelineRunName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "pipelineRunName", 50); - } - if (pipelineRunName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "pipelineRunName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(pipelineRunName, "^[a-zA-Z0-9]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "pipelineRunName", "^[a-zA-Z0-9]*$"); - } - } - string apiVersion = "2019-12-01-preview"; - PipelineRun pipelineRunCreateParameters = new PipelineRun(); - if (request != null || forceUpdateTag != null) - { - pipelineRunCreateParameters.Request = request; - pipelineRunCreateParameters.ForceUpdateTag = forceUpdateTag; - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("registryName", registryName); - tracingParameters.Add("pipelineRunName", pipelineRunName); - tracingParameters.Add("pipelineRunCreateParameters", pipelineRunCreateParameters); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); - _url = _url.Replace("{pipelineRunName}", System.Uri.EscapeDataString(pipelineRunName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(pipelineRunCreateParameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(pipelineRunCreateParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Deletes a pipeline run from a container registry. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the pipeline run. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string pipelineRunName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - } - if (registryName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "registryName"); - } - if (registryName != null) - { - if (registryName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "registryName", 50); - } - if (registryName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "registryName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(registryName, "^[a-zA-Z0-9]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); - } - } - if (pipelineRunName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "pipelineRunName"); - } - if (pipelineRunName != null) - { - if (pipelineRunName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "pipelineRunName", 50); - } - if (pipelineRunName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "pipelineRunName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(pipelineRunName, "^[a-zA-Z0-9]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "pipelineRunName", "^[a-zA-Z0-9]*$"); - } - } - string apiVersion = "2019-12-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("registryName", registryName); - tracingParameters.Add("pipelineRunName", pipelineRunName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/pipelineRuns/{pipelineRunName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); - _url = _url.Replace("{pipelineRunName}", System.Uri.EscapeDataString(pipelineRunName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Lists all the pipeline runs for the specified container registry. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (nextPageLink == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/PipelineRunsOperationsExtensions.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/PipelineRunsOperationsExtensions.cs deleted file mode 100644 index 09994f228e56..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/PipelineRunsOperationsExtensions.cs +++ /dev/null @@ -1,354 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.ContainerRegistry -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - - /// - /// Extension methods for PipelineRunsOperations. - /// - public static partial class PipelineRunsOperationsExtensions - { - /// - /// Gets the detailed information for a given pipeline run. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the pipeline run. - /// - public static PipelineRun Get(this IPipelineRunsOperations operations, string resourceGroupName, string registryName, string pipelineRunName) - { - return operations.GetAsync(resourceGroupName, registryName, pipelineRunName).GetAwaiter().GetResult(); - } - - /// - /// Gets the detailed information for a given pipeline run. - /// - /// - /// The operations group for this extension method. - /// - /// - /// 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. - /// - public static async System.Threading.Tasks.Task GetAsync(this IPipelineRunsOperations operations, string resourceGroupName, string registryName, string pipelineRunName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, registryName, pipelineRunName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates a pipeline run for a container registry with the specified - /// parameters - /// - /// - /// The operations group for this extension method. - /// - /// - /// 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 request parameters for a pipeline run. - /// - /// - /// How the pipeline run should be forced to recreate even if the pipeline run - /// configuration has not changed. - /// - public static PipelineRun Create(this IPipelineRunsOperations operations, string resourceGroupName, string registryName, string pipelineRunName, PipelineRunRequest request = default(PipelineRunRequest), string forceUpdateTag = default(string)) - { - return operations.CreateAsync(resourceGroupName, registryName, pipelineRunName, request, forceUpdateTag).GetAwaiter().GetResult(); - } - - /// - /// Creates a pipeline run for a container registry with the specified - /// parameters - /// - /// - /// The operations group for this extension method. - /// - /// - /// 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 request parameters for a pipeline run. - /// - /// - /// How the pipeline run should be forced to recreate even if the pipeline run - /// configuration has not changed. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task CreateAsync(this IPipelineRunsOperations operations, string resourceGroupName, string registryName, string pipelineRunName, PipelineRunRequest request = default(PipelineRunRequest), string forceUpdateTag = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, registryName, pipelineRunName, request, forceUpdateTag, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a pipeline run from a container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the pipeline run. - /// - public static void Delete(this IPipelineRunsOperations operations, string resourceGroupName, string registryName, string pipelineRunName) - { - operations.DeleteAsync(resourceGroupName, registryName, pipelineRunName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a pipeline run from a container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// 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. - /// - public static async System.Threading.Tasks.Task DeleteAsync(this IPipelineRunsOperations operations, string resourceGroupName, string registryName, string pipelineRunName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, registryName, pipelineRunName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Lists all the pipeline runs for the specified container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - public static IPage List(this IPipelineRunsOperations operations, string resourceGroupName, string registryName) - { - return operations.ListAsync(resourceGroupName, registryName).GetAwaiter().GetResult(); - } - - /// - /// Lists all the pipeline runs for the specified container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task> ListAsync(this IPipelineRunsOperations operations, string resourceGroupName, string registryName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, registryName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates a pipeline run for a container registry with the specified - /// parameters - /// - /// - /// The operations group for this extension method. - /// - /// - /// 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 request parameters for a pipeline run. - /// - /// - /// How the pipeline run should be forced to recreate even if the pipeline run - /// configuration has not changed. - /// - public static PipelineRun BeginCreate(this IPipelineRunsOperations operations, string resourceGroupName, string registryName, string pipelineRunName, PipelineRunRequest request = default(PipelineRunRequest), string forceUpdateTag = default(string)) - { - return operations.BeginCreateAsync(resourceGroupName, registryName, pipelineRunName, request, forceUpdateTag).GetAwaiter().GetResult(); - } - - /// - /// Creates a pipeline run for a container registry with the specified - /// parameters - /// - /// - /// The operations group for this extension method. - /// - /// - /// 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 request parameters for a pipeline run. - /// - /// - /// How the pipeline run should be forced to recreate even if the pipeline run - /// configuration has not changed. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task BeginCreateAsync(this IPipelineRunsOperations operations, string resourceGroupName, string registryName, string pipelineRunName, PipelineRunRequest request = default(PipelineRunRequest), string forceUpdateTag = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateWithHttpMessagesAsync(resourceGroupName, registryName, pipelineRunName, request, forceUpdateTag, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a pipeline run from a container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the pipeline run. - /// - public static void BeginDelete(this IPipelineRunsOperations operations, string resourceGroupName, string registryName, string pipelineRunName) - { - operations.BeginDeleteAsync(resourceGroupName, registryName, pipelineRunName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a pipeline run from a container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// 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. - /// - public static async System.Threading.Tasks.Task BeginDeleteAsync(this IPipelineRunsOperations operations, string resourceGroupName, string registryName, string pipelineRunName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, registryName, pipelineRunName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Lists all the pipeline runs for the specified container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IPipelineRunsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all the pipeline runs for the specified container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task> ListNextAsync(this IPipelineRunsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/PrivateEndpointConnectionsOperations.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/PrivateEndpointConnectionsOperations.cs index 588f7aea072d..924dcba5bc71 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/PrivateEndpointConnectionsOperations.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/PrivateEndpointConnectionsOperations.cs @@ -50,8 +50,7 @@ internal PrivateEndpointConnectionsOperations(ContainerRegistryManagementClient public ContainerRegistryManagementClient Client { get; private set; } /// - /// Get the specified private endpoint connection associated with the container - /// registry. + /// List all private endpoint connections in a container registry. /// /// /// The name of the resource group to which the container registry belongs. @@ -59,9 +58,6 @@ internal PrivateEndpointConnectionsOperations(ContainerRegistryManagementClient /// /// The name of the container registry. /// - /// - /// The name of the private endpoint connection. - /// /// /// Headers that will be added to request. /// @@ -83,7 +79,7 @@ internal PrivateEndpointConnectionsOperations(ContainerRegistryManagementClient /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string registryName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -119,11 +115,7 @@ internal PrivateEndpointConnectionsOperations(ContainerRegistryManagementClient throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); } } - if (privateEndpointConnectionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); - } - string apiVersion = "2019-12-01-preview"; + string apiVersion = "2021-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -134,17 +126,15 @@ internal PrivateEndpointConnectionsOperations(ContainerRegistryManagementClient tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("registryName", registryName); - tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/privateEndpointConnections").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); - _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -243,7 +233,7 @@ internal PrivateEndpointConnectionsOperations(ContainerRegistryManagementClient throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -256,7 +246,7 @@ internal PrivateEndpointConnectionsOperations(ContainerRegistryManagementClient _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -276,41 +266,8 @@ internal PrivateEndpointConnectionsOperations(ContainerRegistryManagementClient } /// - /// Update the state of specified private endpoint connection associated with - /// the container registry. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the private endpoint connection. - /// - /// - /// The resource of private endpoint. - /// - /// - /// A collection of information about the state of the connection between - /// service consumer and provider. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, string privateEndpointConnectionName, PrivateEndpoint privateEndpoint = default(PrivateEndpoint), PrivateLinkServiceConnectionState privateLinkServiceConnectionState = default(PrivateLinkServiceConnectionState), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, registryName, privateEndpointConnectionName, privateEndpoint, privateLinkServiceConnectionState, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes the specified private endpoint connection associated with the - /// container registry. + /// Get the specified private endpoint connection associated with the container + /// registry. /// /// /// The name of the resource group to which the container registry belongs. @@ -322,28 +279,6 @@ internal PrivateEndpointConnectionsOperations(ContainerRegistryManagementClient /// The name of the private endpoint connection. /// /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, registryName, privateEndpointConnectionName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// List all private endpoint connections in a container registry. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// /// Headers that will be added to request. /// /// @@ -364,7 +299,7 @@ internal PrivateEndpointConnectionsOperations(ContainerRegistryManagementClient /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string registryName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -400,7 +335,11 @@ internal PrivateEndpointConnectionsOperations(ContainerRegistryManagementClient throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2019-12-01-preview"; + if (privateEndpointConnectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); + } + string apiVersion = "2021-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -411,15 +350,17 @@ internal PrivateEndpointConnectionsOperations(ContainerRegistryManagementClient tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("registryName", registryName); + tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/privateEndpointConnections").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); + _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -518,7 +459,7 @@ internal PrivateEndpointConnectionsOperations(ContainerRegistryManagementClient throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -531,7 +472,7 @@ internal PrivateEndpointConnectionsOperations(ContainerRegistryManagementClient _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -550,6 +491,65 @@ internal PrivateEndpointConnectionsOperations(ContainerRegistryManagementClient return _result; } + /// + /// Update the state of specified private endpoint connection associated with + /// the container registry. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the private endpoint connection. + /// + /// + /// The resource of private endpoint. + /// + /// + /// A collection of information about the state of the connection between + /// service consumer and provider. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, string privateEndpointConnectionName, PrivateEndpoint privateEndpoint = default(PrivateEndpoint), PrivateLinkServiceConnectionState privateLinkServiceConnectionState = default(PrivateLinkServiceConnectionState), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, registryName, privateEndpointConnectionName, privateEndpoint, privateLinkServiceConnectionState, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes the specified private endpoint connection associated with the + /// container registry. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the private endpoint connection. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string privateEndpointConnectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, registryName, privateEndpointConnectionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + /// /// Update the state of specified private endpoint connection associated with /// the container registry. @@ -631,7 +631,7 @@ internal PrivateEndpointConnectionsOperations(ContainerRegistryManagementClient { throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); } - string apiVersion = "2019-12-01-preview"; + string apiVersion = "2021-09-01"; PrivateEndpointConnection privateEndpointConnection = new PrivateEndpointConnection(); if (privateEndpoint != null || privateLinkServiceConnectionState != null) { @@ -885,7 +885,7 @@ internal PrivateEndpointConnectionsOperations(ContainerRegistryManagementClient { throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); } - string apiVersion = "2019-12-01-preview"; + string apiVersion = "2021-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/PrivateEndpointConnectionsOperationsExtensions.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/PrivateEndpointConnectionsOperationsExtensions.cs index 1b4ddacc7f55..ba3af456ee73 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/PrivateEndpointConnectionsOperationsExtensions.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/PrivateEndpointConnectionsOperationsExtensions.cs @@ -20,6 +20,46 @@ namespace Microsoft.Azure.Management.ContainerRegistry /// public static partial class PrivateEndpointConnectionsOperationsExtensions { + /// + /// List all private endpoint connections in a container registry. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + public static IPage List(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string registryName) + { + return operations.ListAsync(resourceGroupName, registryName).GetAwaiter().GetResult(); + } + + /// + /// List all private endpoint connections in a container registry. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string registryName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, registryName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Get the specified private endpoint connection associated with the container /// registry. @@ -175,46 +215,6 @@ public static void Delete(this IPrivateEndpointConnectionsOperations operations, (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, registryName, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } - /// - /// List all private endpoint connections in a container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - public static IPage List(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string registryName) - { - return operations.ListAsync(resourceGroupName, registryName).GetAwaiter().GetResult(); - } - - /// - /// List all private endpoint connections in a container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task> ListAsync(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string registryName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, registryName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Update the state of specified private endpoint connection associated with /// the container registry. diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/RegistriesOperations.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/RegistriesOperations.cs index 9898a4269db0..1d6a5501bd80 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/RegistriesOperations.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/RegistriesOperations.cs @@ -130,7 +130,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "name", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2019-12-01-preview"; + string apiVersion = "2021-09-01"; RegistryNameCheckRequest registryNameCheckRequest = new RegistryNameCheckRequest(); if (name != null) { @@ -289,14 +289,8 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) } /// - /// Gets the properties of the specified container registry. + /// Lists all the container registries under the specified subscription. /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// /// /// Headers that will be added to request. /// @@ -318,43 +312,13 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - } - if (registryName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "registryName"); - } - if (registryName != null) - { - if (registryName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "registryName", 50); - } - if (registryName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "registryName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(registryName, "^[a-zA-Z0-9]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); - } - } - string apiVersion = "2019-12-01-preview"; + string apiVersion = "2021-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -363,17 +327,13 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("registryName", registryName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/registries").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -472,7 +432,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -485,7 +445,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -505,83 +465,206 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) } /// - /// Creates a container registry with the specified parameters. + /// Lists all the container registries under the specified resource group. /// /// /// The name of the resource group to which the container registry belongs. /// - /// - /// The name of the container registry. - /// - /// - /// The parameters for creating a container registry. - /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string registryName, Registry registry, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - // Send Request - AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, registryName, registry, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + string apiVersion = "2021-09-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } - /// - /// Deletes a container registry. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, registryName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - /// - /// Updates a container registry with the specified parameters. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The parameters for updating a container registry. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, RegistryUpdateParameters registryUpdateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, registryName, registryUpdateParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; } /// - /// Lists all the container registries under the specified resource group. + /// Gets the properties of the specified container registry. /// /// /// The name of the resource group to which the container registry belongs. /// + /// + /// The name of the container registry. + /// /// /// Headers that will be added to request. /// @@ -603,7 +686,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -620,7 +703,26 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } - string apiVersion = "2019-12-01-preview"; + if (registryName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "registryName"); + } + if (registryName != null) + { + if (registryName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "registryName", 50); + } + if (registryName.Length < 5) + { + throw new ValidationException(ValidationRules.MinLength, "registryName", 5); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(registryName, "^[a-zA-Z0-9]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); + } + } + string apiVersion = "2021-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -630,14 +732,16 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("registryName", registryName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -736,7 +840,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -749,7 +853,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -769,8 +873,86 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) } /// - /// Lists all the container registries under the specified subscription. + /// Creates a container registry with the specified parameters. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The parameters for creating a container registry. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string registryName, Registry registry, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, registryName, registry, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes a container registry. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, registryName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Updates a container registry with the specified parameters. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The parameters for updating a container registry. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, RegistryUpdateParameters registryUpdateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, registryName, registryUpdateParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the quota usages for the specified container registry. /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// /// /// Headers that will be added to request. /// @@ -792,13 +974,43 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ListUsagesWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-12-01-preview"; + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (registryName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "registryName"); + } + if (registryName != null) + { + if (registryName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "registryName", 50); + } + if (registryName.Length < 5) + { + throw new ValidationException(ValidationRules.MinLength, "registryName", 5); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(registryName, "^[a-zA-Z0-9]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); + } + } + string apiVersion = "2021-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -807,13 +1019,17 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("registryName", registryName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListUsages", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/registries").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listUsages").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -912,7 +1128,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -925,7 +1141,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -945,7 +1161,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) } /// - /// Lists the login credentials for the specified container registry. + /// Lists the private link resources for a container registry. /// /// /// The name of the resource group to which the container registry belongs. @@ -974,7 +1190,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> ListCredentialsWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListPrivateLinkResourcesWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -1010,7 +1226,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2019-12-01-preview"; + string apiVersion = "2021-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1022,11 +1238,11 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("registryName", registryName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListCredentials", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListPrivateLinkResources", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listCredentials").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/privateLinkResources").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); @@ -1042,7 +1258,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1128,7 +1344,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1141,7 +1357,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1161,7 +1377,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) } /// - /// Regenerates one of the login credentials for the specified container + /// Gets a private link resource by a specified group name for a container /// registry. /// /// @@ -1170,9 +1386,8 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) /// /// The name of the container registry. /// - /// - /// Specifies name of the password which should be regenerated -- password or - /// password2. Possible values include: 'password', 'password2' + /// + /// The name of the private link resource. /// /// /// Headers that will be added to request. @@ -1180,7 +1395,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1195,7 +1410,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> RegenerateCredentialWithHttpMessagesAsync(string resourceGroupName, string registryName, PasswordName name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetPrivateLinkResourceWithHttpMessagesAsync(string resourceGroupName, string registryName, string groupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -1231,9 +1446,11 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2019-12-01-preview"; - RegenerateCredentialParameters regenerateCredentialParameters = new RegenerateCredentialParameters(); - regenerateCredentialParameters.Name = name; + if (groupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "groupName"); + } + string apiVersion = "2021-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1244,16 +1461,17 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("registryName", registryName); - tracingParameters.Add("regenerateCredentialParameters", regenerateCredentialParameters); + tracingParameters.Add("groupName", groupName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "RegenerateCredential", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetPrivateLinkResource", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/regenerateCredential").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/privateLinkResources/{groupName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); + _url = _url.Replace("{groupName}", System.Uri.EscapeDataString(groupName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -1266,7 +1484,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1297,12 +1515,6 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) // Serialize Request string _requestContent = null; - if(regenerateCredentialParameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(regenerateCredentialParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -1325,14 +1537,13 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1342,10 +1553,6 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1358,7 +1565,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1371,7 +1578,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1391,7 +1598,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) } /// - /// Gets the quota usages for the specified container registry. + /// Lists the login credentials for the specified container registry. /// /// /// The name of the resource group to which the container registry belongs. @@ -1420,7 +1627,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> ListUsagesWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ListCredentialsWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -1456,7 +1663,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2019-12-01-preview"; + string apiVersion = "2021-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1468,11 +1675,11 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("registryName", registryName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListUsages", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListCredentials", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listUsages").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listCredentials").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); @@ -1488,7 +1695,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1574,7 +1781,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1587,7 +1794,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1607,7 +1814,8 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) } /// - /// Lists the private link resources for a container registry. + /// Regenerates one of the login credentials for the specified container + /// registry. /// /// /// The name of the resource group to which the container registry belongs. @@ -1615,6 +1823,10 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) /// /// The name of the container registry. /// + /// + /// Specifies name of the password which should be regenerated -- password or + /// password2. Possible values include: 'password', 'password2' + /// /// /// Headers that will be added to request. /// @@ -1636,7 +1848,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListPrivateLinkResourcesWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> RegenerateCredentialWithHttpMessagesAsync(string resourceGroupName, string registryName, PasswordName name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -1672,7 +1884,9 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2019-12-01-preview"; + string apiVersion = "2021-09-01"; + RegenerateCredentialParameters regenerateCredentialParameters = new RegenerateCredentialParameters(); + regenerateCredentialParameters.Name = name; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1683,12 +1897,13 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("registryName", registryName); + tracingParameters.Add("regenerateCredentialParameters", regenerateCredentialParameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListPrivateLinkResources", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "RegenerateCredential", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/privateLinkResources").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/regenerateCredential").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); @@ -1704,7 +1919,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1732,9 +1947,15 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - - // Serialize Request - string _requestContent = null; + + // Serialize Request + string _requestContent = null; + if(regenerateCredentialParameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(regenerateCredentialParameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -1790,7 +2011,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1803,7 +2024,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -2059,31 +2280,6 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) return _result; } - /// - /// Generate keys for a token of a specified container registry. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The parameters for generating credentials. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> GenerateCredentialsWithHttpMessagesAsync(string resourceGroupName, string registryName, GenerateCredentialsParameters generateCredentialsParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginGenerateCredentialsWithHttpMessagesAsync(resourceGroupName, registryName, generateCredentialsParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - /// /// Copies an image to this container registry from the specified container /// registry. @@ -2160,7 +2356,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) { parameters.Validate(); } - string apiVersion = "2019-12-01-preview"; + string apiVersion = "2021-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2376,7 +2572,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) { registry.Validate(); } - string apiVersion = "2019-12-01-preview"; + string apiVersion = "2021-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2614,7 +2810,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2019-12-01-preview"; + string apiVersion = "2021-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2819,7 +3015,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "registryUpdateParameters"); } - string apiVersion = "2019-12-01-preview"; + string apiVersion = "2021-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3221,237 +3417,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) } /// - /// Generate keys for a token of a specified container registry. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The parameters for generating credentials. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async System.Threading.Tasks.Task> BeginGenerateCredentialsWithHttpMessagesAsync(string resourceGroupName, string registryName, GenerateCredentialsParameters generateCredentialsParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - } - if (registryName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "registryName"); - } - if (registryName != null) - { - if (registryName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "registryName", 50); - } - if (registryName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "registryName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(registryName, "^[a-zA-Z0-9]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); - } - } - if (generateCredentialsParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "generateCredentialsParameters"); - } - string apiVersion = "2019-05-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("registryName", registryName); - tracingParameters.Add("generateCredentialsParameters", generateCredentialsParameters); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginGenerateCredentials", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/generateCredentials").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(generateCredentialsParameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(generateCredentialsParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Lists all the container registries under the specified resource group. + /// Lists all the container registries under the specified subscription. /// /// /// The NextLink from the previous successful call to List operation. @@ -3477,7 +3443,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -3492,7 +3458,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -3624,7 +3590,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) } /// - /// Lists all the container registries under the specified subscription. + /// Lists all the container registries under the specified resource group. /// /// /// The NextLink from the previous successful call to List operation. @@ -3650,7 +3616,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -3665,7 +3631,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/RegistriesOperationsExtensions.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/RegistriesOperationsExtensions.cs index 265fd070b959..2263ad7c782a 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/RegistriesOperationsExtensions.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/RegistriesOperationsExtensions.cs @@ -105,6 +105,68 @@ public static RegistryNameStatus CheckNameAvailability(this IRegistriesOperation } } + /// + /// Lists all the container registries under the specified subscription. + /// + /// + /// The operations group for this extension method. + /// + public static IPage List(this IRegistriesOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists all the container registries under the specified subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IRegistriesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists all the container registries under the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + public static IPage ListByResourceGroup(this IRegistriesOperations operations, string resourceGroupName) + { + return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Lists all the container registries under the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this IRegistriesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Gets the properties of the specified container registry. /// @@ -275,7 +337,7 @@ public static Registry Update(this IRegistriesOperations operations, string reso } /// - /// Lists all the container registries under the specified resource group. + /// Gets the quota usages for the specified container registry. /// /// /// The operations group for this extension method. @@ -283,13 +345,16 @@ public static Registry Update(this IRegistriesOperations operations, string reso /// /// The name of the resource group to which the container registry belongs. /// - public static IPage ListByResourceGroup(this IRegistriesOperations operations, string resourceGroupName) + /// + /// The name of the container registry. + /// + public static RegistryUsageListResult ListUsages(this IRegistriesOperations operations, string resourceGroupName, string registryName) { - return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + return operations.ListUsagesAsync(resourceGroupName, registryName).GetAwaiter().GetResult(); } /// - /// Lists all the container registries under the specified resource group. + /// Gets the quota usages for the specified container registry. /// /// /// The operations group for this extension method. @@ -297,47 +362,22 @@ public static IPage ListByResourceGroup(this IRegistriesOperations ope /// /// The name of the resource group to which the container registry belongs. /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this IRegistriesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all the container registries under the specified subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage List(this IRegistriesOperations operations) - { - return operations.ListAsync().GetAwaiter().GetResult(); - } - - /// - /// Lists all the container registries under the specified subscription. - /// - /// - /// The operations group for this extension method. + /// + /// The name of the container registry. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListAsync(this IRegistriesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task ListUsagesAsync(this IRegistriesOperations operations, string resourceGroupName, string registryName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListUsagesWithHttpMessagesAsync(resourceGroupName, registryName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Lists the login credentials for the specified container registry. + /// Lists the private link resources for a container registry. /// /// /// The operations group for this extension method. @@ -348,13 +388,13 @@ public static IPage List(this IRegistriesOperations operations) /// /// The name of the container registry. /// - public static RegistryListCredentialsResult ListCredentials(this IRegistriesOperations operations, string resourceGroupName, string registryName) + public static IPage ListPrivateLinkResources(this IRegistriesOperations operations, string resourceGroupName, string registryName) { - return operations.ListCredentialsAsync(resourceGroupName, registryName).GetAwaiter().GetResult(); + return operations.ListPrivateLinkResourcesAsync(resourceGroupName, registryName).GetAwaiter().GetResult(); } /// - /// Lists the login credentials for the specified container registry. + /// Lists the private link resources for a container registry. /// /// /// The operations group for this extension method. @@ -368,16 +408,16 @@ public static RegistryListCredentialsResult ListCredentials(this IRegistriesOper /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task ListCredentialsAsync(this IRegistriesOperations operations, string resourceGroupName, string registryName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task> ListPrivateLinkResourcesAsync(this IRegistriesOperations operations, string resourceGroupName, string registryName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListCredentialsWithHttpMessagesAsync(resourceGroupName, registryName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListPrivateLinkResourcesWithHttpMessagesAsync(resourceGroupName, registryName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Regenerates one of the login credentials for the specified container + /// Gets a private link resource by a specified group name for a container /// registry. /// /// @@ -389,17 +429,16 @@ public static RegistryListCredentialsResult ListCredentials(this IRegistriesOper /// /// The name of the container registry. /// - /// - /// Specifies name of the password which should be regenerated -- password or - /// password2. Possible values include: 'password', 'password2' + /// + /// The name of the private link resource. /// - public static RegistryListCredentialsResult RegenerateCredential(this IRegistriesOperations operations, string resourceGroupName, string registryName, PasswordName name) + public static PrivateLinkResource GetPrivateLinkResource(this IRegistriesOperations operations, string resourceGroupName, string registryName, string groupName) { - return operations.RegenerateCredentialAsync(resourceGroupName, registryName, name).GetAwaiter().GetResult(); + return operations.GetPrivateLinkResourceAsync(resourceGroupName, registryName, groupName).GetAwaiter().GetResult(); } /// - /// Regenerates one of the login credentials for the specified container + /// Gets a private link resource by a specified group name for a container /// registry. /// /// @@ -411,23 +450,22 @@ public static RegistryListCredentialsResult RegenerateCredential(this IRegistrie /// /// The name of the container registry. /// - /// - /// Specifies name of the password which should be regenerated -- password or - /// password2. Possible values include: 'password', 'password2' + /// + /// The name of the private link resource. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task RegenerateCredentialAsync(this IRegistriesOperations operations, string resourceGroupName, string registryName, PasswordName name, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task GetPrivateLinkResourceAsync(this IRegistriesOperations operations, string resourceGroupName, string registryName, string groupName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.RegenerateCredentialWithHttpMessagesAsync(resourceGroupName, registryName, name, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetPrivateLinkResourceWithHttpMessagesAsync(resourceGroupName, registryName, groupName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets the quota usages for the specified container registry. + /// Lists the login credentials for the specified container registry. /// /// /// The operations group for this extension method. @@ -438,13 +476,13 @@ public static RegistryListCredentialsResult RegenerateCredential(this IRegistrie /// /// The name of the container registry. /// - public static RegistryUsageListResult ListUsages(this IRegistriesOperations operations, string resourceGroupName, string registryName) + public static RegistryListCredentialsResult ListCredentials(this IRegistriesOperations operations, string resourceGroupName, string registryName) { - return operations.ListUsagesAsync(resourceGroupName, registryName).GetAwaiter().GetResult(); + return operations.ListCredentialsAsync(resourceGroupName, registryName).GetAwaiter().GetResult(); } /// - /// Gets the quota usages for the specified container registry. + /// Lists the login credentials for the specified container registry. /// /// /// The operations group for this extension method. @@ -458,16 +496,17 @@ public static RegistryUsageListResult ListUsages(this IRegistriesOperations oper /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task ListUsagesAsync(this IRegistriesOperations operations, string resourceGroupName, string registryName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task ListCredentialsAsync(this IRegistriesOperations operations, string resourceGroupName, string registryName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListUsagesWithHttpMessagesAsync(resourceGroupName, registryName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListCredentialsWithHttpMessagesAsync(resourceGroupName, registryName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Lists the private link resources for a container registry. + /// Regenerates one of the login credentials for the specified container + /// registry. /// /// /// The operations group for this extension method. @@ -478,13 +517,18 @@ public static RegistryUsageListResult ListUsages(this IRegistriesOperations oper /// /// The name of the container registry. /// - public static IPage ListPrivateLinkResources(this IRegistriesOperations operations, string resourceGroupName, string registryName) + /// + /// Specifies name of the password which should be regenerated -- password or + /// password2. Possible values include: 'password', 'password2' + /// + public static RegistryListCredentialsResult RegenerateCredential(this IRegistriesOperations operations, string resourceGroupName, string registryName, PasswordName name) { - return operations.ListPrivateLinkResourcesAsync(resourceGroupName, registryName).GetAwaiter().GetResult(); + return operations.RegenerateCredentialAsync(resourceGroupName, registryName, name).GetAwaiter().GetResult(); } /// - /// Lists the private link resources for a container registry. + /// Regenerates one of the login credentials for the specified container + /// registry. /// /// /// The operations group for this extension method. @@ -495,12 +539,16 @@ public static IPage ListPrivateLinkResources(this IRegistri /// /// The name of the container registry. /// + /// + /// Specifies name of the password which should be regenerated -- password or + /// password2. Possible values include: 'password', 'password2' + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListPrivateLinkResourcesAsync(this IRegistriesOperations operations, string resourceGroupName, string registryName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task RegenerateCredentialAsync(this IRegistriesOperations operations, string resourceGroupName, string registryName, PasswordName name, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListPrivateLinkResourcesWithHttpMessagesAsync(resourceGroupName, registryName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.RegenerateCredentialWithHttpMessagesAsync(resourceGroupName, registryName, name, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -594,52 +642,6 @@ public static SourceUploadDefinition GetBuildSourceUploadUrl(this IRegistriesOpe } } - /// - /// Generate keys for a token of a specified container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The parameters for generating credentials. - /// - public static GenerateCredentialsResult GenerateCredentials(this IRegistriesOperations operations, string resourceGroupName, string registryName, GenerateCredentialsParameters generateCredentialsParameters) - { - return operations.GenerateCredentialsAsync(resourceGroupName, registryName, generateCredentialsParameters).GetAwaiter().GetResult(); - } - - /// - /// Generate keys for a token of a specified container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The parameters for generating credentials. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task GenerateCredentialsAsync(this IRegistriesOperations operations, string resourceGroupName, string registryName, GenerateCredentialsParameters generateCredentialsParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GenerateCredentialsWithHttpMessagesAsync(resourceGroupName, registryName, generateCredentialsParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Copies an image to this container registry from the specified container /// registry. @@ -865,46 +867,34 @@ public static Run BeginScheduleRun(this IRegistriesOperations operations, string } /// - /// Generate keys for a token of a specified container registry. + /// Lists all the container registries under the specified subscription. /// /// /// The operations group for this extension method. /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The parameters for generating credentials. + /// + /// The NextLink from the previous successful call to List operation. /// - public static GenerateCredentialsResult BeginGenerateCredentials(this IRegistriesOperations operations, string resourceGroupName, string registryName, GenerateCredentialsParameters generateCredentialsParameters) + public static IPage ListNext(this IRegistriesOperations operations, string nextPageLink) { - return operations.BeginGenerateCredentialsAsync(resourceGroupName, registryName, generateCredentialsParameters).GetAwaiter().GetResult(); + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// - /// Generate keys for a token of a specified container registry. + /// Lists all the container registries under the specified subscription. /// /// /// The operations group for this extension method. /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The parameters for generating credentials. + /// + /// The NextLink from the previous successful call to List operation. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginGenerateCredentialsAsync(this IRegistriesOperations operations, string resourceGroupName, string registryName, GenerateCredentialsParameters generateCredentialsParameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task> ListNextAsync(this IRegistriesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginGenerateCredentialsWithHttpMessagesAsync(resourceGroupName, registryName, generateCredentialsParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -944,40 +934,6 @@ public static IPage ListByResourceGroupNext(this IRegistriesOperations } } - /// - /// Lists all the container registries under the specified subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IRegistriesOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all the container registries under the specified subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task> ListNextAsync(this IRegistriesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Lists the private link resources for a container registry. /// diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ReplicationsOperations.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ReplicationsOperations.cs index 58d4b305a18d..a87b4fbfb85c 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ReplicationsOperations.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ReplicationsOperations.cs @@ -50,7 +50,7 @@ internal ReplicationsOperations(ContainerRegistryManagementClient client) public ContainerRegistryManagementClient Client { get; private set; } /// - /// Gets the properties of the specified replication. + /// Lists all the replications for the specified container registry. /// /// /// The name of the resource group to which the container registry belongs. @@ -58,9 +58,6 @@ internal ReplicationsOperations(ContainerRegistryManagementClient client) /// /// The name of the container registry. /// - /// - /// The name of the replication. - /// /// /// Headers that will be added to request. /// @@ -82,7 +79,7 @@ internal ReplicationsOperations(ContainerRegistryManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string registryName, string replicationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -118,26 +115,7 @@ internal ReplicationsOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); } } - if (replicationName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "replicationName"); - } - if (replicationName != null) - { - if (replicationName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "replicationName", 50); - } - if (replicationName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "replicationName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(replicationName, "^[a-zA-Z0-9]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "replicationName", "^[a-zA-Z0-9]*$"); - } - } - string apiVersion = "2019-12-01-preview"; + string apiVersion = "2021-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -148,17 +126,15 @@ internal ReplicationsOperations(ContainerRegistryManagementClient client) tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("registryName", registryName); - tracingParameters.Add("replicationName", replicationName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); - _url = _url.Replace("{replicationName}", System.Uri.EscapeDataString(replicationName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -257,7 +233,7 @@ internal ReplicationsOperations(ContainerRegistryManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -270,7 +246,7 @@ internal ReplicationsOperations(ContainerRegistryManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -290,62 +266,7 @@ internal ReplicationsOperations(ContainerRegistryManagementClient client) } /// - /// Creates a replication for a container registry with the specified - /// parameters. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the replication. - /// - /// - /// The parameters for creating a replication. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string registryName, string replicationName, Replication replication, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, registryName, replicationName, replication, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes a replication from a container registry. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the replication. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string replicationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, registryName, replicationName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Updates a replication for a container registry with the specified - /// parameters. + /// Gets the properties of the specified replication. /// /// /// The name of the resource group to which the container registry belongs. @@ -356,36 +277,6 @@ internal ReplicationsOperations(ContainerRegistryManagementClient client) /// /// The name of the replication. /// - /// - /// The tags for the replication. - /// - /// - /// Specifies whether the replication's regional endpoint is enabled. Requests - /// will not be routed to a replication whose regional endpoint is disabled, - /// however its data will continue to be synced with other replications. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, string replicationName, IDictionary tags = default(IDictionary), bool? regionEndpointEnabled = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, registryName, replicationName, tags, regionEndpointEnabled, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Lists all the replications for the specified container registry. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// /// /// Headers that will be added to request. /// @@ -407,7 +298,7 @@ internal ReplicationsOperations(ContainerRegistryManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string registryName, string replicationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -443,7 +334,26 @@ internal ReplicationsOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2019-12-01-preview"; + if (replicationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "replicationName"); + } + if (replicationName != null) + { + if (replicationName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "replicationName", 50); + } + if (replicationName.Length < 5) + { + throw new ValidationException(ValidationRules.MinLength, "replicationName", 5); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(replicationName, "^[a-zA-Z0-9]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "replicationName", "^[a-zA-Z0-9]*$"); + } + } + string apiVersion = "2021-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -454,15 +364,17 @@ internal ReplicationsOperations(ContainerRegistryManagementClient client) tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("registryName", registryName); + tracingParameters.Add("replicationName", replicationName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); + _url = _url.Replace("{replicationName}", System.Uri.EscapeDataString(replicationName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -561,7 +473,7 @@ internal ReplicationsOperations(ContainerRegistryManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -574,7 +486,7 @@ internal ReplicationsOperations(ContainerRegistryManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -593,6 +505,94 @@ internal ReplicationsOperations(ContainerRegistryManagementClient client) return _result; } + /// + /// Creates a replication for a container registry with the specified + /// parameters. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the replication. + /// + /// + /// The parameters for creating a replication. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string registryName, string replicationName, Replication replication, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, registryName, replicationName, replication, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes a replication from a container registry. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the replication. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string replicationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, registryName, replicationName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Updates a replication for a container registry with the specified + /// parameters. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the replication. + /// + /// + /// The tags for the replication. + /// + /// + /// Specifies whether the replication's regional endpoint is enabled. Requests + /// will not be routed to a replication whose regional endpoint is disabled, + /// however its data will continue to be synced with other replications. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, string replicationName, IDictionary tags = default(IDictionary), bool? regionEndpointEnabled = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, registryName, replicationName, tags, regionEndpointEnabled, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + /// /// Creates a replication for a container registry with the specified /// parameters. @@ -693,7 +693,7 @@ internal ReplicationsOperations(ContainerRegistryManagementClient client) { replication.Validate(); } - string apiVersion = "2019-12-01-preview"; + string apiVersion = "2021-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -955,7 +955,7 @@ internal ReplicationsOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "replicationName", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2019-12-01-preview"; + string apiVersion = "2021-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1186,7 +1186,7 @@ internal ReplicationsOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "replicationName", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2019-12-01-preview"; + string apiVersion = "2021-09-01"; ReplicationUpdateParameters replicationUpdateParameters = new ReplicationUpdateParameters(); if (tags != null || regionEndpointEnabled != null) { diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ReplicationsOperationsExtensions.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ReplicationsOperationsExtensions.cs index 407ec2da3fc2..22d005306929 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ReplicationsOperationsExtensions.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ReplicationsOperationsExtensions.cs @@ -22,6 +22,46 @@ namespace Microsoft.Azure.Management.ContainerRegistry /// public static partial class ReplicationsOperationsExtensions { + /// + /// Lists all the replications for the specified container registry. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + public static IPage List(this IReplicationsOperations operations, string resourceGroupName, string registryName) + { + return operations.ListAsync(resourceGroupName, registryName).GetAwaiter().GetResult(); + } + + /// + /// Lists all the replications for the specified container registry. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IReplicationsOperations operations, string resourceGroupName, string registryName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, registryName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Gets the properties of the specified replication. /// @@ -229,46 +269,6 @@ public static void Delete(this IReplicationsOperations operations, string resour } } - /// - /// Lists all the replications for the specified container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - public static IPage List(this IReplicationsOperations operations, string resourceGroupName, string registryName) - { - return operations.ListAsync(resourceGroupName, registryName).GetAwaiter().GetResult(); - } - - /// - /// Lists all the replications for the specified container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task> ListAsync(this IReplicationsOperations operations, string resourceGroupName, string registryName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, registryName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Creates a replication for a container registry with the specified /// parameters. diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ScopeMapsOperations.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ScopeMapsOperations.cs deleted file mode 100644 index 485b38ebd645..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ScopeMapsOperations.cs +++ /dev/null @@ -1,1554 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.ContainerRegistry -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - - /// - /// ScopeMapsOperations operations. - /// - internal partial class ScopeMapsOperations : IServiceOperations, IScopeMapsOperations - { - /// - /// Initializes a new instance of the ScopeMapsOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal ScopeMapsOperations(ContainerRegistryManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the ContainerRegistryManagementClient - /// - public ContainerRegistryManagementClient Client { get; private set; } - - /// - /// Gets the properties of the specified scope map. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the scope map. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string registryName, string scopeMapName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - } - if (registryName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "registryName"); - } - if (registryName != null) - { - if (registryName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "registryName", 50); - } - if (registryName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "registryName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(registryName, "^[a-zA-Z0-9]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); - } - } - if (scopeMapName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "scopeMapName"); - } - if (scopeMapName != null) - { - if (scopeMapName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "scopeMapName", 50); - } - if (scopeMapName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "scopeMapName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(scopeMapName, "^[a-zA-Z0-9-_]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "scopeMapName", "^[a-zA-Z0-9-_]*$"); - } - } - string apiVersion = "2019-05-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("registryName", registryName); - tracingParameters.Add("scopeMapName", scopeMapName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scopeMaps/{scopeMapName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); - _url = _url.Replace("{scopeMapName}", System.Uri.EscapeDataString(scopeMapName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Creates a scope map for a container registry with the specified parameters. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the scope map. - /// - /// - /// The list of scoped permissions for registry artifacts. - /// E.g. repositories/repository-name/content/read, - /// repositories/repository-name/metadata/write - /// - /// - /// The user friendly description of the scope map. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string registryName, string scopeMapName, IList actions, string description = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, registryName, scopeMapName, actions, description, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes a scope map from a container registry. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the scope map. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string scopeMapName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, registryName, scopeMapName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Updates a scope map with the specified parameters. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the scope map. - /// - /// - /// The user friendly description of the scope map. - /// - /// - /// The list of scope permissions for registry artifacts. - /// E.g. repositories/repository-name/pull, - /// repositories/repository-name/delete - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, string scopeMapName, string description = default(string), IList actions = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, registryName, scopeMapName, description, actions, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Lists all the scope maps for the specified container registry. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - } - if (registryName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "registryName"); - } - if (registryName != null) - { - if (registryName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "registryName", 50); - } - if (registryName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "registryName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(registryName, "^[a-zA-Z0-9]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); - } - } - string apiVersion = "2019-05-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("registryName", registryName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scopeMaps").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Creates a scope map for a container registry with the specified parameters. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the scope map. - /// - /// - /// The list of scoped permissions for registry artifacts. - /// E.g. repositories/repository-name/content/read, - /// repositories/repository-name/metadata/write - /// - /// - /// The user friendly description of the scope map. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string registryName, string scopeMapName, IList actions, string description = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - } - if (registryName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "registryName"); - } - if (registryName != null) - { - if (registryName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "registryName", 50); - } - if (registryName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "registryName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(registryName, "^[a-zA-Z0-9]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); - } - } - if (scopeMapName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "scopeMapName"); - } - if (scopeMapName != null) - { - if (scopeMapName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "scopeMapName", 50); - } - if (scopeMapName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "scopeMapName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(scopeMapName, "^[a-zA-Z0-9-_]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "scopeMapName", "^[a-zA-Z0-9-_]*$"); - } - } - if (actions == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "actions"); - } - string apiVersion = "2019-05-01-preview"; - ScopeMap scopeMapCreateParameters = new ScopeMap(); - if (description != null || actions != null) - { - scopeMapCreateParameters.Description = description; - scopeMapCreateParameters.Actions = actions; - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("registryName", registryName); - tracingParameters.Add("scopeMapName", scopeMapName); - tracingParameters.Add("scopeMapCreateParameters", scopeMapCreateParameters); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scopeMaps/{scopeMapName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); - _url = _url.Replace("{scopeMapName}", System.Uri.EscapeDataString(scopeMapName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(scopeMapCreateParameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(scopeMapCreateParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Deletes a scope map from a container registry. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the scope map. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string scopeMapName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - } - if (registryName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "registryName"); - } - if (registryName != null) - { - if (registryName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "registryName", 50); - } - if (registryName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "registryName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(registryName, "^[a-zA-Z0-9]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); - } - } - if (scopeMapName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "scopeMapName"); - } - if (scopeMapName != null) - { - if (scopeMapName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "scopeMapName", 50); - } - if (scopeMapName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "scopeMapName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(scopeMapName, "^[a-zA-Z0-9-_]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "scopeMapName", "^[a-zA-Z0-9-_]*$"); - } - } - string apiVersion = "2019-05-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("registryName", registryName); - tracingParameters.Add("scopeMapName", scopeMapName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scopeMaps/{scopeMapName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); - _url = _url.Replace("{scopeMapName}", System.Uri.EscapeDataString(scopeMapName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Updates a scope map with the specified parameters. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the scope map. - /// - /// - /// The user friendly description of the scope map. - /// - /// - /// The list of scope permissions for registry artifacts. - /// E.g. repositories/repository-name/pull, - /// repositories/repository-name/delete - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, string scopeMapName, string description = default(string), IList actions = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - } - if (registryName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "registryName"); - } - if (registryName != null) - { - if (registryName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "registryName", 50); - } - if (registryName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "registryName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(registryName, "^[a-zA-Z0-9]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); - } - } - if (scopeMapName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "scopeMapName"); - } - if (scopeMapName != null) - { - if (scopeMapName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "scopeMapName", 50); - } - if (scopeMapName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "scopeMapName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(scopeMapName, "^[a-zA-Z0-9-_]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "scopeMapName", "^[a-zA-Z0-9-_]*$"); - } - } - string apiVersion = "2019-05-01-preview"; - ScopeMapUpdateParameters scopeMapUpdateParameters = new ScopeMapUpdateParameters(); - if (description != null || actions != null) - { - scopeMapUpdateParameters.Description = description; - scopeMapUpdateParameters.Actions = actions; - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("registryName", registryName); - tracingParameters.Add("scopeMapName", scopeMapName); - tracingParameters.Add("scopeMapUpdateParameters", scopeMapUpdateParameters); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scopeMaps/{scopeMapName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); - _url = _url.Replace("{scopeMapName}", System.Uri.EscapeDataString(scopeMapName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(scopeMapUpdateParameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(scopeMapUpdateParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Lists all the scope maps for the specified container registry. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (nextPageLink == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ScopeMapsOperationsExtensions.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ScopeMapsOperationsExtensions.cs deleted file mode 100644 index 2879f1ce1bc7..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ScopeMapsOperationsExtensions.cs +++ /dev/null @@ -1,480 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.ContainerRegistry -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - - /// - /// Extension methods for ScopeMapsOperations. - /// - public static partial class ScopeMapsOperationsExtensions - { - /// - /// Gets the properties of the specified scope map. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the scope map. - /// - public static ScopeMap Get(this IScopeMapsOperations operations, string resourceGroupName, string registryName, string scopeMapName) - { - return operations.GetAsync(resourceGroupName, registryName, scopeMapName).GetAwaiter().GetResult(); - } - - /// - /// Gets the properties of the specified scope map. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the scope map. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task GetAsync(this IScopeMapsOperations operations, string resourceGroupName, string registryName, string scopeMapName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, registryName, scopeMapName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates a scope map for a container registry with the specified parameters. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the scope map. - /// - /// - /// The list of scoped permissions for registry artifacts. - /// E.g. repositories/repository-name/content/read, - /// repositories/repository-name/metadata/write - /// - /// - /// The user friendly description of the scope map. - /// - public static ScopeMap Create(this IScopeMapsOperations operations, string resourceGroupName, string registryName, string scopeMapName, IList actions, string description = default(string)) - { - return operations.CreateAsync(resourceGroupName, registryName, scopeMapName, actions, description).GetAwaiter().GetResult(); - } - - /// - /// Creates a scope map for a container registry with the specified parameters. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the scope map. - /// - /// - /// The list of scoped permissions for registry artifacts. - /// E.g. repositories/repository-name/content/read, - /// repositories/repository-name/metadata/write - /// - /// - /// The user friendly description of the scope map. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task CreateAsync(this IScopeMapsOperations operations, string resourceGroupName, string registryName, string scopeMapName, IList actions, string description = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, registryName, scopeMapName, actions, description, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a scope map from a container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the scope map. - /// - public static void Delete(this IScopeMapsOperations operations, string resourceGroupName, string registryName, string scopeMapName) - { - operations.DeleteAsync(resourceGroupName, registryName, scopeMapName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a scope map from a container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the scope map. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task DeleteAsync(this IScopeMapsOperations operations, string resourceGroupName, string registryName, string scopeMapName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, registryName, scopeMapName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Updates a scope map with the specified parameters. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the scope map. - /// - /// - /// The user friendly description of the scope map. - /// - /// - /// The list of scope permissions for registry artifacts. - /// E.g. repositories/repository-name/pull, - /// repositories/repository-name/delete - /// - public static ScopeMap Update(this IScopeMapsOperations operations, string resourceGroupName, string registryName, string scopeMapName, string description = default(string), IList actions = default(IList)) - { - return operations.UpdateAsync(resourceGroupName, registryName, scopeMapName, description, actions).GetAwaiter().GetResult(); - } - - /// - /// Updates a scope map with the specified parameters. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the scope map. - /// - /// - /// The user friendly description of the scope map. - /// - /// - /// The list of scope permissions for registry artifacts. - /// E.g. repositories/repository-name/pull, - /// repositories/repository-name/delete - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task UpdateAsync(this IScopeMapsOperations operations, string resourceGroupName, string registryName, string scopeMapName, string description = default(string), IList actions = default(IList), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, registryName, scopeMapName, description, actions, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all the scope maps for the specified container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - public static IPage List(this IScopeMapsOperations operations, string resourceGroupName, string registryName) - { - return operations.ListAsync(resourceGroupName, registryName).GetAwaiter().GetResult(); - } - - /// - /// Lists all the scope maps for the specified container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task> ListAsync(this IScopeMapsOperations operations, string resourceGroupName, string registryName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, registryName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates a scope map for a container registry with the specified parameters. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the scope map. - /// - /// - /// The list of scoped permissions for registry artifacts. - /// E.g. repositories/repository-name/content/read, - /// repositories/repository-name/metadata/write - /// - /// - /// The user friendly description of the scope map. - /// - public static ScopeMap BeginCreate(this IScopeMapsOperations operations, string resourceGroupName, string registryName, string scopeMapName, IList actions, string description = default(string)) - { - return operations.BeginCreateAsync(resourceGroupName, registryName, scopeMapName, actions, description).GetAwaiter().GetResult(); - } - - /// - /// Creates a scope map for a container registry with the specified parameters. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the scope map. - /// - /// - /// The list of scoped permissions for registry artifacts. - /// E.g. repositories/repository-name/content/read, - /// repositories/repository-name/metadata/write - /// - /// - /// The user friendly description of the scope map. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task BeginCreateAsync(this IScopeMapsOperations operations, string resourceGroupName, string registryName, string scopeMapName, IList actions, string description = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateWithHttpMessagesAsync(resourceGroupName, registryName, scopeMapName, actions, description, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a scope map from a container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the scope map. - /// - public static void BeginDelete(this IScopeMapsOperations operations, string resourceGroupName, string registryName, string scopeMapName) - { - operations.BeginDeleteAsync(resourceGroupName, registryName, scopeMapName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a scope map from a container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the scope map. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task BeginDeleteAsync(this IScopeMapsOperations operations, string resourceGroupName, string registryName, string scopeMapName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, registryName, scopeMapName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Updates a scope map with the specified parameters. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the scope map. - /// - /// - /// The user friendly description of the scope map. - /// - /// - /// The list of scope permissions for registry artifacts. - /// E.g. repositories/repository-name/pull, - /// repositories/repository-name/delete - /// - public static ScopeMap BeginUpdate(this IScopeMapsOperations operations, string resourceGroupName, string registryName, string scopeMapName, string description = default(string), IList actions = default(IList)) - { - return operations.BeginUpdateAsync(resourceGroupName, registryName, scopeMapName, description, actions).GetAwaiter().GetResult(); - } - - /// - /// Updates a scope map with the specified parameters. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the scope map. - /// - /// - /// The user friendly description of the scope map. - /// - /// - /// The list of scope permissions for registry artifacts. - /// E.g. repositories/repository-name/pull, - /// repositories/repository-name/delete - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task BeginUpdateAsync(this IScopeMapsOperations operations, string resourceGroupName, string registryName, string scopeMapName, string description = default(string), IList actions = default(IList), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, registryName, scopeMapName, description, actions, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all the scope maps for the specified container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IScopeMapsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all the scope maps for the specified container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task> ListNextAsync(this IScopeMapsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/SdkInfo_ContainerRegistryManagementClient.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/SdkInfo_ContainerRegistryManagementClient.cs index af125e4ed8cf..b3aa0aa71546 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/SdkInfo_ContainerRegistryManagementClient.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/SdkInfo_ContainerRegistryManagementClient.cs @@ -20,34 +20,17 @@ public static IEnumerable> ApiInfo_ContainerRegist return new Tuple[] { new Tuple("ContainerRegistry", "AgentPools", "2019-06-01-preview"), - new Tuple("ContainerRegistry", "ExportPipelines", "2019-12-01-preview"), - new Tuple("ContainerRegistry", "ImportPipelines", "2019-12-01-preview"), - new Tuple("ContainerRegistry", "Operations", "2019-12-01-preview"), - new Tuple("ContainerRegistry", "PipelineRuns", "2019-12-01-preview"), - new Tuple("ContainerRegistry", "PrivateEndpointConnections", "2019-12-01-preview"), - new Tuple("ContainerRegistry", "Registries", "2019-05-01-preview"), + new Tuple("ContainerRegistry", "Operations", "2021-09-01"), + new Tuple("ContainerRegistry", "PrivateEndpointConnections", "2021-09-01"), new Tuple("ContainerRegistry", "Registries", "2019-06-01-preview"), - new Tuple("ContainerRegistry", "Registries", "2019-12-01-preview"), - new Tuple("ContainerRegistry", "Replications", "2019-12-01-preview"), + new Tuple("ContainerRegistry", "Registries", "2021-09-01"), + new Tuple("ContainerRegistry", "Replications", "2021-09-01"), new Tuple("ContainerRegistry", "Runs", "2019-06-01-preview"), - new Tuple("ContainerRegistry", "ScopeMaps", "2019-05-01-preview"), new Tuple("ContainerRegistry", "TaskRuns", "2019-06-01-preview"), new Tuple("ContainerRegistry", "Tasks", "2019-06-01-preview"), - new Tuple("ContainerRegistry", "Tokens", "2019-05-01-preview"), - new Tuple("ContainerRegistry", "Webhooks", "2019-12-01-preview"), + new Tuple("ContainerRegistry", "Webhooks", "2021-09-01"), }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "v2"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4413"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/containerregistry/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=C:\\dev\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "3903ebec90f50617c36911b25d499a7ae867b740"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/TaskRunsOperations.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/TaskRunsOperations.cs index 3d15323d10c3..03d32d56b094 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/TaskRunsOperations.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/TaskRunsOperations.cs @@ -59,7 +59,7 @@ internal TaskRunsOperations(ContainerRegistryManagementClient client) /// The name of the container registry. /// /// - /// The run request name. + /// The name of the task run. /// /// /// Headers that will be added to request. @@ -122,6 +122,21 @@ internal TaskRunsOperations(ContainerRegistryManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "taskRunName"); } + if (taskRunName != null) + { + if (taskRunName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "taskRunName", 50); + } + if (taskRunName.Length < 5) + { + throw new ValidationException(ValidationRules.MinLength, "taskRunName", 5); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(taskRunName, "^[a-zA-Z0-9-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "taskRunName", "^[a-zA-Z0-9-]*$"); + } + } string apiVersion = "2019-06-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -279,7 +294,7 @@ internal TaskRunsOperations(ContainerRegistryManagementClient client) /// The name of the container registry. /// /// - /// The name of task run. + /// The name of the task run. /// /// /// The parameters of a run that needs to scheduled. @@ -307,7 +322,7 @@ internal TaskRunsOperations(ContainerRegistryManagementClient client) /// The name of the container registry. /// /// - /// The task run name. + /// The name of the task run. /// /// /// The headers that will be added to request. @@ -332,7 +347,7 @@ internal TaskRunsOperations(ContainerRegistryManagementClient client) /// The name of the container registry. /// /// - /// The task run name. + /// The name of the task run. /// /// /// The parameters for updating a task run. @@ -361,7 +376,7 @@ internal TaskRunsOperations(ContainerRegistryManagementClient client) /// The name of the container registry. /// /// - /// The run request name. + /// The name of the task run. /// /// /// Headers that will be added to request. @@ -424,6 +439,21 @@ internal TaskRunsOperations(ContainerRegistryManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "taskRunName"); } + if (taskRunName != null) + { + if (taskRunName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "taskRunName", 50); + } + if (taskRunName.Length < 5) + { + throw new ValidationException(ValidationRules.MinLength, "taskRunName", 5); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(taskRunName, "^[a-zA-Z0-9-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "taskRunName", "^[a-zA-Z0-9-]*$"); + } + } string apiVersion = "2019-06-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -792,7 +822,7 @@ internal TaskRunsOperations(ContainerRegistryManagementClient client) /// The name of the container registry. /// /// - /// The name of task run. + /// The name of the task run. /// /// /// The parameters of a run that needs to scheduled. @@ -858,6 +888,21 @@ internal TaskRunsOperations(ContainerRegistryManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "taskRunName"); } + if (taskRunName != null) + { + if (taskRunName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "taskRunName", 50); + } + if (taskRunName.Length < 5) + { + throw new ValidationException(ValidationRules.MinLength, "taskRunName", 5); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(taskRunName, "^[a-zA-Z0-9-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "taskRunName", "^[a-zA-Z0-9-]*$"); + } + } if (taskRun == null) { throw new ValidationException(ValidationRules.CannotBeNull, "taskRun"); @@ -1048,7 +1093,7 @@ internal TaskRunsOperations(ContainerRegistryManagementClient client) /// The name of the container registry. /// /// - /// The task run name. + /// The name of the task run. /// /// /// Headers that will be added to request. @@ -1108,6 +1153,21 @@ internal TaskRunsOperations(ContainerRegistryManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "taskRunName"); } + if (taskRunName != null) + { + if (taskRunName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "taskRunName", 50); + } + if (taskRunName.Length < 5) + { + throw new ValidationException(ValidationRules.MinLength, "taskRunName", 5); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(taskRunName, "^[a-zA-Z0-9-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "taskRunName", "^[a-zA-Z0-9-]*$"); + } + } string apiVersion = "2019-06-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -1247,7 +1307,7 @@ internal TaskRunsOperations(ContainerRegistryManagementClient client) /// The name of the container registry. /// /// - /// The task run name. + /// The name of the task run. /// /// /// The parameters for updating a task run. @@ -1313,6 +1373,21 @@ internal TaskRunsOperations(ContainerRegistryManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "taskRunName"); } + if (taskRunName != null) + { + if (taskRunName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "taskRunName", 50); + } + if (taskRunName.Length < 5) + { + throw new ValidationException(ValidationRules.MinLength, "taskRunName", 5); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(taskRunName, "^[a-zA-Z0-9-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "taskRunName", "^[a-zA-Z0-9-]*$"); + } + } if (updateParameters == null) { throw new ValidationException(ValidationRules.CannotBeNull, "updateParameters"); diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/TaskRunsOperationsExtensions.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/TaskRunsOperationsExtensions.cs index 4efe3e6a9a40..fec07a3cc13a 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/TaskRunsOperationsExtensions.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/TaskRunsOperationsExtensions.cs @@ -33,7 +33,7 @@ public static partial class TaskRunsOperationsExtensions /// The name of the container registry. /// /// - /// The run request name. + /// The name of the task run. /// public static TaskRun Get(this ITaskRunsOperations operations, string resourceGroupName, string registryName, string taskRunName) { @@ -53,7 +53,7 @@ public static TaskRun Get(this ITaskRunsOperations operations, string resourceGr /// The name of the container registry. /// /// - /// The run request name. + /// The name of the task run. /// /// /// The cancellation token. @@ -79,7 +79,7 @@ public static TaskRun Get(this ITaskRunsOperations operations, string resourceGr /// The name of the container registry. /// /// - /// The name of task run. + /// The name of the task run. /// /// /// The parameters of a run that needs to scheduled. @@ -102,7 +102,7 @@ public static TaskRun Create(this ITaskRunsOperations operations, string resourc /// The name of the container registry. /// /// - /// The name of task run. + /// The name of the task run. /// /// /// The parameters of a run that needs to scheduled. @@ -131,7 +131,7 @@ public static TaskRun Create(this ITaskRunsOperations operations, string resourc /// The name of the container registry. /// /// - /// The task run name. + /// The name of the task run. /// public static void Delete(this ITaskRunsOperations operations, string resourceGroupName, string registryName, string taskRunName) { @@ -151,7 +151,7 @@ public static void Delete(this ITaskRunsOperations operations, string resourceGr /// The name of the container registry. /// /// - /// The task run name. + /// The name of the task run. /// /// /// The cancellation token. @@ -174,7 +174,7 @@ public static void Delete(this ITaskRunsOperations operations, string resourceGr /// The name of the container registry. /// /// - /// The task run name. + /// The name of the task run. /// /// /// The parameters for updating a task run. @@ -197,7 +197,7 @@ public static TaskRun Update(this ITaskRunsOperations operations, string resourc /// The name of the container registry. /// /// - /// The task run name. + /// The name of the task run. /// /// /// The parameters for updating a task run. @@ -227,7 +227,7 @@ public static TaskRun Update(this ITaskRunsOperations operations, string resourc /// The name of the container registry. /// /// - /// The run request name. + /// The name of the task run. /// public static TaskRun GetDetails(this ITaskRunsOperations operations, string resourceGroupName, string registryName, string taskRunName) { @@ -248,7 +248,7 @@ public static TaskRun GetDetails(this ITaskRunsOperations operations, string res /// The name of the container registry. /// /// - /// The run request name. + /// The name of the task run. /// /// /// The cancellation token. @@ -314,7 +314,7 @@ public static IPage List(this ITaskRunsOperations operations, string re /// The name of the container registry. /// /// - /// The name of task run. + /// The name of the task run. /// /// /// The parameters of a run that needs to scheduled. @@ -337,7 +337,7 @@ public static TaskRun BeginCreate(this ITaskRunsOperations operations, string re /// The name of the container registry. /// /// - /// The name of task run. + /// The name of the task run. /// /// /// The parameters of a run that needs to scheduled. @@ -366,7 +366,7 @@ public static TaskRun BeginCreate(this ITaskRunsOperations operations, string re /// The name of the container registry. /// /// - /// The task run name. + /// The name of the task run. /// public static void BeginDelete(this ITaskRunsOperations operations, string resourceGroupName, string registryName, string taskRunName) { @@ -386,7 +386,7 @@ public static void BeginDelete(this ITaskRunsOperations operations, string resou /// The name of the container registry. /// /// - /// The task run name. + /// The name of the task run. /// /// /// The cancellation token. @@ -409,7 +409,7 @@ public static void BeginDelete(this ITaskRunsOperations operations, string resou /// The name of the container registry. /// /// - /// The task run name. + /// The name of the task run. /// /// /// The parameters for updating a task run. @@ -432,7 +432,7 @@ public static TaskRun BeginUpdate(this ITaskRunsOperations operations, string re /// The name of the container registry. /// /// - /// The task run name. + /// The name of the task run. /// /// /// The parameters for updating a task run. diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/TokensOperations.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/TokensOperations.cs deleted file mode 100644 index 02b13a6f7ee1..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/TokensOperations.cs +++ /dev/null @@ -1,1526 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.ContainerRegistry -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - - /// - /// TokensOperations operations. - /// - internal partial class TokensOperations : IServiceOperations, ITokensOperations - { - /// - /// Initializes a new instance of the TokensOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal TokensOperations(ContainerRegistryManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the ContainerRegistryManagementClient - /// - public ContainerRegistryManagementClient Client { get; private set; } - - /// - /// Gets the properties of the specified token. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the token. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string registryName, string tokenName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - } - if (registryName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "registryName"); - } - if (registryName != null) - { - if (registryName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "registryName", 50); - } - if (registryName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "registryName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(registryName, "^[a-zA-Z0-9]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); - } - } - if (tokenName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "tokenName"); - } - if (tokenName != null) - { - if (tokenName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "tokenName", 50); - } - if (tokenName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "tokenName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(tokenName, "^[a-zA-Z0-9-]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "tokenName", "^[a-zA-Z0-9-]*$"); - } - } - string apiVersion = "2019-05-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("registryName", registryName); - tracingParameters.Add("tokenName", tokenName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tokens/{tokenName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); - _url = _url.Replace("{tokenName}", System.Uri.EscapeDataString(tokenName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Creates a token for a container registry with the specified parameters. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the token. - /// - /// - /// The parameters for creating a token. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string registryName, string tokenName, Token tokenCreateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, registryName, tokenName, tokenCreateParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes a token from a container registry. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the token. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string tokenName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, registryName, tokenName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Updates a token with the specified parameters. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the token. - /// - /// - /// The parameters for updating a token. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, string tokenName, TokenUpdateParameters tokenUpdateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, registryName, tokenName, tokenUpdateParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Lists all the tokens for the specified container registry. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - } - if (registryName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "registryName"); - } - if (registryName != null) - { - if (registryName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "registryName", 50); - } - if (registryName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "registryName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(registryName, "^[a-zA-Z0-9]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); - } - } - string apiVersion = "2019-05-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("registryName", registryName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tokens").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Creates a token for a container registry with the specified parameters. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the token. - /// - /// - /// The parameters for creating a token. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string registryName, string tokenName, Token tokenCreateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - } - if (registryName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "registryName"); - } - if (registryName != null) - { - if (registryName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "registryName", 50); - } - if (registryName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "registryName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(registryName, "^[a-zA-Z0-9]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); - } - } - if (tokenName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "tokenName"); - } - if (tokenName != null) - { - if (tokenName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "tokenName", 50); - } - if (tokenName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "tokenName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(tokenName, "^[a-zA-Z0-9-]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "tokenName", "^[a-zA-Z0-9-]*$"); - } - } - if (tokenCreateParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "tokenCreateParameters"); - } - string apiVersion = "2019-05-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("registryName", registryName); - tracingParameters.Add("tokenName", tokenName); - tracingParameters.Add("tokenCreateParameters", tokenCreateParameters); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tokens/{tokenName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); - _url = _url.Replace("{tokenName}", System.Uri.EscapeDataString(tokenName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(tokenCreateParameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(tokenCreateParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Deletes a token from a container registry. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the token. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string tokenName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - } - if (registryName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "registryName"); - } - if (registryName != null) - { - if (registryName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "registryName", 50); - } - if (registryName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "registryName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(registryName, "^[a-zA-Z0-9]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); - } - } - if (tokenName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "tokenName"); - } - if (tokenName != null) - { - if (tokenName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "tokenName", 50); - } - if (tokenName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "tokenName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(tokenName, "^[a-zA-Z0-9-]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "tokenName", "^[a-zA-Z0-9-]*$"); - } - } - string apiVersion = "2019-05-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("registryName", registryName); - tracingParameters.Add("tokenName", tokenName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tokens/{tokenName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); - _url = _url.Replace("{tokenName}", System.Uri.EscapeDataString(tokenName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Updates a token with the specified parameters. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the token. - /// - /// - /// The parameters for updating a token. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, string tokenName, TokenUpdateParameters tokenUpdateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - } - if (registryName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "registryName"); - } - if (registryName != null) - { - if (registryName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "registryName", 50); - } - if (registryName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "registryName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(registryName, "^[a-zA-Z0-9]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); - } - } - if (tokenName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "tokenName"); - } - if (tokenName != null) - { - if (tokenName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "tokenName", 50); - } - if (tokenName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "tokenName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(tokenName, "^[a-zA-Z0-9-]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "tokenName", "^[a-zA-Z0-9-]*$"); - } - } - if (tokenUpdateParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "tokenUpdateParameters"); - } - string apiVersion = "2019-05-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("registryName", registryName); - tracingParameters.Add("tokenName", tokenName); - tracingParameters.Add("tokenUpdateParameters", tokenUpdateParameters); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tokens/{tokenName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); - _url = _url.Replace("{tokenName}", System.Uri.EscapeDataString(tokenName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(tokenUpdateParameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(tokenUpdateParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Lists all the tokens for the specified container registry. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (nextPageLink == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/TokensOperationsExtensions.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/TokensOperationsExtensions.cs deleted file mode 100644 index 1624952dc581..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/TokensOperationsExtensions.cs +++ /dev/null @@ -1,438 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.ContainerRegistry -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - - /// - /// Extension methods for TokensOperations. - /// - public static partial class TokensOperationsExtensions - { - /// - /// Gets the properties of the specified token. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the token. - /// - public static Token Get(this ITokensOperations operations, string resourceGroupName, string registryName, string tokenName) - { - return operations.GetAsync(resourceGroupName, registryName, tokenName).GetAwaiter().GetResult(); - } - - /// - /// Gets the properties of the specified token. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the token. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task GetAsync(this ITokensOperations operations, string resourceGroupName, string registryName, string tokenName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, registryName, tokenName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates a token for a container registry with the specified parameters. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the token. - /// - /// - /// The parameters for creating a token. - /// - public static Token Create(this ITokensOperations operations, string resourceGroupName, string registryName, string tokenName, Token tokenCreateParameters) - { - return operations.CreateAsync(resourceGroupName, registryName, tokenName, tokenCreateParameters).GetAwaiter().GetResult(); - } - - /// - /// Creates a token for a container registry with the specified parameters. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the token. - /// - /// - /// The parameters for creating a token. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task CreateAsync(this ITokensOperations operations, string resourceGroupName, string registryName, string tokenName, Token tokenCreateParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, registryName, tokenName, tokenCreateParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a token from a container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the token. - /// - public static void Delete(this ITokensOperations operations, string resourceGroupName, string registryName, string tokenName) - { - operations.DeleteAsync(resourceGroupName, registryName, tokenName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a token from a container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the token. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task DeleteAsync(this ITokensOperations operations, string resourceGroupName, string registryName, string tokenName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, registryName, tokenName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Updates a token with the specified parameters. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the token. - /// - /// - /// The parameters for updating a token. - /// - public static Token Update(this ITokensOperations operations, string resourceGroupName, string registryName, string tokenName, TokenUpdateParameters tokenUpdateParameters) - { - return operations.UpdateAsync(resourceGroupName, registryName, tokenName, tokenUpdateParameters).GetAwaiter().GetResult(); - } - - /// - /// Updates a token with the specified parameters. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the token. - /// - /// - /// The parameters for updating a token. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task UpdateAsync(this ITokensOperations operations, string resourceGroupName, string registryName, string tokenName, TokenUpdateParameters tokenUpdateParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, registryName, tokenName, tokenUpdateParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all the tokens for the specified container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - public static IPage List(this ITokensOperations operations, string resourceGroupName, string registryName) - { - return operations.ListAsync(resourceGroupName, registryName).GetAwaiter().GetResult(); - } - - /// - /// Lists all the tokens for the specified container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task> ListAsync(this ITokensOperations operations, string resourceGroupName, string registryName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, registryName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates a token for a container registry with the specified parameters. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the token. - /// - /// - /// The parameters for creating a token. - /// - public static Token BeginCreate(this ITokensOperations operations, string resourceGroupName, string registryName, string tokenName, Token tokenCreateParameters) - { - return operations.BeginCreateAsync(resourceGroupName, registryName, tokenName, tokenCreateParameters).GetAwaiter().GetResult(); - } - - /// - /// Creates a token for a container registry with the specified parameters. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the token. - /// - /// - /// The parameters for creating a token. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task BeginCreateAsync(this ITokensOperations operations, string resourceGroupName, string registryName, string tokenName, Token tokenCreateParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateWithHttpMessagesAsync(resourceGroupName, registryName, tokenName, tokenCreateParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a token from a container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the token. - /// - public static void BeginDelete(this ITokensOperations operations, string resourceGroupName, string registryName, string tokenName) - { - operations.BeginDeleteAsync(resourceGroupName, registryName, tokenName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a token from a container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the token. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task BeginDeleteAsync(this ITokensOperations operations, string resourceGroupName, string registryName, string tokenName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, registryName, tokenName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Updates a token with the specified parameters. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the token. - /// - /// - /// The parameters for updating a token. - /// - public static Token BeginUpdate(this ITokensOperations operations, string resourceGroupName, string registryName, string tokenName, TokenUpdateParameters tokenUpdateParameters) - { - return operations.BeginUpdateAsync(resourceGroupName, registryName, tokenName, tokenUpdateParameters).GetAwaiter().GetResult(); - } - - /// - /// Updates a token with the specified parameters. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the token. - /// - /// - /// The parameters for updating a token. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task BeginUpdateAsync(this ITokensOperations operations, string resourceGroupName, string registryName, string tokenName, TokenUpdateParameters tokenUpdateParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, registryName, tokenName, tokenUpdateParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all the tokens for the specified container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this ITokensOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all the tokens for the specified container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task> ListNextAsync(this ITokensOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/WebhooksOperations.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/WebhooksOperations.cs index 8a23327004e6..89d9a0592f9b 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/WebhooksOperations.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/WebhooksOperations.cs @@ -50,7 +50,7 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) public ContainerRegistryManagementClient Client { get; private set; } /// - /// Gets the properties of the specified webhook. + /// Lists all the webhooks for the specified container registry. /// /// /// The name of the resource group to which the container registry belongs. @@ -58,9 +58,6 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) /// /// The name of the container registry. /// - /// - /// The name of the webhook. - /// /// /// Headers that will be added to request. /// @@ -82,7 +79,7 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string registryName, string webhookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -118,26 +115,7 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); } } - if (webhookName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "webhookName"); - } - if (webhookName != null) - { - if (webhookName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "webhookName", 50); - } - if (webhookName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "webhookName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(webhookName, "^[a-zA-Z0-9]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "webhookName", "^[a-zA-Z0-9]*$"); - } - } - string apiVersion = "2019-12-01-preview"; + string apiVersion = "2021-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -148,17 +126,15 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("registryName", registryName); - tracingParameters.Add("webhookName", webhookName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); - _url = _url.Replace("{webhookName}", System.Uri.EscapeDataString(webhookName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -257,7 +233,7 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -270,7 +246,7 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -290,60 +266,7 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) } /// - /// Creates a webhook for a container registry with the specified parameters. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the webhook. - /// - /// - /// The parameters for creating a webhook. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string registryName, string webhookName, WebhookCreateParameters webhookCreateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes a webhook from a container registry. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the webhook. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string webhookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, registryName, webhookName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Updates a webhook with the specified parameters. + /// Gets the properties of the specified webhook. /// /// /// The name of the resource group to which the container registry belongs. @@ -354,31 +277,6 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) /// /// The name of the webhook. /// - /// - /// The parameters for updating a webhook. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, string webhookName, WebhookUpdateParameters webhookUpdateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Lists all the webhooks for the specified container registry. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// /// /// Headers that will be added to request. /// @@ -400,7 +298,7 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string registryName, string webhookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -436,7 +334,26 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2019-12-01-preview"; + if (webhookName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "webhookName"); + } + if (webhookName != null) + { + if (webhookName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "webhookName", 50); + } + if (webhookName.Length < 5) + { + throw new ValidationException(ValidationRules.MinLength, "webhookName", 5); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(webhookName, "^[a-zA-Z0-9]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "webhookName", "^[a-zA-Z0-9]*$"); + } + } + string apiVersion = "2021-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -447,15 +364,17 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("registryName", registryName); + tracingParameters.Add("webhookName", webhookName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); + _url = _url.Replace("{webhookName}", System.Uri.EscapeDataString(webhookName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -554,7 +473,7 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -567,7 +486,7 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -586,6 +505,87 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) return _result; } + /// + /// Creates a webhook for a container registry with the specified parameters. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the webhook. + /// + /// + /// The parameters for creating a webhook. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string registryName, string webhookName, WebhookCreateParameters webhookCreateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes a webhook from a container registry. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the webhook. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string webhookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, registryName, webhookName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Updates a webhook with the specified parameters. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the webhook. + /// + /// + /// The parameters for updating a webhook. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, string webhookName, WebhookUpdateParameters webhookUpdateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + /// /// Triggers a ping event to be sent to the webhook. /// @@ -674,7 +674,7 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "webhookName", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2019-12-01-preview"; + string apiVersion = "2021-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -827,7 +827,7 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) } /// - /// Gets the configuration of service URI and custom headers for the webhook. + /// Lists recent events for the specified webhook. /// /// /// The name of the resource group to which the container registry belongs. @@ -859,7 +859,7 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetCallbackConfigWithHttpMessagesAsync(string resourceGroupName, string registryName, string webhookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListEventsWithHttpMessagesAsync(string resourceGroupName, string registryName, string webhookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -914,7 +914,7 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "webhookName", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2019-12-01-preview"; + string apiVersion = "2021-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -927,11 +927,11 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) tracingParameters.Add("registryName", registryName); tracingParameters.Add("webhookName", webhookName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetCallbackConfig", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListEvents", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/getCallbackConfig").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/listEvents").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); @@ -1034,7 +1034,7 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1047,7 +1047,7 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1067,7 +1067,7 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) } /// - /// Lists recent events for the specified webhook. + /// Gets the configuration of service URI and custom headers for the webhook. /// /// /// The name of the resource group to which the container registry belongs. @@ -1099,7 +1099,7 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListEventsWithHttpMessagesAsync(string resourceGroupName, string registryName, string webhookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetCallbackConfigWithHttpMessagesAsync(string resourceGroupName, string registryName, string webhookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -1154,7 +1154,7 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "webhookName", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2019-12-01-preview"; + string apiVersion = "2021-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1167,11 +1167,11 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) tracingParameters.Add("registryName", registryName); tracingParameters.Add("webhookName", webhookName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListEvents", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetCallbackConfig", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/listEvents").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/getCallbackConfig").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); @@ -1274,7 +1274,7 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1287,7 +1287,7 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1405,7 +1405,7 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) { webhookCreateParameters.Validate(); } - string apiVersion = "2019-12-01-preview"; + string apiVersion = "2021-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1667,7 +1667,7 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "webhookName", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2019-12-01-preview"; + string apiVersion = "2021-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1896,7 +1896,7 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "webhookUpdateParameters"); } - string apiVersion = "2019-12-01-preview"; + string apiVersion = "2021-09-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/WebhooksOperationsExtensions.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/WebhooksOperationsExtensions.cs index ab2ddb4d590f..5413325cd010 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/WebhooksOperationsExtensions.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/WebhooksOperationsExtensions.cs @@ -20,6 +20,46 @@ namespace Microsoft.Azure.Management.ContainerRegistry /// public static partial class WebhooksOperationsExtensions { + /// + /// Lists all the webhooks for the specified container registry. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + public static IPage List(this IWebhooksOperations operations, string resourceGroupName, string registryName) + { + return operations.ListAsync(resourceGroupName, registryName).GetAwaiter().GetResult(); + } + + /// + /// Lists all the webhooks for the specified container registry. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IWebhooksOperations operations, string resourceGroupName, string registryName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, registryName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Gets the properties of the specified webhook. /// @@ -213,46 +253,6 @@ public static Webhook Update(this IWebhooksOperations operations, string resourc } } - /// - /// Lists all the webhooks for the specified container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - public static IPage List(this IWebhooksOperations operations, string resourceGroupName, string registryName) - { - return operations.ListAsync(resourceGroupName, registryName).GetAwaiter().GetResult(); - } - - /// - /// Lists all the webhooks for the specified container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task> ListAsync(this IWebhooksOperations operations, string resourceGroupName, string registryName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, registryName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Triggers a ping event to be sent to the webhook. /// @@ -300,7 +300,7 @@ public static EventInfo Ping(this IWebhooksOperations operations, string resourc } /// - /// Gets the configuration of service URI and custom headers for the webhook. + /// Lists recent events for the specified webhook. /// /// /// The operations group for this extension method. @@ -314,13 +314,13 @@ public static EventInfo Ping(this IWebhooksOperations operations, string resourc /// /// The name of the webhook. /// - public static CallbackConfig GetCallbackConfig(this IWebhooksOperations operations, string resourceGroupName, string registryName, string webhookName) + public static IPage ListEvents(this IWebhooksOperations operations, string resourceGroupName, string registryName, string webhookName) { - return operations.GetCallbackConfigAsync(resourceGroupName, registryName, webhookName).GetAwaiter().GetResult(); + return operations.ListEventsAsync(resourceGroupName, registryName, webhookName).GetAwaiter().GetResult(); } /// - /// Gets the configuration of service URI and custom headers for the webhook. + /// Lists recent events for the specified webhook. /// /// /// The operations group for this extension method. @@ -337,16 +337,16 @@ public static CallbackConfig GetCallbackConfig(this IWebhooksOperations operatio /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetCallbackConfigAsync(this IWebhooksOperations operations, string resourceGroupName, string registryName, string webhookName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task> ListEventsAsync(this IWebhooksOperations operations, string resourceGroupName, string registryName, string webhookName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetCallbackConfigWithHttpMessagesAsync(resourceGroupName, registryName, webhookName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListEventsWithHttpMessagesAsync(resourceGroupName, registryName, webhookName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Lists recent events for the specified webhook. + /// Gets the configuration of service URI and custom headers for the webhook. /// /// /// The operations group for this extension method. @@ -360,13 +360,13 @@ public static CallbackConfig GetCallbackConfig(this IWebhooksOperations operatio /// /// The name of the webhook. /// - public static IPage ListEvents(this IWebhooksOperations operations, string resourceGroupName, string registryName, string webhookName) + public static CallbackConfig GetCallbackConfig(this IWebhooksOperations operations, string resourceGroupName, string registryName, string webhookName) { - return operations.ListEventsAsync(resourceGroupName, registryName, webhookName).GetAwaiter().GetResult(); + return operations.GetCallbackConfigAsync(resourceGroupName, registryName, webhookName).GetAwaiter().GetResult(); } /// - /// Lists recent events for the specified webhook. + /// Gets the configuration of service URI and custom headers for the webhook. /// /// /// The operations group for this extension method. @@ -383,9 +383,9 @@ public static IPage ListEvents(this IWebhooksOperations operations, /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListEventsAsync(this IWebhooksOperations operations, string resourceGroupName, string registryName, string webhookName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task GetCallbackConfigAsync(this IWebhooksOperations operations, string resourceGroupName, string registryName, string webhookName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListEventsWithHttpMessagesAsync(resourceGroupName, registryName, webhookName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetCallbackConfigWithHttpMessagesAsync(resourceGroupName, registryName, webhookName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; }