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 b8f5a8bb5e92..d79265e418e2 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ContainerRegistryManagementClient.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ContainerRegistryManagementClient.cs @@ -48,6 +48,11 @@ public partial class ContainerRegistryManagementClient : ServiceClient public string SubscriptionId { get; set; } + /// + /// The client API version. + /// + public string ApiVersion { get; private set; } + /// /// The preferred language for the response. /// @@ -86,16 +91,6 @@ public partial class ContainerRegistryManagementClient : ServiceClient public virtual IWebhooksOperations Webhooks { get; private set; } - /// - /// Gets the IRunsOperations. - /// - public virtual IRunsOperations Runs { get; private set; } - - /// - /// Gets the ITasksOperations. - /// - public virtual ITasksOperations Tasks { get; private set; } - /// /// Initializes a new instance of the ContainerRegistryManagementClient class. /// @@ -341,9 +336,8 @@ private void Initialize() Operations = new Operations(this); Replications = new ReplicationsOperations(this); Webhooks = new WebhooksOperations(this); - Runs = new RunsOperations(this); - Tasks = new TasksOperations(this); BaseUri = new System.Uri("https://management.azure.com"); + ApiVersion = "2019-12-01-preview"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; @@ -373,12 +367,6 @@ private void Initialize() new Iso8601TimeSpanConverter() } }; - SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("type")); - DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); - SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("type")); - DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); - SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("type")); - DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); CustomInitialize(); DeserializationSettings.Converters.Add(new TransformationJsonConverter()); DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); 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 e245c6061829..78b1eb478a5f 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IContainerRegistryManagementClient.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IContainerRegistryManagementClient.cs @@ -44,6 +44,11 @@ public partial interface IContainerRegistryManagementClient : System.IDisposable /// string SubscriptionId { get; set; } + /// + /// The client API version. + /// + string ApiVersion { get; } + /// /// The preferred language for the response. /// @@ -83,15 +88,5 @@ public partial interface IContainerRegistryManagementClient : System.IDisposable /// IWebhooksOperations Webhooks { get; } - /// - /// Gets the IRunsOperations. - /// - IRunsOperations Runs { get; } - - /// - /// Gets the ITasksOperations. - /// - ITasksOperations Tasks { get; } - } } 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 4c90452f8283..3fddf91f397c 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IRegistriesOperations.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IRegistriesOperations.cs @@ -310,63 +310,6 @@ public partial interface IRegistriesOperations /// System.Threading.Tasks.Task> ListUsagesWithHttpMessagesAsync(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. - /// - /// - /// The name of the resource group to which the container registry - /// belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The parameters of a run that needs to scheduled. - /// - /// - /// The 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> ScheduleRunWithHttpMessagesAsync(string resourceGroupName, string registryName, RunRequest runRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// 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 - /// 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> GetBuildSourceUploadUrlWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Copies an image to this container registry from the specified /// container registry. /// @@ -476,36 +419,6 @@ public partial interface IRegistriesOperations /// System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, RegistryUpdateParameters registryUpdateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// 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 - /// belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The parameters of a run that needs to scheduled. - /// - /// - /// 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> BeginScheduleRunWithHttpMessagesAsync(string resourceGroupName, string registryName, RunRequest runRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Lists all the container registries under the specified resource /// group. /// diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IRunsOperations.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IRunsOperations.cs deleted file mode 100644 index b3e05481a630..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IRunsOperations.cs +++ /dev/null @@ -1,252 +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 Microsoft.Rest.Azure.OData; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - - /// - /// RunsOperations operations. - /// - public partial interface IRunsOperations - { - /// - /// Gets all the runs for a registry. - /// - /// - /// The name of the resource group to which the container registry - /// belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// OData parameters to apply to the 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>> ListWithHttpMessagesAsync(string resourceGroupName, string registryName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets the detailed information for a given run. - /// - /// - /// The name of the resource group to which the container registry - /// belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The run ID. - /// - /// - /// 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 runId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Patch the run properties. - /// - /// - /// The name of the resource group to which the container registry - /// belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The run ID. - /// - /// - /// The value that indicates whether archiving is enabled or not. - /// - /// - /// 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 runId, bool? isArchiveEnabled = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets a link to download the run logs. - /// - /// - /// The name of the resource group to which the container registry - /// belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The run ID. - /// - /// - /// 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> GetLogSasUrlWithHttpMessagesAsync(string resourceGroupName, string registryName, string runId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Cancel an existing run. - /// - /// - /// The name of the resource group to which the container registry - /// belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The run ID. - /// - /// - /// 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 CancelWithHttpMessagesAsync(string resourceGroupName, string registryName, string runId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Patch the run properties. - /// - /// - /// The name of the resource group to which the container registry - /// belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The run ID. - /// - /// - /// The value that indicates whether archiving is enabled or not. - /// - /// - /// 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 runId, bool? isArchiveEnabled = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Cancel an existing run. - /// - /// - /// The name of the resource group to which the container registry - /// belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The run ID. - /// - /// - /// 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 BeginCancelWithHttpMessagesAsync(string resourceGroupName, string registryName, string runId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets all the runs for a 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/ITasksOperations.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ITasksOperations.cs deleted file mode 100644 index 02c631b70494..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ITasksOperations.cs +++ /dev/null @@ -1,314 +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; - - /// - /// TasksOperations operations. - /// - public partial interface ITasksOperations - { - /// - /// Lists all the tasks for a 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)); - /// - /// Get the properties of a specified task. - /// - /// - /// The name of the resource group to which the container registry - /// belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the container registry task. - /// - /// - /// The 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 taskName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates a task 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 container registry task. - /// - /// - /// The parameters for creating a task. - /// - /// - /// 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 taskName, Task taskCreateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes a specified task. - /// - /// - /// The name of the resource group to which the container registry - /// belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the container registry task. - /// - /// - /// The 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 taskName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Updates a task 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 container registry task. - /// - /// - /// The parameters for updating a task. - /// - /// - /// 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 taskName, TaskUpdateParameters taskUpdateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Returns a task with extended information that includes all secrets. - /// - /// - /// The name of the resource group to which the container registry - /// belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the container registry task. - /// - /// - /// The 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> GetDetailsWithHttpMessagesAsync(string resourceGroupName, string registryName, string taskName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates a task 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 container registry task. - /// - /// - /// The parameters for creating a task. - /// - /// - /// 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 taskName, Task taskCreateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes a specified task. - /// - /// - /// The name of the resource group to which the container registry - /// belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the container registry task. - /// - /// - /// The 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 taskName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Updates a task 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 container registry task. - /// - /// - /// The parameters for updating a task. - /// - /// - /// 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 taskName, TaskUpdateParameters taskUpdateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists all the tasks for a 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/Models/AgentProperties.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/AgentProperties.cs deleted file mode 100644 index bcff3e94e691..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/AgentProperties.cs +++ /dev/null @@ -1,53 +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 that determine the run agent configuration. - /// - public partial class AgentProperties - { - /// - /// Initializes a new instance of the AgentProperties class. - /// - public AgentProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the AgentProperties class. - /// - /// The CPU configuration in terms of number of cores - /// required for the run. - public AgentProperties(int? cpu = default(int?)) - { - Cpu = cpu; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the CPU configuration in terms of number of cores - /// required for the run. - /// - [JsonProperty(PropertyName = "cpu")] - public int? Cpu { get; set; } - - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Architecture.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Architecture.cs deleted file mode 100644 index a05be7c8983a..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Architecture.cs +++ /dev/null @@ -1,25 +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 Architecture. - /// - public static class Architecture - { - public const string Amd64 = "amd64"; - public const string X86 = "x86"; - public const string ThreeEightSix = "386"; - public const string Arm = "arm"; - public const string Arm64 = "arm64"; - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Argument.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Argument.cs deleted file mode 100644 index 062e04c31685..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Argument.cs +++ /dev/null @@ -1,87 +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 a run argument. - /// - public partial class Argument - { - /// - /// Initializes a new instance of the Argument class. - /// - public Argument() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Argument class. - /// - /// The name of the argument. - /// The value of the argument. - /// Flag to indicate whether the argument - /// represents a secret and want to be removed from build logs. - public Argument(string name, string value, bool? isSecret = default(bool?)) - { - Name = name; - Value = value; - IsSecret = isSecret; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of the argument. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets the value of the argument. - /// - [JsonProperty(PropertyName = "value")] - public string Value { get; set; } - - /// - /// Gets or sets flag to indicate whether the argument represents a - /// secret and want to be removed from build logs. - /// - [JsonProperty(PropertyName = "isSecret")] - public bool? IsSecret { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); - } - if (Value == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Value"); - } - } - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/AuthInfo.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/AuthInfo.cs deleted file mode 100644 index 07d63c7ad03f..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/AuthInfo.cs +++ /dev/null @@ -1,107 +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 authorization properties for accessing the source code repository. - /// - public partial class AuthInfo - { - /// - /// Initializes a new instance of the AuthInfo class. - /// - public AuthInfo() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the AuthInfo class. - /// - /// The type of Auth token. Possible values - /// include: 'PAT', 'OAuth' - /// The access token used to access the source - /// control provider. - /// The refresh token used to refresh the - /// access token. - /// The scope of the access token. - /// Time in seconds that the token remains - /// valid - public AuthInfo(string tokenType, string token, string refreshToken = default(string), string scope = default(string), int? expiresIn = default(int?)) - { - TokenType = tokenType; - Token = token; - RefreshToken = refreshToken; - Scope = scope; - ExpiresIn = expiresIn; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the type of Auth token. Possible values include: - /// 'PAT', 'OAuth' - /// - [JsonProperty(PropertyName = "tokenType")] - public string TokenType { get; set; } - - /// - /// Gets or sets the access token used to access the source control - /// provider. - /// - [JsonProperty(PropertyName = "token")] - public string Token { get; set; } - - /// - /// Gets or sets the refresh token used to refresh the access token. - /// - [JsonProperty(PropertyName = "refreshToken")] - public string RefreshToken { get; set; } - - /// - /// Gets or sets the scope of the access token. - /// - [JsonProperty(PropertyName = "scope")] - public string Scope { get; set; } - - /// - /// Gets or sets time in seconds that the token remains valid - /// - [JsonProperty(PropertyName = "expiresIn")] - public int? ExpiresIn { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (TokenType == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "TokenType"); - } - if (Token == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Token"); - } - } - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/AuthInfoUpdateParameters.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/AuthInfoUpdateParameters.cs deleted file mode 100644 index 06ef9043d09c..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/AuthInfoUpdateParameters.cs +++ /dev/null @@ -1,89 +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 authorization properties for accessing the source code repository. - /// - public partial class AuthInfoUpdateParameters - { - /// - /// Initializes a new instance of the AuthInfoUpdateParameters class. - /// - public AuthInfoUpdateParameters() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the AuthInfoUpdateParameters class. - /// - /// The type of Auth token. Possible values - /// include: 'PAT', 'OAuth' - /// The access token used to access the source - /// control provider. - /// The refresh token used to refresh the - /// access token. - /// The scope of the access token. - /// Time in seconds that the token remains - /// valid - public AuthInfoUpdateParameters(string tokenType = default(string), string token = default(string), string refreshToken = default(string), string scope = default(string), int? expiresIn = default(int?)) - { - TokenType = tokenType; - Token = token; - RefreshToken = refreshToken; - Scope = scope; - ExpiresIn = expiresIn; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the type of Auth token. Possible values include: - /// 'PAT', 'OAuth' - /// - [JsonProperty(PropertyName = "tokenType")] - public string TokenType { get; set; } - - /// - /// Gets or sets the access token used to access the source control - /// provider. - /// - [JsonProperty(PropertyName = "token")] - public string Token { get; set; } - - /// - /// Gets or sets the refresh token used to refresh the access token. - /// - [JsonProperty(PropertyName = "refreshToken")] - public string RefreshToken { get; set; } - - /// - /// Gets or sets the scope of the access token. - /// - [JsonProperty(PropertyName = "scope")] - public string Scope { get; set; } - - /// - /// Gets or sets time in seconds that the token remains valid - /// - [JsonProperty(PropertyName = "expiresIn")] - public int? ExpiresIn { get; set; } - - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/BaseImageDependency.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/BaseImageDependency.cs deleted file mode 100644 index d9ba2aeba66d..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/BaseImageDependency.cs +++ /dev/null @@ -1,86 +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; - - /// - /// Properties that describe a base image dependency. - /// - public partial class BaseImageDependency - { - /// - /// Initializes a new instance of the BaseImageDependency class. - /// - public BaseImageDependency() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the BaseImageDependency class. - /// - /// The type of the base image dependency. Possible - /// values include: 'BuildTime', 'RunTime' - /// The registry login server. - /// The repository name. - /// The tag name. - /// The sha256-based digest of the image - /// manifest. - public BaseImageDependency(string type = default(string), string registry = default(string), string repository = default(string), string tag = default(string), string digest = default(string)) - { - Type = type; - Registry = registry; - Repository = repository; - Tag = tag; - Digest = digest; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the type of the base image dependency. Possible values - /// include: 'BuildTime', 'RunTime' - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - - /// - /// Gets or sets the registry login server. - /// - [JsonProperty(PropertyName = "registry")] - public string Registry { get; set; } - - /// - /// Gets or sets the repository name. - /// - [JsonProperty(PropertyName = "repository")] - public string Repository { get; set; } - - /// - /// Gets or sets the tag name. - /// - [JsonProperty(PropertyName = "tag")] - public string Tag { get; set; } - - /// - /// Gets or sets the sha256-based digest of the image manifest. - /// - [JsonProperty(PropertyName = "digest")] - public string Digest { get; set; } - - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/BaseImageDependencyType.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/BaseImageDependencyType.cs deleted file mode 100644 index 6ed6a272dd3c..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/BaseImageDependencyType.cs +++ /dev/null @@ -1,22 +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 BaseImageDependencyType. - /// - public static class BaseImageDependencyType - { - public const string BuildTime = "BuildTime"; - public const string RunTime = "RunTime"; - } -} 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 deleted file mode 100644 index 7d0a3d925649..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/BaseImageTrigger.cs +++ /dev/null @@ -1,110 +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 trigger based on base image dependency. - /// - public partial class BaseImageTrigger - { - /// - /// Initializes a new instance of the BaseImageTrigger class. - /// - public BaseImageTrigger() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the BaseImageTrigger class. - /// - /// The type of the auto trigger for - /// base image dependency updates. Possible values include: 'All', - /// 'Runtime' - /// The name of the trigger. - /// The endpoint URL for receiving - /// update triggers. - /// Type of Payload body for - /// Base image update triggers. Possible values include: 'Default', - /// 'Token' - /// The current status of trigger. Possible values - /// include: 'Disabled', 'Enabled' - public BaseImageTrigger(string baseImageTriggerType, string name, string updateTriggerEndpoint = default(string), string updateTriggerPayloadType = default(string), string status = default(string)) - { - BaseImageTriggerType = baseImageTriggerType; - UpdateTriggerEndpoint = updateTriggerEndpoint; - UpdateTriggerPayloadType = updateTriggerPayloadType; - Status = status; - Name = name; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the type of the auto trigger for base image dependency - /// updates. Possible values include: 'All', 'Runtime' - /// - [JsonProperty(PropertyName = "baseImageTriggerType")] - public string BaseImageTriggerType { get; set; } - - /// - /// Gets or sets the endpoint URL for receiving update triggers. - /// - [JsonProperty(PropertyName = "updateTriggerEndpoint")] - public string UpdateTriggerEndpoint { get; set; } - - /// - /// Gets or sets type of Payload body for Base image update triggers. - /// Possible values include: 'Default', 'Token' - /// - [JsonProperty(PropertyName = "updateTriggerPayloadType")] - public string UpdateTriggerPayloadType { get; set; } - - /// - /// Gets or sets the current status of trigger. Possible values - /// include: 'Disabled', 'Enabled' - /// - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } - - /// - /// Gets or sets the name of the trigger. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (BaseImageTriggerType == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "BaseImageTriggerType"); - } - if (Name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); - } - } - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/BaseImageTriggerType.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/BaseImageTriggerType.cs deleted file mode 100644 index 5acfd504ba39..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/BaseImageTriggerType.cs +++ /dev/null @@ -1,22 +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 BaseImageTriggerType. - /// - public static class BaseImageTriggerType - { - public const string All = "All"; - public const string Runtime = "Runtime"; - } -} 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 deleted file mode 100644 index 15c9593a64a6..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/BaseImageTriggerUpdateParameters.cs +++ /dev/null @@ -1,108 +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 for updating base image dependency trigger. - /// - public partial class BaseImageTriggerUpdateParameters - { - /// - /// Initializes a new instance of the BaseImageTriggerUpdateParameters - /// class. - /// - public BaseImageTriggerUpdateParameters() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the BaseImageTriggerUpdateParameters - /// class. - /// - /// The name of the trigger. - /// The type of the auto trigger for - /// base image dependency updates. Possible values include: 'All', - /// 'Runtime' - /// The endpoint URL for receiving - /// update triggers. - /// Type of Payload body for - /// Base image update triggers. Possible values include: 'Default', - /// 'Token' - /// The current status of trigger. Possible values - /// 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; - UpdateTriggerEndpoint = updateTriggerEndpoint; - UpdateTriggerPayloadType = updateTriggerPayloadType; - Status = status; - Name = name; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the type of the auto trigger for base image dependency - /// updates. Possible values include: 'All', 'Runtime' - /// - [JsonProperty(PropertyName = "baseImageTriggerType")] - public string BaseImageTriggerType { get; set; } - - /// - /// Gets or sets the endpoint URL for receiving update triggers. - /// - [JsonProperty(PropertyName = "updateTriggerEndpoint")] - public string UpdateTriggerEndpoint { get; set; } - - /// - /// Gets or sets type of Payload body for Base image update triggers. - /// Possible values include: 'Default', 'Token' - /// - [JsonProperty(PropertyName = "updateTriggerPayloadType")] - public string UpdateTriggerPayloadType { get; set; } - - /// - /// Gets or sets the current status of trigger. Possible values - /// include: 'Disabled', 'Enabled' - /// - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } - - /// - /// Gets or sets the name of the trigger. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); - } - } - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Credentials.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Credentials.cs deleted file mode 100644 index 07776d7bc489..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Credentials.cs +++ /dev/null @@ -1,74 +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 parameters that describes a set of credentials that will be used - /// when a run is invoked. - /// - public partial class Credentials - { - /// - /// Initializes a new instance of the Credentials class. - /// - public Credentials() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Credentials class. - /// - /// Describes the credential parameters - /// for accessing the source registry. - /// Describes the credential parameters - /// for accessing other custom registries. The key - /// for the dictionary item will be the registry login server - /// (myregistry.azurecr.io) and - /// the value of the item will be the registry credentials for - /// accessing the registry. - public Credentials(SourceRegistryCredentials sourceRegistry = default(SourceRegistryCredentials), IDictionary customRegistries = default(IDictionary)) - { - SourceRegistry = sourceRegistry; - CustomRegistries = customRegistries; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets describes the credential parameters for accessing the - /// source registry. - /// - [JsonProperty(PropertyName = "sourceRegistry")] - public SourceRegistryCredentials SourceRegistry { get; set; } - - /// - /// Gets or sets describes the credential parameters for accessing - /// other custom registries. The key - /// for the dictionary item will be the registry login server - /// (myregistry.azurecr.io) and - /// the value of the item will be the registry credentials for - /// accessing the registry. - /// - [JsonProperty(PropertyName = "customRegistries")] - public IDictionary CustomRegistries { get; set; } - - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/CustomRegistryCredentials.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/CustomRegistryCredentials.cs deleted file mode 100644 index d9d86083d41c..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/CustomRegistryCredentials.cs +++ /dev/null @@ -1,90 +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; - - /// - /// Describes the credentials that will be used to access a custom registry - /// during a run. - /// - public partial class CustomRegistryCredentials - { - /// - /// Initializes a new instance of the CustomRegistryCredentials class. - /// - public CustomRegistryCredentials() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the CustomRegistryCredentials class. - /// - /// The username for logging into the custom - /// registry. - /// The password for logging into the custom - /// registry. The password is a secret - /// object that allows multiple ways of providing the value for - /// it. - /// Indicates the managed identity assigned to - /// the custom credential. If a user-assigned identity - /// this value is the Client ID. If a system-assigned identity, the - /// value will be `system`. In - /// the case of a system-assigned identity, the Client ID will be - /// determined by the runner. This - /// identity may be used to authenticate to key vault to retrieve - /// credentials or it may be the only - /// source of authentication used for accessing the registry. - public CustomRegistryCredentials(SecretObject userName = default(SecretObject), SecretObject password = default(SecretObject), string identity = default(string)) - { - UserName = userName; - Password = password; - Identity = identity; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the username for logging into the custom registry. - /// - [JsonProperty(PropertyName = "userName")] - public SecretObject UserName { get; set; } - - /// - /// Gets or sets the password for logging into the custom registry. The - /// password is a secret - /// object that allows multiple ways of providing the value for it. - /// - [JsonProperty(PropertyName = "password")] - public SecretObject Password { get; set; } - - /// - /// Gets or sets indicates the managed identity assigned to the custom - /// credential. If a user-assigned identity - /// this value is the Client ID. If a system-assigned identity, the - /// value will be `system`. In - /// the case of a system-assigned identity, the Client ID will be - /// determined by the runner. This - /// identity may be used to authenticate to key vault to retrieve - /// credentials or it may be the only - /// source of authentication used for accessing the registry. - /// - [JsonProperty(PropertyName = "identity")] - public string Identity { get; set; } - - } -} 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 deleted file mode 100644 index 5bc87940653b..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/DockerBuildRequest.cs +++ /dev/null @@ -1,199 +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.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The parameters for a docker quick build. - /// - public partial class DockerBuildRequest : RunRequest - { - /// - /// Initializes a new instance of the DockerBuildRequest class. - /// - public DockerBuildRequest() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the DockerBuildRequest class. - /// - /// The Docker file path relative to the - /// source location. - /// The platform properties against which the - /// run has to happen. - /// The value that indicates whether - /// archiving is enabled for the run or not. - /// The fully qualified image names including - /// the repository and tag. - /// The value of this property indicates - /// whether the image built should be pushed to the registry or - /// not. - /// The value of this property indicates whether - /// the image cache is enabled or not. - /// The name of the target build stage for the - /// docker build. - /// The collection of override arguments to be - /// used when executing the run. - /// Run timeout in seconds. - /// The machine configuration of the - /// run agent. - /// The URL(absolute or relative) of the - /// source context. It can be an URL to a tar or git repository. - /// If it is relative URL, the relative path should be obtained from - /// calling listBuildSourceUploadUrl API. - /// The properties that describes a set of - /// credentials that will be used when this run is invoked. - public DockerBuildRequest(string dockerFilePath, PlatformProperties platform, bool? isArchiveEnabled = default(bool?), 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) - { - ImageNames = imageNames; - IsPushEnabled = isPushEnabled; - NoCache = noCache; - DockerFilePath = dockerFilePath; - Target = target; - Arguments = arguments; - Timeout = timeout; - Platform = platform; - AgentConfiguration = agentConfiguration; - SourceLocation = sourceLocation; - Credentials = credentials; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the fully qualified image names including the - /// repository and tag. - /// - [JsonProperty(PropertyName = "imageNames")] - public IList ImageNames { get; set; } - - /// - /// Gets or sets the value of this property indicates whether the image - /// built should be pushed to the registry or not. - /// - [JsonProperty(PropertyName = "isPushEnabled")] - public bool? IsPushEnabled { get; set; } - - /// - /// Gets or sets the value of this property indicates whether the image - /// cache is enabled or not. - /// - [JsonProperty(PropertyName = "noCache")] - public bool? NoCache { get; set; } - - /// - /// Gets or sets the Docker file path relative to the source location. - /// - [JsonProperty(PropertyName = "dockerFilePath")] - public string DockerFilePath { get; set; } - - /// - /// Gets or sets the name of the target build stage for the docker - /// build. - /// - [JsonProperty(PropertyName = "target")] - public string Target { get; set; } - - /// - /// Gets or sets the collection of override arguments to be used when - /// executing the run. - /// - [JsonProperty(PropertyName = "arguments")] - public IList Arguments { get; set; } - - /// - /// Gets or sets run timeout in seconds. - /// - [JsonProperty(PropertyName = "timeout")] - public int? Timeout { get; set; } - - /// - /// Gets or sets the platform properties against which the run has to - /// happen. - /// - [JsonProperty(PropertyName = "platform")] - public PlatformProperties Platform { get; set; } - - /// - /// Gets or sets the machine configuration of the run agent. - /// - [JsonProperty(PropertyName = "agentConfiguration")] - public AgentProperties AgentConfiguration { get; set; } - - /// - /// Gets or sets the URL(absolute or relative) of the source context. - /// It can be an URL to a tar or git repository. - /// If it is relative URL, the relative path should be obtained from - /// calling listBuildSourceUploadUrl API. - /// - [JsonProperty(PropertyName = "sourceLocation")] - public string SourceLocation { get; set; } - - /// - /// Gets or sets the properties that describes a set of credentials - /// that will be used when this run is invoked. - /// - [JsonProperty(PropertyName = "credentials")] - public Credentials Credentials { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (DockerFilePath == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "DockerFilePath"); - } - if (Platform == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Platform"); - } - if (Arguments != null) - { - foreach (var element in Arguments) - { - if (element != null) - { - element.Validate(); - } - } - } - if (Timeout > 28800) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Timeout", 28800); - } - if (Timeout < 300) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Timeout", 300); - } - if (Platform != null) - { - Platform.Validate(); - } - } - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/DockerBuildStep.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/DockerBuildStep.cs deleted file mode 100644 index 988962d16bbe..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/DockerBuildStep.cs +++ /dev/null @@ -1,138 +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.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The Docker build step. - /// - [Newtonsoft.Json.JsonObject("Docker")] - public partial class DockerBuildStep : TaskStepProperties - { - /// - /// Initializes a new instance of the DockerBuildStep class. - /// - public DockerBuildStep() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the DockerBuildStep class. - /// - /// The Docker file path relative to the - /// source context. - /// List of base image dependencies - /// for a step. - /// The URL(absolute or relative) of the - /// source context for the task step. - /// The token (git PAT or SAS token of - /// storage account blob) associated with the context for a - /// step. - /// The fully qualified image names including - /// the repository and tag. - /// The value of this property indicates - /// whether the image built should be pushed to the registry or - /// not. - /// The value of this property indicates whether - /// the image cache is enabled or not. - /// The name of the target build stage for the - /// docker build. - /// The collection of override arguments to be - /// used when executing this build step. - public DockerBuildStep(string dockerFilePath, IList baseImageDependencies = default(IList), string contextPath = default(string), string contextAccessToken = default(string), IList imageNames = default(IList), bool? isPushEnabled = default(bool?), bool? noCache = default(bool?), string target = default(string), IList arguments = default(IList)) - : base(baseImageDependencies, contextPath, contextAccessToken) - { - ImageNames = imageNames; - IsPushEnabled = isPushEnabled; - NoCache = noCache; - DockerFilePath = dockerFilePath; - Target = target; - Arguments = arguments; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the fully qualified image names including the - /// repository and tag. - /// - [JsonProperty(PropertyName = "imageNames")] - public IList ImageNames { get; set; } - - /// - /// Gets or sets the value of this property indicates whether the image - /// built should be pushed to the registry or not. - /// - [JsonProperty(PropertyName = "isPushEnabled")] - public bool? IsPushEnabled { get; set; } - - /// - /// Gets or sets the value of this property indicates whether the image - /// cache is enabled or not. - /// - [JsonProperty(PropertyName = "noCache")] - public bool? NoCache { get; set; } - - /// - /// Gets or sets the Docker file path relative to the source context. - /// - [JsonProperty(PropertyName = "dockerFilePath")] - public string DockerFilePath { get; set; } - - /// - /// Gets or sets the name of the target build stage for the docker - /// build. - /// - [JsonProperty(PropertyName = "target")] - public string Target { get; set; } - - /// - /// Gets or sets the collection of override arguments to be used when - /// executing this build step. - /// - [JsonProperty(PropertyName = "arguments")] - public IList Arguments { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (DockerFilePath == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "DockerFilePath"); - } - if (Arguments != null) - { - foreach (var element in Arguments) - { - if (element != null) - { - element.Validate(); - } - } - } - } - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/DockerBuildStepUpdateParameters.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/DockerBuildStepUpdateParameters.cs deleted file mode 100644 index e39facf5dbf0..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/DockerBuildStepUpdateParameters.cs +++ /dev/null @@ -1,114 +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 for updating a docker build step. - /// - [Newtonsoft.Json.JsonObject("Docker")] - public partial class DockerBuildStepUpdateParameters : TaskStepUpdateParameters - { - /// - /// Initializes a new instance of the DockerBuildStepUpdateParameters - /// class. - /// - public DockerBuildStepUpdateParameters() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the DockerBuildStepUpdateParameters - /// class. - /// - /// The URL(absolute or relative) of the - /// source context for the task step. - /// The token (git PAT or SAS token of - /// storage account blob) associated with the context for a - /// step. - /// The fully qualified image names including - /// the repository and tag. - /// The value of this property indicates - /// whether the image built should be pushed to the registry or - /// not. - /// The value of this property indicates whether - /// the image cache is enabled or not. - /// The Docker file path relative to the - /// source context. - /// The collection of override arguments to be - /// used when executing this build step. - /// The name of the target build stage for the - /// docker build. - public DockerBuildStepUpdateParameters(string contextPath = default(string), string contextAccessToken = default(string), IList imageNames = default(IList), bool? isPushEnabled = default(bool?), bool? noCache = default(bool?), string dockerFilePath = default(string), IList arguments = default(IList), string target = default(string)) - : base(contextPath, contextAccessToken) - { - ImageNames = imageNames; - IsPushEnabled = isPushEnabled; - NoCache = noCache; - DockerFilePath = dockerFilePath; - Arguments = arguments; - Target = target; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the fully qualified image names including the - /// repository and tag. - /// - [JsonProperty(PropertyName = "imageNames")] - public IList ImageNames { get; set; } - - /// - /// Gets or sets the value of this property indicates whether the image - /// built should be pushed to the registry or not. - /// - [JsonProperty(PropertyName = "isPushEnabled")] - public bool? IsPushEnabled { get; set; } - - /// - /// Gets or sets the value of this property indicates whether the image - /// cache is enabled or not. - /// - [JsonProperty(PropertyName = "noCache")] - public bool? NoCache { get; set; } - - /// - /// Gets or sets the Docker file path relative to the source context. - /// - [JsonProperty(PropertyName = "dockerFilePath")] - public string DockerFilePath { get; set; } - - /// - /// Gets or sets the collection of override arguments to be used when - /// executing this build step. - /// - [JsonProperty(PropertyName = "arguments")] - public IList Arguments { get; set; } - - /// - /// Gets or sets the name of the target build stage for the docker - /// build. - /// - [JsonProperty(PropertyName = "target")] - public string Target { get; set; } - - } -} 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 deleted file mode 100644 index c910939bf762..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/EncodedTaskRunRequest.cs +++ /dev/null @@ -1,169 +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.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The parameters for a quick task run request. - /// - public partial class EncodedTaskRunRequest : RunRequest - { - /// - /// Initializes a new instance of the EncodedTaskRunRequest class. - /// - public EncodedTaskRunRequest() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EncodedTaskRunRequest class. - /// - /// Base64 encoded value of the - /// template/definition file content. - /// The platform properties against which the - /// run has to happen. - /// The value that indicates whether - /// archiving is enabled for the run or not. - /// Base64 encoded value of the - /// parameters/values file content. - /// The collection of overridable values that can - /// be passed when running a task. - /// Run timeout in seconds. - /// The machine configuration of the - /// run agent. - /// The URL(absolute or relative) of the - /// source context. It can be an URL to a tar or git repository. - /// If it is relative URL, the relative path should be obtained from - /// calling listBuildSourceUploadUrl API. - /// The properties that describes a set of - /// credentials that will be used when this run is invoked. - public EncodedTaskRunRequest(string encodedTaskContent, PlatformProperties platform, bool? isArchiveEnabled = default(bool?), 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) - { - EncodedTaskContent = encodedTaskContent; - EncodedValuesContent = encodedValuesContent; - Values = values; - Timeout = timeout; - Platform = platform; - AgentConfiguration = agentConfiguration; - SourceLocation = sourceLocation; - Credentials = credentials; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets base64 encoded value of the template/definition file - /// content. - /// - [JsonProperty(PropertyName = "encodedTaskContent")] - public string EncodedTaskContent { get; set; } - - /// - /// Gets or sets base64 encoded value of the parameters/values file - /// content. - /// - [JsonProperty(PropertyName = "encodedValuesContent")] - public string EncodedValuesContent { get; set; } - - /// - /// Gets or sets the collection of overridable values that can be - /// passed when running a task. - /// - [JsonProperty(PropertyName = "values")] - public IList Values { get; set; } - - /// - /// Gets or sets run timeout in seconds. - /// - [JsonProperty(PropertyName = "timeout")] - public int? Timeout { get; set; } - - /// - /// Gets or sets the platform properties against which the run has to - /// happen. - /// - [JsonProperty(PropertyName = "platform")] - public PlatformProperties Platform { get; set; } - - /// - /// Gets or sets the machine configuration of the run agent. - /// - [JsonProperty(PropertyName = "agentConfiguration")] - public AgentProperties AgentConfiguration { get; set; } - - /// - /// Gets or sets the URL(absolute or relative) of the source context. - /// It can be an URL to a tar or git repository. - /// If it is relative URL, the relative path should be obtained from - /// calling listBuildSourceUploadUrl API. - /// - [JsonProperty(PropertyName = "sourceLocation")] - public string SourceLocation { get; set; } - - /// - /// Gets or sets the properties that describes a set of credentials - /// that will be used when this run is invoked. - /// - [JsonProperty(PropertyName = "credentials")] - public Credentials Credentials { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (EncodedTaskContent == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "EncodedTaskContent"); - } - if (Platform == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Platform"); - } - if (Values != null) - { - foreach (var element in Values) - { - if (element != null) - { - element.Validate(); - } - } - } - if (Timeout > 28800) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Timeout", 28800); - } - if (Timeout < 300) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Timeout", 300); - } - if (Platform != null) - { - Platform.Validate(); - } - } - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/EncodedTaskStep.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/EncodedTaskStep.cs deleted file mode 100644 index 89e87a36a618..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/EncodedTaskStep.cs +++ /dev/null @@ -1,108 +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.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The properties of a encoded task step. - /// - [Newtonsoft.Json.JsonObject("EncodedTask")] - public partial class EncodedTaskStep : TaskStepProperties - { - /// - /// Initializes a new instance of the EncodedTaskStep class. - /// - public EncodedTaskStep() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EncodedTaskStep class. - /// - /// Base64 encoded value of the - /// template/definition file content. - /// List of base image dependencies - /// for a step. - /// The URL(absolute or relative) of the - /// source context for the task step. - /// The token (git PAT or SAS token of - /// storage account blob) associated with the context for a - /// step. - /// Base64 encoded value of the - /// parameters/values file content. - /// The collection of overridable values that can - /// be passed when running a task. - public EncodedTaskStep(string encodedTaskContent, IList baseImageDependencies = default(IList), string contextPath = default(string), string contextAccessToken = default(string), string encodedValuesContent = default(string), IList values = default(IList)) - : base(baseImageDependencies, contextPath, contextAccessToken) - { - EncodedTaskContent = encodedTaskContent; - EncodedValuesContent = encodedValuesContent; - Values = values; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets base64 encoded value of the template/definition file - /// content. - /// - [JsonProperty(PropertyName = "encodedTaskContent")] - public string EncodedTaskContent { get; set; } - - /// - /// Gets or sets base64 encoded value of the parameters/values file - /// content. - /// - [JsonProperty(PropertyName = "encodedValuesContent")] - public string EncodedValuesContent { get; set; } - - /// - /// Gets or sets the collection of overridable values that can be - /// passed when running a task. - /// - [JsonProperty(PropertyName = "values")] - public IList Values { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (EncodedTaskContent == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "EncodedTaskContent"); - } - if (Values != null) - { - foreach (var element in Values) - { - if (element != null) - { - element.Validate(); - } - } - } - } - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/EncodedTaskStepUpdateParameters.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/EncodedTaskStepUpdateParameters.cs deleted file mode 100644 index bbaceea2f41a..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/EncodedTaskStepUpdateParameters.cs +++ /dev/null @@ -1,84 +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 for updating encoded task step. - /// - [Newtonsoft.Json.JsonObject("EncodedTask")] - public partial class EncodedTaskStepUpdateParameters : TaskStepUpdateParameters - { - /// - /// Initializes a new instance of the EncodedTaskStepUpdateParameters - /// class. - /// - public EncodedTaskStepUpdateParameters() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EncodedTaskStepUpdateParameters - /// class. - /// - /// The URL(absolute or relative) of the - /// source context for the task step. - /// The token (git PAT or SAS token of - /// storage account blob) associated with the context for a - /// step. - /// Base64 encoded value of the - /// template/definition file content. - /// Base64 encoded value of the - /// parameters/values file content. - /// The collection of overridable values that can - /// be passed when running a task. - public EncodedTaskStepUpdateParameters(string contextPath = default(string), string contextAccessToken = default(string), string encodedTaskContent = default(string), string encodedValuesContent = default(string), IList values = default(IList)) - : base(contextPath, contextAccessToken) - { - EncodedTaskContent = encodedTaskContent; - EncodedValuesContent = encodedValuesContent; - Values = values; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets base64 encoded value of the template/definition file - /// content. - /// - [JsonProperty(PropertyName = "encodedTaskContent")] - public string EncodedTaskContent { get; set; } - - /// - /// Gets or sets base64 encoded value of the parameters/values file - /// content. - /// - [JsonProperty(PropertyName = "encodedValuesContent")] - public string EncodedValuesContent { get; set; } - - /// - /// Gets or sets the collection of overridable values that can be - /// passed when running a task. - /// - [JsonProperty(PropertyName = "values")] - public IList Values { get; set; } - - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/EncryptionProperty.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/EncryptionProperty.cs new file mode 100644 index 000000000000..49cd9c81b0e0 --- /dev/null +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/EncryptionProperty.cs @@ -0,0 +1,59 @@ +// +// 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 EncryptionProperty + { + /// + /// Initializes a new instance of the EncryptionProperty class. + /// + public EncryptionProperty() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the EncryptionProperty class. + /// + /// Indicates whether or not the encryption is + /// enabled for container registry. Possible values include: 'enabled', + /// 'disabled' + /// Key vault properties. + public EncryptionProperty(string status = default(string), KeyVaultProperties keyVaultProperties = default(KeyVaultProperties)) + { + Status = status; + KeyVaultProperties = keyVaultProperties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets indicates whether or not the encryption is enabled for + /// container registry. Possible values include: 'enabled', 'disabled' + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// Gets or sets key vault properties. + /// + [JsonProperty(PropertyName = "keyVaultProperties")] + public KeyVaultProperties KeyVaultProperties { get; set; } + + } +} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TaskStatus.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/EncryptionStatus.cs similarity index 71% rename from sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TaskStatus.cs rename to sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/EncryptionStatus.cs index 23910be329ed..c02799a49ce2 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TaskStatus.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/EncryptionStatus.cs @@ -12,11 +12,11 @@ namespace Microsoft.Azure.Management.ContainerRegistry.Models { /// - /// Defines values for TaskStatus. + /// Defines values for EncryptionStatus. /// - public static class TaskStatus + public static class EncryptionStatus { - public const string Disabled = "Disabled"; - public const string Enabled = "Enabled"; + 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 deleted file mode 100644 index 3ac8c3b7218b..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/FileTaskRunRequest.cs +++ /dev/null @@ -1,169 +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.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The request parameters for a scheduling run against a task file. - /// - public partial class FileTaskRunRequest : RunRequest - { - /// - /// Initializes a new instance of the FileTaskRunRequest class. - /// - public FileTaskRunRequest() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the FileTaskRunRequest class. - /// - /// The template/definition file path - /// relative to the source. - /// The platform properties against which the - /// run has to happen. - /// The value that indicates whether - /// archiving is enabled for the run or not. - /// The values/parameters file path - /// relative to the source. - /// The collection of overridable values that can - /// be passed when running a task. - /// Run timeout in seconds. - /// The machine configuration of the - /// run agent. - /// The URL(absolute or relative) of the - /// source context. It can be an URL to a tar or git repository. - /// If it is relative URL, the relative path should be obtained from - /// calling listBuildSourceUploadUrl API. - /// The properties that describes a set of - /// credentials that will be used when this run is invoked. - public FileTaskRunRequest(string taskFilePath, PlatformProperties platform, bool? isArchiveEnabled = default(bool?), 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) - { - TaskFilePath = taskFilePath; - ValuesFilePath = valuesFilePath; - Values = values; - Timeout = timeout; - Platform = platform; - AgentConfiguration = agentConfiguration; - SourceLocation = sourceLocation; - Credentials = credentials; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the template/definition file path relative to the - /// source. - /// - [JsonProperty(PropertyName = "taskFilePath")] - public string TaskFilePath { get; set; } - - /// - /// Gets or sets the values/parameters file path relative to the - /// source. - /// - [JsonProperty(PropertyName = "valuesFilePath")] - public string ValuesFilePath { get; set; } - - /// - /// Gets or sets the collection of overridable values that can be - /// passed when running a task. - /// - [JsonProperty(PropertyName = "values")] - public IList Values { get; set; } - - /// - /// Gets or sets run timeout in seconds. - /// - [JsonProperty(PropertyName = "timeout")] - public int? Timeout { get; set; } - - /// - /// Gets or sets the platform properties against which the run has to - /// happen. - /// - [JsonProperty(PropertyName = "platform")] - public PlatformProperties Platform { get; set; } - - /// - /// Gets or sets the machine configuration of the run agent. - /// - [JsonProperty(PropertyName = "agentConfiguration")] - public AgentProperties AgentConfiguration { get; set; } - - /// - /// Gets or sets the URL(absolute or relative) of the source context. - /// It can be an URL to a tar or git repository. - /// If it is relative URL, the relative path should be obtained from - /// calling listBuildSourceUploadUrl API. - /// - [JsonProperty(PropertyName = "sourceLocation")] - public string SourceLocation { get; set; } - - /// - /// Gets or sets the properties that describes a set of credentials - /// that will be used when this run is invoked. - /// - [JsonProperty(PropertyName = "credentials")] - public Credentials Credentials { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (TaskFilePath == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "TaskFilePath"); - } - if (Platform == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Platform"); - } - if (Values != null) - { - foreach (var element in Values) - { - if (element != null) - { - element.Validate(); - } - } - } - if (Timeout > 28800) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Timeout", 28800); - } - if (Timeout < 300) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Timeout", 300); - } - if (Platform != null) - { - Platform.Validate(); - } - } - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/FileTaskStep.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/FileTaskStep.cs deleted file mode 100644 index bbacfedeaf25..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/FileTaskStep.cs +++ /dev/null @@ -1,108 +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.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The properties of a task step. - /// - [Newtonsoft.Json.JsonObject("FileTask")] - public partial class FileTaskStep : TaskStepProperties - { - /// - /// Initializes a new instance of the FileTaskStep class. - /// - public FileTaskStep() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the FileTaskStep class. - /// - /// The task template/definition file path - /// relative to the source context. - /// List of base image dependencies - /// for a step. - /// The URL(absolute or relative) of the - /// source context for the task step. - /// The token (git PAT or SAS token of - /// storage account blob) associated with the context for a - /// step. - /// The task values/parameters file path - /// relative to the source context. - /// The collection of overridable values that can - /// be passed when running a task. - public FileTaskStep(string taskFilePath, IList baseImageDependencies = default(IList), string contextPath = default(string), string contextAccessToken = default(string), string valuesFilePath = default(string), IList values = default(IList)) - : base(baseImageDependencies, contextPath, contextAccessToken) - { - TaskFilePath = taskFilePath; - ValuesFilePath = valuesFilePath; - Values = values; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the task template/definition file path relative to the - /// source context. - /// - [JsonProperty(PropertyName = "taskFilePath")] - public string TaskFilePath { get; set; } - - /// - /// Gets or sets the task values/parameters file path relative to the - /// source context. - /// - [JsonProperty(PropertyName = "valuesFilePath")] - public string ValuesFilePath { get; set; } - - /// - /// Gets or sets the collection of overridable values that can be - /// passed when running a task. - /// - [JsonProperty(PropertyName = "values")] - public IList Values { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (TaskFilePath == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "TaskFilePath"); - } - if (Values != null) - { - foreach (var element in Values) - { - if (element != null) - { - element.Validate(); - } - } - } - } - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/FileTaskStepUpdateParameters.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/FileTaskStepUpdateParameters.cs deleted file mode 100644 index 8fcdaeb423ae..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/FileTaskStepUpdateParameters.cs +++ /dev/null @@ -1,84 +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 updating a task step. - /// - [Newtonsoft.Json.JsonObject("FileTask")] - public partial class FileTaskStepUpdateParameters : TaskStepUpdateParameters - { - /// - /// Initializes a new instance of the FileTaskStepUpdateParameters - /// class. - /// - public FileTaskStepUpdateParameters() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the FileTaskStepUpdateParameters - /// class. - /// - /// The URL(absolute or relative) of the - /// source context for the task step. - /// The token (git PAT or SAS token of - /// storage account blob) associated with the context for a - /// step. - /// The task template/definition file path - /// relative to the source context. - /// The values/parameters file path - /// relative to the source context. - /// The collection of overridable values that can - /// be passed when running a task. - public FileTaskStepUpdateParameters(string contextPath = default(string), string contextAccessToken = default(string), string taskFilePath = default(string), string valuesFilePath = default(string), IList values = default(IList)) - : base(contextPath, contextAccessToken) - { - TaskFilePath = taskFilePath; - ValuesFilePath = valuesFilePath; - Values = values; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the task template/definition file path relative to the - /// source context. - /// - [JsonProperty(PropertyName = "taskFilePath")] - public string TaskFilePath { get; set; } - - /// - /// Gets or sets the values/parameters file path relative to the source - /// context. - /// - [JsonProperty(PropertyName = "valuesFilePath")] - public string ValuesFilePath { get; set; } - - /// - /// Gets or sets the collection of overridable values that can be - /// passed when running a task. - /// - [JsonProperty(PropertyName = "values")] - public IList Values { get; set; } - - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ImageDescriptor.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ImageDescriptor.cs deleted file mode 100644 index 730bd6ce66d4..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ImageDescriptor.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 Newtonsoft.Json; - using System.Linq; - - /// - /// Properties for a registry image. - /// - public partial class ImageDescriptor - { - /// - /// Initializes a new instance of the ImageDescriptor class. - /// - public ImageDescriptor() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ImageDescriptor class. - /// - /// The registry login server. - /// The repository name. - /// The tag name. - /// The sha256-based digest of the image - /// manifest. - public ImageDescriptor(string registry = default(string), string repository = default(string), string tag = default(string), string digest = default(string)) - { - Registry = registry; - Repository = repository; - Tag = tag; - Digest = digest; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the registry login server. - /// - [JsonProperty(PropertyName = "registry")] - public string Registry { get; set; } - - /// - /// Gets or sets the repository name. - /// - [JsonProperty(PropertyName = "repository")] - public string Repository { get; set; } - - /// - /// Gets or sets the tag name. - /// - [JsonProperty(PropertyName = "tag")] - public string Tag { get; set; } - - /// - /// Gets or sets the sha256-based digest of the image manifest. - /// - [JsonProperty(PropertyName = "digest")] - public string Digest { get; set; } - - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ImageUpdateTrigger.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ImageUpdateTrigger.cs deleted file mode 100644 index 0830e28af8a6..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ImageUpdateTrigger.cs +++ /dev/null @@ -1,71 +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 image update trigger that caused a build. - /// - public partial class ImageUpdateTrigger - { - /// - /// Initializes a new instance of the ImageUpdateTrigger class. - /// - public ImageUpdateTrigger() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ImageUpdateTrigger class. - /// - /// The unique ID of the trigger. - /// The timestamp when the image update - /// happened. - /// The list of image updates that caused the - /// build. - public ImageUpdateTrigger(string id = default(string), System.DateTime? timestamp = default(System.DateTime?), IList images = default(IList)) - { - Id = id; - Timestamp = timestamp; - Images = images; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the unique ID of the trigger. - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } - - /// - /// Gets or sets the timestamp when the image update happened. - /// - [JsonProperty(PropertyName = "timestamp")] - public System.DateTime? Timestamp { get; set; } - - /// - /// Gets or sets the list of image updates that caused the build. - /// - [JsonProperty(PropertyName = "images")] - public IList Images { get; set; } - - } -} 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 new file mode 100644 index 000000000000..67887ee36dce --- /dev/null +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/KeyVaultProperties.cs @@ -0,0 +1,59 @@ +// +// 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 KeyVaultProperties + { + /// + /// Initializes a new instance of the KeyVaultProperties class. + /// + public KeyVaultProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the KeyVaultProperties class. + /// + /// Key vault uri to access the encryption + /// key. + /// The client id of the identity which + /// will be used to access key vault. + public KeyVaultProperties(string keyIdentifier = default(string), string identityClientId = default(string)) + { + KeyIdentifier = keyIdentifier; + IdentityClientId = identityClientId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets key vault uri to access the encryption key. + /// + [JsonProperty(PropertyName = "keyIdentifier")] + public string KeyIdentifier { get; set; } + + /// + /// Gets or sets the client id of the identity which will be used to + /// access key vault. + /// + [JsonProperty(PropertyName = "identityClientId")] + public string IdentityClientId { get; set; } + + } +} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/OS.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/OS.cs deleted file mode 100644 index 6c5ae120bb07..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/OS.cs +++ /dev/null @@ -1,22 +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 OS. - /// - public static class OS - { - public const string Windows = "Windows"; - public const string Linux = "Linux"; - } -} 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 fd6a6d21b2cd..b38c70091a26 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 @@ -16,7 +16,7 @@ namespace Microsoft.Azure.Management.ContainerRegistry.Models using System.Linq; /// - /// The definition of Azure Monitoring metrics list. + /// The definition of Azure Monitoring list. /// public partial class OperationServiceSpecificationDefinition { diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/OverrideTaskStepProperties.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/OverrideTaskStepProperties.cs deleted file mode 100644 index 7037feba97f0..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/OverrideTaskStepProperties.cs +++ /dev/null @@ -1,102 +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; - - public partial class OverrideTaskStepProperties - { - /// - /// Initializes a new instance of the OverrideTaskStepProperties class. - /// - public OverrideTaskStepProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the OverrideTaskStepProperties class. - /// - /// The source context against which run has - /// to be queued. - /// The file against which run has to be - /// queued. - /// Gets or sets the collection of override - /// arguments to be used when - /// executing a build step. - /// The name of the target build stage for the - /// docker build. - /// The collection of overridable values that can - /// be passed when running a Task. - /// Base64 encoded update trigger - /// token that will be attached with the base image trigger - /// webhook. - public OverrideTaskStepProperties(string contextPath = default(string), string file = default(string), IList arguments = default(IList), string target = default(string), IList values = default(IList), string updateTriggerToken = default(string)) - { - ContextPath = contextPath; - File = file; - Arguments = arguments; - Target = target; - Values = values; - UpdateTriggerToken = updateTriggerToken; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the source context against which run has to be queued. - /// - [JsonProperty(PropertyName = "contextPath")] - public string ContextPath { get; set; } - - /// - /// Gets or sets the file against which run has to be queued. - /// - [JsonProperty(PropertyName = "file")] - public string File { get; set; } - - /// - /// Gets or sets the collection of override arguments to be used when - /// executing a build step. - /// - [JsonProperty(PropertyName = "arguments")] - public IList Arguments { get; set; } - - /// - /// Gets or sets the name of the target build stage for the docker - /// build. - /// - [JsonProperty(PropertyName = "target")] - public string Target { get; set; } - - /// - /// Gets or sets the collection of overridable values that can be - /// passed when running a Task. - /// - [JsonProperty(PropertyName = "values")] - public IList Values { get; set; } - - /// - /// Gets or sets base64 encoded update trigger token that will be - /// attached with the base image trigger webhook. - /// - [JsonProperty(PropertyName = "updateTriggerToken")] - public string UpdateTriggerToken { get; set; } - - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PlatformProperties.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PlatformProperties.cs deleted file mode 100644 index 65fc837eebb6..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PlatformProperties.cs +++ /dev/null @@ -1,87 +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 platform properties against which the run has to happen. - /// - public partial class PlatformProperties - { - /// - /// Initializes a new instance of the PlatformProperties class. - /// - public PlatformProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the PlatformProperties class. - /// - /// The operating system type required for the run. - /// Possible values include: 'Windows', 'Linux' - /// The OS architecture. Possible values - /// include: 'amd64', 'x86', '386', 'arm', 'arm64' - /// Variant of the CPU. Possible values include: - /// 'v6', 'v7', 'v8' - public PlatformProperties(string os, string architecture = default(string), string variant = default(string)) - { - Os = os; - Architecture = architecture; - Variant = variant; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the operating system type required for the run. - /// Possible values include: 'Windows', 'Linux' - /// - [JsonProperty(PropertyName = "os")] - public string Os { get; set; } - - /// - /// Gets or sets the OS architecture. Possible values include: 'amd64', - /// 'x86', '386', 'arm', 'arm64' - /// - [JsonProperty(PropertyName = "architecture")] - public string Architecture { get; set; } - - /// - /// Gets or sets variant of the CPU. Possible values include: 'v6', - /// 'v7', 'v8' - /// - [JsonProperty(PropertyName = "variant")] - public string Variant { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Os == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Os"); - } - } - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PlatformUpdateParameters.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PlatformUpdateParameters.cs deleted file mode 100644 index 7c3d8549e97f..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/PlatformUpdateParameters.cs +++ /dev/null @@ -1,73 +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 for updating the platform configuration. - /// - public partial class PlatformUpdateParameters - { - /// - /// Initializes a new instance of the PlatformUpdateParameters class. - /// - public PlatformUpdateParameters() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the PlatformUpdateParameters class. - /// - /// The operating system type required for the run. - /// Possible values include: 'Windows', 'Linux' - /// The OS architecture. Possible values - /// include: 'amd64', 'x86', '386', 'arm', 'arm64' - /// Variant of the CPU. Possible values include: - /// 'v6', 'v7', 'v8' - public PlatformUpdateParameters(string os = default(string), string architecture = default(string), string variant = default(string)) - { - Os = os; - Architecture = architecture; - Variant = variant; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the operating system type required for the run. - /// Possible values include: 'Windows', 'Linux' - /// - [JsonProperty(PropertyName = "os")] - public string Os { get; set; } - - /// - /// Gets or sets the OS architecture. Possible values include: 'amd64', - /// 'x86', '386', 'arm', 'arm64' - /// - [JsonProperty(PropertyName = "architecture")] - public string Architecture { get; set; } - - /// - /// Gets or sets variant of the CPU. Possible values include: 'v6', - /// 'v7', 'v8' - /// - [JsonProperty(PropertyName = "variant")] - public string Variant { 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 deleted file mode 100644 index f5febadd4c36..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ProxyResource.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.Azure; - using Newtonsoft.Json; - using System.Linq; - - /// - /// The resource model definition for a ARM proxy resource. It will have - /// everything other than required location and tags. - /// - public partial class ProxyResource : IResource - { - /// - /// Initializes a new instance of the ProxyResource class. - /// - public ProxyResource() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ProxyResource class. - /// - /// 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)) - { - Id = id; - Name = name; - Type = type; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the resource ID. - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } - - /// - /// Gets the name of the resource. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } - - /// - /// Gets the type of the resource. - /// - [JsonProperty(PropertyName = "type")] - public string Type { 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 49d723eea4d7..a0ad57ac444d 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. + /// The identity of the container + /// registry. /// The URL that can be used to log into the /// container registry. /// The creation date of the container @@ -59,10 +61,13 @@ public Registry() /// registry. /// The policies for a container /// registry. - public Registry(string location, Sku sku, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), 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)) + /// The encryption settings of container + /// registry. + 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)) : base(location, id, name, type, tags) { Sku = sku; + Identity = identity; LoginServer = loginServer; CreationDate = creationDate; ProvisioningState = provisioningState; @@ -71,6 +76,7 @@ public Registry() StorageAccount = storageAccount; NetworkRuleSet = networkRuleSet; Policies = policies; + Encryption = encryption; CustomInit(); } @@ -85,6 +91,12 @@ public Registry() [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 the URL that can be used to log into the container registry. /// @@ -138,6 +150,12 @@ public Registry() [JsonProperty(PropertyName = "properties.policies")] public Policies Policies { get; set; } + /// + /// Gets or sets the encryption settings of container registry. + /// + [JsonProperty(PropertyName = "properties.encryption")] + public EncryptionProperty Encryption { get; set; } + /// /// Validate the object. /// 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 e638598a2ef1..032bd5b21738 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 @@ -36,19 +36,25 @@ public RegistryUpdateParameters() /// /// The tags for the container registry. /// The SKU of the container registry. + /// The identity of the container + /// registry. /// The value that indicates whether the /// admin user is enabled. /// The network rule set for a container /// registry. /// The policies for a container /// registry. - public RegistryUpdateParameters(IDictionary tags = default(IDictionary), Sku sku = default(Sku), bool? adminUserEnabled = default(bool?), NetworkRuleSet networkRuleSet = default(NetworkRuleSet), Policies policies = default(Policies)) + /// The encryption settings of container + /// registry. + 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)) { Tags = tags; Sku = sku; + Identity = identity; AdminUserEnabled = adminUserEnabled; NetworkRuleSet = networkRuleSet; Policies = policies; + Encryption = encryption; CustomInit(); } @@ -69,6 +75,12 @@ 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. @@ -88,6 +100,12 @@ public RegistryUpdateParameters() [JsonProperty(PropertyName = "properties.policies")] public Policies Policies { get; set; } + /// + /// Gets or sets the encryption settings of container registry. + /// + [JsonProperty(PropertyName = "properties.encryption")] + public EncryptionProperty Encryption { get; set; } + /// /// Validate the object. /// diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/RetentionPolicy.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/RetentionPolicy.cs index 3d10bdffaa32..5e3f5459d802 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/RetentionPolicy.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/RetentionPolicy.cs @@ -29,8 +29,8 @@ public RetentionPolicy() /// /// Initializes a new instance of the RetentionPolicy class. /// - /// The number of days to retain manifest before it - /// expires. + /// The number of days to retain an untagged + /// manifest after which it gets purged. /// The timestamp when the policy was /// last updated. /// The value that indicates whether the policy is @@ -50,8 +50,8 @@ public RetentionPolicy() partial void CustomInit(); /// - /// Gets or sets the number of days to retain manifest before it - /// expires. + /// Gets or sets the number of days to retain an untagged manifest + /// after which it gets purged. /// [JsonProperty(PropertyName = "days")] public int? Days { get; set; } 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 deleted file mode 100644 index d1dcfa6c5521..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Run.cs +++ /dev/null @@ -1,258 +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; - - /// - /// Run resource properties - /// - [Rest.Serialization.JsonTransformation] - public partial class Run : ProxyResource - { - /// - /// Initializes a new instance of the Run class. - /// - public Run() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Run class. - /// - /// The resource ID. - /// The name of the resource. - /// The type of the resource. - /// The unique identifier for the run. - /// The current status of the run. Possible values - /// include: 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', - /// 'Canceled', 'Error', 'Timeout' - /// The last updated time for the - /// run. - /// The type of run. Possible values include: - /// 'QuickBuild', 'QuickRun', 'AutoBuild', 'AutoRun' - /// The time the run was scheduled. - /// The time the run started. - /// The time the run finished. - /// The list of all images that were - /// generated from the run. This is applicable if the run generates - /// base image dependencies. - /// The task against which run was - /// scheduled. - /// The image update trigger that - /// caused the run. This is applicable if the task has base image - /// trigger configured. - /// The source trigger that caused the - /// run. - /// The timer trigger that caused the - /// run. - /// The platform properties against which the - /// run will happen. - /// The machine configuration of the - /// run agent. - /// The scope of the credentials that - /// were used to login to the source registry during this run. - /// The list of custom registries that - /// were logged in during this run. - /// The error message received from - /// backend systems after the run is scheduled. - /// The update trigger token passed - /// for the Run. - /// The 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), 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) - { - RunId = runId; - Status = status; - LastUpdatedTime = lastUpdatedTime; - RunType = runType; - CreateTime = createTime; - StartTime = startTime; - FinishTime = finishTime; - OutputImages = outputImages; - Task = task; - ImageUpdateTrigger = imageUpdateTrigger; - SourceTrigger = sourceTrigger; - TimerTrigger = timerTrigger; - Platform = platform; - AgentConfiguration = agentConfiguration; - SourceRegistryAuth = sourceRegistryAuth; - CustomRegistries = customRegistries; - RunErrorMessage = runErrorMessage; - UpdateTriggerToken = updateTriggerToken; - ProvisioningState = provisioningState; - IsArchiveEnabled = isArchiveEnabled; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the unique identifier for the run. - /// - [JsonProperty(PropertyName = "properties.runId")] - public string RunId { get; set; } - - /// - /// Gets or sets the current status of the run. Possible values - /// include: 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', - /// 'Canceled', 'Error', 'Timeout' - /// - [JsonProperty(PropertyName = "properties.status")] - public string Status { get; set; } - - /// - /// Gets or sets the last updated time for the run. - /// - [JsonProperty(PropertyName = "properties.lastUpdatedTime")] - public System.DateTime? LastUpdatedTime { get; set; } - - /// - /// Gets or sets the type of run. Possible values include: - /// 'QuickBuild', 'QuickRun', 'AutoBuild', 'AutoRun' - /// - [JsonProperty(PropertyName = "properties.runType")] - public string RunType { get; set; } - - /// - /// Gets or sets the time the run was scheduled. - /// - [JsonProperty(PropertyName = "properties.createTime")] - public System.DateTime? CreateTime { get; set; } - - /// - /// Gets or sets the time the run started. - /// - [JsonProperty(PropertyName = "properties.startTime")] - public System.DateTime? StartTime { get; set; } - - /// - /// Gets or sets the time the run finished. - /// - [JsonProperty(PropertyName = "properties.finishTime")] - public System.DateTime? FinishTime { get; set; } - - /// - /// Gets or sets the list of all images that were generated from the - /// run. This is applicable if the run generates base image - /// dependencies. - /// - [JsonProperty(PropertyName = "properties.outputImages")] - public IList OutputImages { get; set; } - - /// - /// Gets or sets the task against which run was scheduled. - /// - [JsonProperty(PropertyName = "properties.task")] - public string Task { get; set; } - - /// - /// Gets or sets the image update trigger that caused the run. This is - /// applicable if the task has base image trigger configured. - /// - [JsonProperty(PropertyName = "properties.imageUpdateTrigger")] - public ImageUpdateTrigger ImageUpdateTrigger { get; set; } - - /// - /// Gets or sets the source trigger that caused the run. - /// - [JsonProperty(PropertyName = "properties.sourceTrigger")] - public SourceTriggerDescriptor SourceTrigger { get; set; } - - /// - /// Gets or sets the timer trigger that caused the run. - /// - [JsonProperty(PropertyName = "properties.timerTrigger")] - public TimerTriggerDescriptor TimerTrigger { get; set; } - - /// - /// Gets or sets the platform properties against which the run will - /// happen. - /// - [JsonProperty(PropertyName = "properties.platform")] - public PlatformProperties Platform { get; set; } - - /// - /// Gets or sets the machine configuration of the run agent. - /// - [JsonProperty(PropertyName = "properties.agentConfiguration")] - public AgentProperties AgentConfiguration { get; set; } - - /// - /// Gets or sets the scope of the credentials that were used to login - /// to the source registry during this run. - /// - [JsonProperty(PropertyName = "properties.sourceRegistryAuth")] - public string SourceRegistryAuth { get; set; } - - /// - /// Gets or sets the list of custom registries that were logged in - /// during this run. - /// - [JsonProperty(PropertyName = "properties.customRegistries")] - public IList CustomRegistries { get; set; } - - /// - /// Gets the error message received from backend systems after the run - /// is scheduled. - /// - [JsonProperty(PropertyName = "properties.runErrorMessage")] - public string RunErrorMessage { get; private set; } - - /// - /// Gets or sets the update trigger token passed for the Run. - /// - [JsonProperty(PropertyName = "properties.updateTriggerToken")] - public string UpdateTriggerToken { get; set; } - - /// - /// Gets or sets the provisioning state of a run. Possible values - /// include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', - /// 'Canceled' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; set; } - - /// - /// Gets or sets the value that indicates whether archiving is enabled - /// or not. - /// - [JsonProperty(PropertyName = "properties.isArchiveEnabled")] - public bool? IsArchiveEnabled { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Platform != null) - { - Platform.Validate(); - } - } - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/RunFilter.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/RunFilter.cs deleted file mode 100644 index 19d86ef940a9..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/RunFilter.cs +++ /dev/null @@ -1,121 +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; - - /// - /// Properties that are enabled for Odata querying on runs. - /// - public partial class RunFilter - { - /// - /// Initializes a new instance of the RunFilter class. - /// - public RunFilter() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the RunFilter class. - /// - /// The unique identifier for the run. - /// The type of run. Possible values include: - /// 'QuickBuild', 'QuickRun', 'AutoBuild', 'AutoRun' - /// The current status of the run. Possible values - /// include: 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', - /// 'Canceled', 'Error', 'Timeout' - /// The create time for a run. - /// The time the run finished. - /// The list of comma-separated - /// image manifests that were generated from the run. This is - /// applicable if the run is of - /// build type. - /// The value that indicates whether - /// archiving is enabled or not. - /// The name of the task that the run - /// corresponds to. - public RunFilter(string runId = default(string), string runType = default(string), string status = default(string), System.DateTime? createTime = default(System.DateTime?), System.DateTime? finishTime = default(System.DateTime?), string outputImageManifests = default(string), bool? isArchiveEnabled = default(bool?), string taskName = default(string)) - { - RunId = runId; - RunType = runType; - Status = status; - CreateTime = createTime; - FinishTime = finishTime; - OutputImageManifests = outputImageManifests; - IsArchiveEnabled = isArchiveEnabled; - TaskName = taskName; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the unique identifier for the run. - /// - [JsonProperty(PropertyName = "runId")] - public string RunId { get; set; } - - /// - /// Gets or sets the type of run. Possible values include: - /// 'QuickBuild', 'QuickRun', 'AutoBuild', 'AutoRun' - /// - [JsonProperty(PropertyName = "runType")] - public string RunType { get; set; } - - /// - /// Gets or sets the current status of the run. Possible values - /// include: 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', - /// 'Canceled', 'Error', 'Timeout' - /// - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } - - /// - /// Gets or sets the create time for a run. - /// - [JsonProperty(PropertyName = "createTime")] - public System.DateTime? CreateTime { get; set; } - - /// - /// Gets or sets the time the run finished. - /// - [JsonProperty(PropertyName = "finishTime")] - public System.DateTime? FinishTime { get; set; } - - /// - /// Gets or sets the list of comma-separated image manifests that were - /// generated from the run. This is applicable if the run is of - /// build type. - /// - [JsonProperty(PropertyName = "outputImageManifests")] - public string OutputImageManifests { get; set; } - - /// - /// Gets or sets the value that indicates whether archiving is enabled - /// or not. - /// - [JsonProperty(PropertyName = "isArchiveEnabled")] - public bool? IsArchiveEnabled { get; set; } - - /// - /// Gets or sets the name of the task that the run corresponds to. - /// - [JsonProperty(PropertyName = "taskName")] - public string TaskName { get; set; } - - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/RunGetLogResult.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/RunGetLogResult.cs deleted file mode 100644 index 718af610a69f..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/RunGetLogResult.cs +++ /dev/null @@ -1,53 +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 result of get log link operation. - /// - public partial class RunGetLogResult - { - /// - /// Initializes a new instance of the RunGetLogResult class. - /// - public RunGetLogResult() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the RunGetLogResult class. - /// - /// The link to logs for a run on a azure - /// container registry. - public RunGetLogResult(string logLink = default(string)) - { - LogLink = logLink; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the link to logs for a run on a azure container - /// registry. - /// - [JsonProperty(PropertyName = "logLink")] - public string LogLink { get; set; } - - } -} 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 deleted file mode 100644 index a04a91b58c0b..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/RunRequest.cs +++ /dev/null @@ -1,53 +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 request parameters for scheduling a run. - /// - public partial class RunRequest - { - /// - /// Initializes a new instance of the RunRequest class. - /// - public RunRequest() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the RunRequest class. - /// - /// The value that indicates whether - /// archiving is enabled for the run or not. - public RunRequest(bool? isArchiveEnabled = default(bool?)) - { - IsArchiveEnabled = isArchiveEnabled; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the value that indicates whether archiving is enabled - /// for the run or not. - /// - [JsonProperty(PropertyName = "isArchiveEnabled")] - public bool? IsArchiveEnabled { get; set; } - - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/RunStatus.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/RunStatus.cs deleted file mode 100644 index fb785a55f392..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/RunStatus.cs +++ /dev/null @@ -1,28 +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 RunStatus. - /// - public static class RunStatus - { - public const string Queued = "Queued"; - public const string Started = "Started"; - public const string Running = "Running"; - public const string Succeeded = "Succeeded"; - public const string Failed = "Failed"; - public const string Canceled = "Canceled"; - public const string Error = "Error"; - public const string Timeout = "Timeout"; - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/RunType.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/RunType.cs deleted file mode 100644 index 119c45c17dde..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/RunType.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 RunType. - /// - public static class RunType - { - public const string QuickBuild = "QuickBuild"; - public const string QuickRun = "QuickRun"; - public const string AutoBuild = "AutoBuild"; - public const string AutoRun = "AutoRun"; - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/RunUpdateParameters.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/RunUpdateParameters.cs deleted file mode 100644 index 5a3e461c4d7e..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/RunUpdateParameters.cs +++ /dev/null @@ -1,53 +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 set of run properties that can be updated. - /// - public partial class RunUpdateParameters - { - /// - /// Initializes a new instance of the RunUpdateParameters class. - /// - public RunUpdateParameters() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the RunUpdateParameters class. - /// - /// The value that indicates whether - /// archiving is enabled or not. - public RunUpdateParameters(bool? isArchiveEnabled = default(bool?)) - { - IsArchiveEnabled = isArchiveEnabled; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the value that indicates whether archiving is enabled - /// or not. - /// - [JsonProperty(PropertyName = "isArchiveEnabled")] - public bool? IsArchiveEnabled { get; set; } - - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/SecretObject.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/SecretObject.cs deleted file mode 100644 index 6479ac4fed92..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/SecretObject.cs +++ /dev/null @@ -1,72 +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; - - /// - /// Describes the properties of a secret object value. - /// - public partial class SecretObject - { - /// - /// Initializes a new instance of the SecretObject class. - /// - public SecretObject() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the SecretObject class. - /// - /// The value of the secret. The format of this - /// value will be determined - /// based on the type of the secret object. If the type is Opaque, the - /// value will be - /// used as is without any modification. - /// The type of the secret object which determines - /// how the value of the secret object has to be - /// interpreted. Possible values include: 'Opaque', - /// 'Vaultsecret' - public SecretObject(string value = default(string), string type = default(string)) - { - Value = value; - Type = type; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the value of the secret. The format of this value will - /// be determined - /// based on the type of the secret object. If the type is Opaque, the - /// value will be - /// used as is without any modification. - /// - [JsonProperty(PropertyName = "value")] - public string Value { get; set; } - - /// - /// Gets or sets the type of the secret object which determines how the - /// value of the secret object has to be - /// interpreted. Possible values include: 'Opaque', 'Vaultsecret' - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/SecretObjectType.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/SecretObjectType.cs deleted file mode 100644 index eb65d8737e16..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/SecretObjectType.cs +++ /dev/null @@ -1,22 +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 SecretObjectType. - /// - public static class SecretObjectType - { - public const string Opaque = "Opaque"; - public const string Vaultsecret = "Vaultsecret"; - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/SetValue.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/SetValue.cs deleted file mode 100644 index f289d64c84dc..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/SetValue.cs +++ /dev/null @@ -1,88 +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 a overridable value that can be passed to a task - /// template. - /// - public partial class SetValue - { - /// - /// Initializes a new instance of the SetValue class. - /// - public SetValue() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the SetValue class. - /// - /// The name of the overridable value. - /// The overridable value. - /// Flag to indicate whether the value - /// represents a secret or not. - public SetValue(string name, string value, bool? isSecret = default(bool?)) - { - Name = name; - Value = value; - IsSecret = isSecret; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of the overridable value. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets the overridable value. - /// - [JsonProperty(PropertyName = "value")] - public string Value { get; set; } - - /// - /// Gets or sets flag to indicate whether the value represents a secret - /// or not. - /// - [JsonProperty(PropertyName = "isSecret")] - public bool? IsSecret { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); - } - if (Value == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Value"); - } - } - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/SourceControlType.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/SourceControlType.cs deleted file mode 100644 index 9d3f76fc5d06..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/SourceControlType.cs +++ /dev/null @@ -1,22 +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 SourceControlType. - /// - public static class SourceControlType - { - public const string Github = "Github"; - public const string VisualStudioTeamService = "VisualStudioTeamService"; - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/SourceProperties.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/SourceProperties.cs deleted file mode 100644 index 4c514b6b0e27..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/SourceProperties.cs +++ /dev/null @@ -1,105 +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 source code repository. - /// - public partial class SourceProperties - { - /// - /// Initializes a new instance of the SourceProperties class. - /// - public SourceProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the SourceProperties class. - /// - /// The type of source control service. - /// Possible values include: 'Github', - /// 'VisualStudioTeamService' - /// The full URL to the source code - /// repository - /// The branch name of the source code. - /// The authorization - /// properties for accessing the source code repository and to set up - /// webhooks for notifications. - public SourceProperties(string sourceControlType, string repositoryUrl, string branch = default(string), AuthInfo sourceControlAuthProperties = default(AuthInfo)) - { - SourceControlType = sourceControlType; - RepositoryUrl = repositoryUrl; - Branch = branch; - SourceControlAuthProperties = sourceControlAuthProperties; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the type of source control service. Possible values - /// include: 'Github', 'VisualStudioTeamService' - /// - [JsonProperty(PropertyName = "sourceControlType")] - public string SourceControlType { get; set; } - - /// - /// Gets or sets the full URL to the source code repository - /// - [JsonProperty(PropertyName = "repositoryUrl")] - public string RepositoryUrl { get; set; } - - /// - /// Gets or sets the branch name of the source code. - /// - [JsonProperty(PropertyName = "branch")] - public string Branch { get; set; } - - /// - /// Gets or sets the authorization properties for accessing the source - /// code repository and to set up - /// webhooks for notifications. - /// - [JsonProperty(PropertyName = "sourceControlAuthProperties")] - public AuthInfo SourceControlAuthProperties { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (SourceControlType == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "SourceControlType"); - } - if (RepositoryUrl == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "RepositoryUrl"); - } - if (SourceControlAuthProperties != null) - { - SourceControlAuthProperties.Validate(); - } - } - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/SourceRegistryCredentials.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/SourceRegistryCredentials.cs deleted file mode 100644 index 525444084ea7..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/SourceRegistryCredentials.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; - - /// - /// Describes the credential parameters for accessing the source registry. - /// - public partial class SourceRegistryCredentials - { - /// - /// Initializes a new instance of the SourceRegistryCredentials class. - /// - public SourceRegistryCredentials() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the SourceRegistryCredentials class. - /// - /// The authentication mode which determines - /// the source registry login scope. The credentials for the source - /// registry - /// will be generated using the given scope. These credentials will be - /// used to login to - /// the source registry during the run. Possible values include: - /// 'None', 'Default' - public SourceRegistryCredentials(string loginMode = default(string)) - { - LoginMode = loginMode; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the authentication mode which determines the source - /// registry login scope. The credentials for the source registry - /// will be generated using the given scope. These credentials will be - /// used to login to - /// the source registry during the run. Possible values include: - /// 'None', 'Default' - /// - [JsonProperty(PropertyName = "loginMode")] - public string LoginMode { get; set; } - - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/SourceRegistryLoginMode.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/SourceRegistryLoginMode.cs deleted file mode 100644 index 61e0d3ae8d67..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/SourceRegistryLoginMode.cs +++ /dev/null @@ -1,22 +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 SourceRegistryLoginMode. - /// - public static class SourceRegistryLoginMode - { - public const string None = "None"; - public const string Default = "Default"; - } -} 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 deleted file mode 100644 index f484086dd36e..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/SourceTrigger.cs +++ /dev/null @@ -1,108 +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.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The properties of a source based trigger. - /// - public partial class SourceTrigger - { - /// - /// Initializes a new instance of the SourceTrigger class. - /// - public SourceTrigger() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the SourceTrigger class. - /// - /// The properties that describes the - /// source(code) for the task. - /// The source event corresponding to - /// the trigger. - /// The name of the trigger. - /// The current status of trigger. Possible values - /// include: 'Disabled', 'Enabled' - public SourceTrigger(SourceProperties sourceRepository, IList sourceTriggerEvents, string name, string status = default(string)) - { - SourceRepository = sourceRepository; - SourceTriggerEvents = sourceTriggerEvents; - Status = status; - Name = name; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the properties that describes the source(code) for the - /// task. - /// - [JsonProperty(PropertyName = "sourceRepository")] - public SourceProperties SourceRepository { get; set; } - - /// - /// Gets or sets the source event corresponding to the trigger. - /// - [JsonProperty(PropertyName = "sourceTriggerEvents")] - public IList SourceTriggerEvents { get; set; } - - /// - /// Gets or sets the current status of trigger. Possible values - /// include: 'Disabled', 'Enabled' - /// - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } - - /// - /// Gets or sets the name of the trigger. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (SourceRepository == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "SourceRepository"); - } - if (SourceTriggerEvents == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "SourceTriggerEvents"); - } - if (Name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); - } - if (SourceRepository != null) - { - SourceRepository.Validate(); - } - } - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/SourceTriggerDescriptor.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/SourceTriggerDescriptor.cs deleted file mode 100644 index 46f74e57bbf4..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/SourceTriggerDescriptor.cs +++ /dev/null @@ -1,102 +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 source trigger that caused a run. - /// - public partial class SourceTriggerDescriptor - { - /// - /// Initializes a new instance of the SourceTriggerDescriptor class. - /// - public SourceTriggerDescriptor() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the SourceTriggerDescriptor class. - /// - /// The unique ID of the trigger. - /// The event type of the trigger. - /// The unique ID that identifies a - /// commit. - /// The unique ID that identifies pull - /// request. - /// The repository URL. - /// The branch name in the repository. - /// The source control provider - /// type. - public SourceTriggerDescriptor(string id = default(string), string eventType = default(string), string commitId = default(string), string pullRequestId = default(string), string repositoryUrl = default(string), string branchName = default(string), string providerType = default(string)) - { - Id = id; - EventType = eventType; - CommitId = commitId; - PullRequestId = pullRequestId; - RepositoryUrl = repositoryUrl; - BranchName = branchName; - ProviderType = providerType; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the unique ID of the trigger. - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } - - /// - /// Gets or sets the event type of the trigger. - /// - [JsonProperty(PropertyName = "eventType")] - public string EventType { get; set; } - - /// - /// Gets or sets the unique ID that identifies a commit. - /// - [JsonProperty(PropertyName = "commitId")] - public string CommitId { get; set; } - - /// - /// Gets or sets the unique ID that identifies pull request. - /// - [JsonProperty(PropertyName = "pullRequestId")] - public string PullRequestId { get; set; } - - /// - /// Gets or sets the repository URL. - /// - [JsonProperty(PropertyName = "repositoryUrl")] - public string RepositoryUrl { get; set; } - - /// - /// Gets or sets the branch name in the repository. - /// - [JsonProperty(PropertyName = "branchName")] - public string BranchName { get; set; } - - /// - /// Gets or sets the source control provider type. - /// - [JsonProperty(PropertyName = "providerType")] - public string ProviderType { get; set; } - - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/SourceTriggerEvent.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/SourceTriggerEvent.cs deleted file mode 100644 index 6aa6c680930c..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/SourceTriggerEvent.cs +++ /dev/null @@ -1,22 +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 SourceTriggerEvent. - /// - public static class SourceTriggerEvent - { - public const string Commit = "commit"; - public const string Pullrequest = "pullrequest"; - } -} 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 deleted file mode 100644 index a393cb88ff6f..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/SourceTriggerUpdateParameters.cs +++ /dev/null @@ -1,98 +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.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The properties for updating a source based trigger. - /// - public partial class SourceTriggerUpdateParameters - { - /// - /// Initializes a new instance of the SourceTriggerUpdateParameters - /// class. - /// - public SourceTriggerUpdateParameters() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the SourceTriggerUpdateParameters - /// class. - /// - /// The name of the trigger. - /// The properties that describes the - /// source(code) for the task. - /// The source event corresponding to - /// the trigger. - /// The current status of trigger. Possible values - /// include: 'Disabled', 'Enabled' - public SourceTriggerUpdateParameters(string name, SourceUpdateParameters sourceRepository = default(SourceUpdateParameters), IList sourceTriggerEvents = default(IList), string status = default(string)) - { - SourceRepository = sourceRepository; - SourceTriggerEvents = sourceTriggerEvents; - Status = status; - Name = name; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the properties that describes the source(code) for the - /// task. - /// - [JsonProperty(PropertyName = "sourceRepository")] - public SourceUpdateParameters SourceRepository { get; set; } - - /// - /// Gets or sets the source event corresponding to the trigger. - /// - [JsonProperty(PropertyName = "sourceTriggerEvents")] - public IList SourceTriggerEvents { get; set; } - - /// - /// Gets or sets the current status of trigger. Possible values - /// include: 'Disabled', 'Enabled' - /// - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } - - /// - /// Gets or sets the name of the trigger. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); - } - } - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/SourceUpdateParameters.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/SourceUpdateParameters.cs deleted file mode 100644 index 67fea46e6722..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/SourceUpdateParameters.cs +++ /dev/null @@ -1,83 +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 for updating the source code repository. - /// - public partial class SourceUpdateParameters - { - /// - /// Initializes a new instance of the SourceUpdateParameters class. - /// - public SourceUpdateParameters() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the SourceUpdateParameters class. - /// - /// The type of source control service. - /// Possible values include: 'Github', - /// 'VisualStudioTeamService' - /// The full URL to the source code - /// repository - /// The branch name of the source code. - /// The authorization - /// properties for accessing the source code repository and to set up - /// webhooks for notifications. - public SourceUpdateParameters(string sourceControlType = default(string), string repositoryUrl = default(string), string branch = default(string), AuthInfoUpdateParameters sourceControlAuthProperties = default(AuthInfoUpdateParameters)) - { - SourceControlType = sourceControlType; - RepositoryUrl = repositoryUrl; - Branch = branch; - SourceControlAuthProperties = sourceControlAuthProperties; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the type of source control service. Possible values - /// include: 'Github', 'VisualStudioTeamService' - /// - [JsonProperty(PropertyName = "sourceControlType")] - public string SourceControlType { get; set; } - - /// - /// Gets or sets the full URL to the source code repository - /// - [JsonProperty(PropertyName = "repositoryUrl")] - public string RepositoryUrl { get; set; } - - /// - /// Gets or sets the branch name of the source code. - /// - [JsonProperty(PropertyName = "branch")] - public string Branch { get; set; } - - /// - /// Gets or sets the authorization properties for accessing the source - /// code repository and to set up - /// webhooks for notifications. - /// - [JsonProperty(PropertyName = "sourceControlAuthProperties")] - public AuthInfoUpdateParameters SourceControlAuthProperties { get; set; } - - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/SourceUploadDefinition.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/SourceUploadDefinition.cs deleted file mode 100644 index c6530415aa2f..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/SourceUploadDefinition.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; - - /// - /// The properties of a response to source upload request. - /// - public partial class SourceUploadDefinition - { - /// - /// Initializes a new instance of the SourceUploadDefinition class. - /// - public SourceUploadDefinition() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the SourceUploadDefinition class. - /// - /// The URL where the client can upload the - /// source. - /// The relative path to the source. This is - /// used to submit the subsequent queue build request. - public SourceUploadDefinition(string uploadUrl = default(string), string relativePath = default(string)) - { - UploadUrl = uploadUrl; - RelativePath = relativePath; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the URL where the client can upload the source. - /// - [JsonProperty(PropertyName = "uploadUrl")] - public string UploadUrl { get; set; } - - /// - /// Gets or sets the relative path to the source. This is used to - /// submit the subsequent queue build request. - /// - [JsonProperty(PropertyName = "relativePath")] - public string RelativePath { 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 deleted file mode 100644 index ac5f23bb44a7..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Task.cs +++ /dev/null @@ -1,183 +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 task that has the ARM resource and task properties. - /// The task will have all information to schedule a run against it. - /// - [Rest.Serialization.JsonTransformation] - public partial class Task : Resource - { - /// - /// Initializes a new instance of the Task class. - /// - public Task() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Task class. - /// - /// 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. - /// Identity for the resource. - /// The provisioning state of the task. - /// Possible values include: 'Creating', 'Updating', 'Deleting', - /// 'Succeeded', 'Failed', 'Canceled' - /// The creation date of task. - /// The current status of task. Possible values - /// include: 'Disabled', 'Enabled' - /// The machine configuration of the - /// run agent. - /// Run timeout in seconds. - /// 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), int? timeout = default(int?), TriggerProperties trigger = default(TriggerProperties), Credentials credentials = default(Credentials)) - : base(location, id, name, type, tags) - { - Identity = identity; - ProvisioningState = provisioningState; - CreationDate = creationDate; - Status = status; - Platform = platform; - AgentConfiguration = agentConfiguration; - Timeout = timeout; - Step = step; - Trigger = trigger; - Credentials = credentials; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets identity for the resource. - /// - [JsonProperty(PropertyName = "identity")] - public IdentityProperties Identity { get; set; } - - /// - /// Gets the provisioning state of the task. Possible values include: - /// 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', - /// 'Canceled' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } - - /// - /// Gets the creation date of task. - /// - [JsonProperty(PropertyName = "properties.creationDate")] - public System.DateTime? CreationDate { get; private set; } - - /// - /// Gets or sets the current status of task. Possible values include: - /// 'Disabled', 'Enabled' - /// - [JsonProperty(PropertyName = "properties.status")] - public string Status { get; set; } - - /// - /// Gets or sets the platform properties against which the run has to - /// happen. - /// - [JsonProperty(PropertyName = "properties.platform")] - public PlatformProperties Platform { get; set; } - - /// - /// Gets or sets the machine configuration of the run agent. - /// - [JsonProperty(PropertyName = "properties.agentConfiguration")] - public AgentProperties AgentConfiguration { get; set; } - - /// - /// Gets or sets run timeout in seconds. - /// - [JsonProperty(PropertyName = "properties.timeout")] - public int? Timeout { get; set; } - - /// - /// Gets or sets the properties of a task step. - /// - [JsonProperty(PropertyName = "properties.step")] - public TaskStepProperties Step { get; set; } - - /// - /// Gets or sets the properties that describe all triggers for the - /// task. - /// - [JsonProperty(PropertyName = "properties.trigger")] - public TriggerProperties Trigger { get; set; } - - /// - /// Gets or sets the properties that describes a set of credentials - /// that will be used when this run is invoked. - /// - [JsonProperty(PropertyName = "properties.credentials")] - public Credentials Credentials { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - 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(); - } - if (Timeout > 28800) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Timeout", 28800); - } - if (Timeout < 300) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Timeout", 300); - } - if (Trigger != null) - { - Trigger.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 deleted file mode 100644 index 174565500390..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TaskRunRequest.cs +++ /dev/null @@ -1,80 +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 parameters for a task run request. - /// - public partial class TaskRunRequest : RunRequest - { - /// - /// Initializes a new instance of the TaskRunRequest class. - /// - public TaskRunRequest() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the TaskRunRequest class. - /// - /// The resource ID of task against which run has - /// to be queued. - /// The value that indicates whether - /// archiving is enabled for the run or not. - /// Set of overridable - /// parameters that can be passed when running a Task. - public TaskRunRequest(string taskId, bool? isArchiveEnabled = default(bool?), OverrideTaskStepProperties overrideTaskStepProperties = default(OverrideTaskStepProperties)) - : base(isArchiveEnabled) - { - TaskId = taskId; - OverrideTaskStepProperties = overrideTaskStepProperties; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the resource ID of task against which run has to be - /// queued. - /// - [JsonProperty(PropertyName = "taskId")] - public string TaskId { get; set; } - - /// - /// Gets or sets set of overridable parameters that can be passed when - /// running a Task. - /// - [JsonProperty(PropertyName = "overrideTaskStepProperties")] - public OverrideTaskStepProperties OverrideTaskStepProperties { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (TaskId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "TaskId"); - } - } - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TaskStepProperties.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TaskStepProperties.cs deleted file mode 100644 index d8d9d9cdda4f..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TaskStepProperties.cs +++ /dev/null @@ -1,75 +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; - - /// - /// Base properties for any task step. - /// - public partial class TaskStepProperties - { - /// - /// Initializes a new instance of the TaskStepProperties class. - /// - public TaskStepProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the TaskStepProperties class. - /// - /// List of base image dependencies - /// for a step. - /// The URL(absolute or relative) of the - /// source context for the task step. - /// The token (git PAT or SAS token of - /// storage account blob) associated with the context for a - /// step. - public TaskStepProperties(IList baseImageDependencies = default(IList), string contextPath = default(string), string contextAccessToken = default(string)) - { - BaseImageDependencies = baseImageDependencies; - ContextPath = contextPath; - ContextAccessToken = contextAccessToken; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets list of base image dependencies for a step. - /// - [JsonProperty(PropertyName = "baseImageDependencies")] - public IList BaseImageDependencies { get; private set; } - - /// - /// Gets or sets the URL(absolute or relative) of the source context - /// for the task step. - /// - [JsonProperty(PropertyName = "contextPath")] - public string ContextPath { get; set; } - - /// - /// Gets or sets the token (git PAT or SAS token of storage account - /// blob) associated with the context for a step. - /// - [JsonProperty(PropertyName = "contextAccessToken")] - public string ContextAccessToken { get; set; } - - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TaskStepUpdateParameters.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TaskStepUpdateParameters.cs deleted file mode 100644 index ef33025f1055..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TaskStepUpdateParameters.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.Linq; - - /// - /// Base properties for updating any task step. - /// - public partial class TaskStepUpdateParameters - { - /// - /// Initializes a new instance of the TaskStepUpdateParameters class. - /// - public TaskStepUpdateParameters() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the TaskStepUpdateParameters class. - /// - /// The URL(absolute or relative) of the - /// source context for the task step. - /// The token (git PAT or SAS token of - /// storage account blob) associated with the context for a - /// step. - public TaskStepUpdateParameters(string contextPath = default(string), string contextAccessToken = default(string)) - { - ContextPath = contextPath; - ContextAccessToken = contextAccessToken; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the URL(absolute or relative) of the source context - /// for the task step. - /// - [JsonProperty(PropertyName = "contextPath")] - public string ContextPath { get; set; } - - /// - /// Gets or sets the token (git PAT or SAS token of storage account - /// blob) associated with the context for a step. - /// - [JsonProperty(PropertyName = "contextAccessToken")] - public string ContextAccessToken { get; set; } - - } -} 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 deleted file mode 100644 index 16b784c190d6..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TaskUpdateParameters.cs +++ /dev/null @@ -1,141 +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 parameters for updating a task. - /// - [Rest.Serialization.JsonTransformation] - public partial class TaskUpdateParameters - { - /// - /// Initializes a new instance of the TaskUpdateParameters class. - /// - public TaskUpdateParameters() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the TaskUpdateParameters class. - /// - /// Identity for the resource. - /// 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. - /// Run timeout in seconds. - /// The properties for updating a task step. - /// The properties for updating trigger - /// properties. - /// The parameters that describes a set of - /// credentials that will be used when this run is invoked. - /// The ARM resource tags. - public TaskUpdateParameters(IdentityProperties identity = default(IdentityProperties), string status = default(string), PlatformUpdateParameters platform = default(PlatformUpdateParameters), AgentProperties agentConfiguration = default(AgentProperties), int? timeout = default(int?), TaskStepUpdateParameters step = default(TaskStepUpdateParameters), TriggerUpdateParameters trigger = default(TriggerUpdateParameters), Credentials credentials = default(Credentials), IDictionary tags = default(IDictionary)) - { - Identity = identity; - Status = status; - Platform = platform; - AgentConfiguration = agentConfiguration; - Timeout = timeout; - Step = step; - Trigger = trigger; - Credentials = credentials; - Tags = tags; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets identity for the resource. - /// - [JsonProperty(PropertyName = "identity")] - public IdentityProperties Identity { get; set; } - - /// - /// Gets or sets the current status of task. Possible values include: - /// 'Disabled', 'Enabled' - /// - [JsonProperty(PropertyName = "properties.status")] - public string Status { get; set; } - - /// - /// Gets or sets the platform properties against which the run has to - /// happen. - /// - [JsonProperty(PropertyName = "properties.platform")] - public PlatformUpdateParameters Platform { get; set; } - - /// - /// Gets or sets the machine configuration of the run agent. - /// - [JsonProperty(PropertyName = "properties.agentConfiguration")] - public AgentProperties AgentConfiguration { get; set; } - - /// - /// Gets or sets run timeout in seconds. - /// - [JsonProperty(PropertyName = "properties.timeout")] - public int? Timeout { get; set; } - - /// - /// Gets or sets the properties for updating a task step. - /// - [JsonProperty(PropertyName = "properties.step")] - public TaskStepUpdateParameters Step { get; set; } - - /// - /// Gets or sets the properties for updating trigger properties. - /// - [JsonProperty(PropertyName = "properties.trigger")] - public TriggerUpdateParameters Trigger { get; set; } - - /// - /// Gets or sets the parameters that describes a set of credentials - /// that will be used when this run is invoked. - /// - [JsonProperty(PropertyName = "properties.credentials")] - public Credentials Credentials { get; set; } - - /// - /// Gets or sets the ARM resource tags. - /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Trigger != null) - { - Trigger.Validate(); - } - } - } -} 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 deleted file mode 100644 index 5eccfcf912e4..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TimerTrigger.cs +++ /dev/null @@ -1,88 +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 a timer trigger. - /// - public partial class TimerTrigger - { - /// - /// Initializes a new instance of the TimerTrigger class. - /// - public TimerTrigger() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the TimerTrigger class. - /// - /// The CRON expression for the task - /// schedule - /// The name of the trigger. - /// The current status of trigger. Possible values - /// include: 'Disabled', 'Enabled' - public TimerTrigger(string schedule, string name, string status = default(string)) - { - Schedule = schedule; - Status = status; - Name = name; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the CRON expression for the task schedule - /// - [JsonProperty(PropertyName = "schedule")] - public string Schedule { get; set; } - - /// - /// Gets or sets the current status of trigger. Possible values - /// include: 'Disabled', 'Enabled' - /// - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } - - /// - /// Gets or sets the name of the trigger. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Schedule == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Schedule"); - } - if (Name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); - } - } - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TimerTriggerDescriptor.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TimerTriggerDescriptor.cs deleted file mode 100644 index 2fbccc4b5f58..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TimerTriggerDescriptor.cs +++ /dev/null @@ -1,58 +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 TimerTriggerDescriptor - { - /// - /// Initializes a new instance of the TimerTriggerDescriptor class. - /// - public TimerTriggerDescriptor() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the TimerTriggerDescriptor class. - /// - /// The timer trigger name that caused - /// the run. - /// The occurrence that triggered the - /// run. - public TimerTriggerDescriptor(string timerTriggerName = default(string), string scheduleOccurrence = default(string)) - { - TimerTriggerName = timerTriggerName; - ScheduleOccurrence = scheduleOccurrence; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the timer trigger name that caused the run. - /// - [JsonProperty(PropertyName = "timerTriggerName")] - public string TimerTriggerName { get; set; } - - /// - /// Gets or sets the occurrence that triggered the run. - /// - [JsonProperty(PropertyName = "scheduleOccurrence")] - public string ScheduleOccurrence { 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 deleted file mode 100644 index 9cbef21bd7b6..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TimerTriggerUpdateParameters.cs +++ /dev/null @@ -1,86 +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 for updating a timer trigger. - /// - public partial class TimerTriggerUpdateParameters - { - /// - /// Initializes a new instance of the TimerTriggerUpdateParameters - /// class. - /// - public TimerTriggerUpdateParameters() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the TimerTriggerUpdateParameters - /// class. - /// - /// The name of the trigger. - /// The CRON expression for the task - /// schedule - /// The current status of trigger. Possible values - /// include: 'Disabled', 'Enabled' - public TimerTriggerUpdateParameters(string name, string schedule = default(string), string status = default(string)) - { - Schedule = schedule; - Status = status; - Name = name; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the CRON expression for the task schedule - /// - [JsonProperty(PropertyName = "schedule")] - public string Schedule { get; set; } - - /// - /// Gets or sets the current status of trigger. Possible values - /// include: 'Disabled', 'Enabled' - /// - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } - - /// - /// Gets or sets the name of the trigger. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); - } - } - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenType.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenType.cs deleted file mode 100644 index 263e5897669e..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenType.cs +++ /dev/null @@ -1,22 +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 TokenType. - /// - public static class TokenType - { - public const string PAT = "PAT"; - public const string OAuth = "OAuth"; - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TriggerProperties.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TriggerProperties.cs deleted file mode 100644 index 7e9287922ff6..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TriggerProperties.cs +++ /dev/null @@ -1,106 +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 a trigger. - /// - public partial class TriggerProperties - { - /// - /// Initializes a new instance of the TriggerProperties class. - /// - public TriggerProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the TriggerProperties class. - /// - /// The collection of timer - /// triggers. - /// The collection of triggers based on - /// source code repository. - /// The trigger based on base image - /// dependencies. - public TriggerProperties(IList timerTriggers = default(IList), IList sourceTriggers = default(IList), BaseImageTrigger baseImageTrigger = default(BaseImageTrigger)) - { - TimerTriggers = timerTriggers; - SourceTriggers = sourceTriggers; - BaseImageTrigger = baseImageTrigger; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the collection of timer triggers. - /// - [JsonProperty(PropertyName = "timerTriggers")] - public IList TimerTriggers { get; set; } - - /// - /// Gets or sets the collection of triggers based on source code - /// repository. - /// - [JsonProperty(PropertyName = "sourceTriggers")] - public IList SourceTriggers { get; set; } - - /// - /// Gets or sets the trigger based on base image dependencies. - /// - [JsonProperty(PropertyName = "baseImageTrigger")] - public BaseImageTrigger BaseImageTrigger { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (TimerTriggers != null) - { - foreach (var element in TimerTriggers) - { - if (element != null) - { - element.Validate(); - } - } - } - if (SourceTriggers != null) - { - foreach (var element1 in SourceTriggers) - { - if (element1 != null) - { - element1.Validate(); - } - } - } - if (BaseImageTrigger != null) - { - BaseImageTrigger.Validate(); - } - } - } -} 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 deleted file mode 100644 index 067d64b49005..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TriggerStatus.cs +++ /dev/null @@ -1,22 +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 TriggerStatus. - /// - public static class TriggerStatus - { - public const string Disabled = "Disabled"; - public const string Enabled = "Enabled"; - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TriggerUpdateParameters.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TriggerUpdateParameters.cs deleted file mode 100644 index 0dc2d066cc86..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TriggerUpdateParameters.cs +++ /dev/null @@ -1,106 +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 for updating triggers. - /// - public partial class TriggerUpdateParameters - { - /// - /// Initializes a new instance of the TriggerUpdateParameters class. - /// - public TriggerUpdateParameters() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the TriggerUpdateParameters class. - /// - /// The collection of timer - /// triggers. - /// The collection of triggers based on - /// source code repository. - /// The trigger based on base image - /// dependencies. - public TriggerUpdateParameters(IList timerTriggers = default(IList), IList sourceTriggers = default(IList), BaseImageTriggerUpdateParameters baseImageTrigger = default(BaseImageTriggerUpdateParameters)) - { - TimerTriggers = timerTriggers; - SourceTriggers = sourceTriggers; - BaseImageTrigger = baseImageTrigger; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the collection of timer triggers. - /// - [JsonProperty(PropertyName = "timerTriggers")] - public IList TimerTriggers { get; set; } - - /// - /// Gets or sets the collection of triggers based on source code - /// repository. - /// - [JsonProperty(PropertyName = "sourceTriggers")] - public IList SourceTriggers { get; set; } - - /// - /// Gets or sets the trigger based on base image dependencies. - /// - [JsonProperty(PropertyName = "baseImageTrigger")] - public BaseImageTriggerUpdateParameters BaseImageTrigger { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (TimerTriggers != null) - { - foreach (var element in TimerTriggers) - { - if (element != null) - { - element.Validate(); - } - } - } - if (SourceTriggers != null) - { - foreach (var element1 in SourceTriggers) - { - if (element1 != null) - { - element1.Validate(); - } - } - } - if (BaseImageTrigger != null) - { - BaseImageTrigger.Validate(); - } - } - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/UpdateTriggerPayloadType.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/UpdateTriggerPayloadType.cs deleted file mode 100644 index 4ea80ed28401..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/UpdateTriggerPayloadType.cs +++ /dev/null @@ -1,22 +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 UpdateTriggerPayloadType. - /// - public static class UpdateTriggerPayloadType - { - public const string Default = "Default"; - public const string Token = "Token"; - } -} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Variant.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Variant.cs deleted file mode 100644 index 6adb3bba7e52..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Variant.cs +++ /dev/null @@ -1,23 +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 Variant. - /// - public static class Variant - { - public const string V6 = "v6"; - public const string V7 = "v7"; - public const string V8 = "v8"; - } -} 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 343bb80e5037..d29b9653617d 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Operations.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Operations.cs @@ -64,12 +64,21 @@ internal Operations(ContainerRegistryManagementClient client) /// /// 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(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - string apiVersion = "2019-05-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -77,7 +86,6 @@ internal Operations(ContainerRegistryManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -85,9 +93,9 @@ internal Operations(ContainerRegistryManagementClient client) var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.ContainerRegistry/operations").ToString(); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { 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 c0a558dd88c0..a78c72bcdafa 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/RegistriesOperations.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/RegistriesOperations.cs @@ -107,6 +107,10 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) /// public async System.Threading.Tasks.Task> CheckNameAvailabilityWithHttpMessagesAsync(string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -130,7 +134,6 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "name", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2019-05-01"; RegistryNameCheckRequest registryNameCheckRequest = new RegistryNameCheckRequest(); if (name != null) { @@ -143,7 +146,6 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("registryNameCheckRequest", registryNameCheckRequest); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "CheckNameAvailability", tracingParameters); @@ -153,9 +155,9 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/checkNameAvailability").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -320,6 +322,10 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) /// public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -354,7 +360,6 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2019-05-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -362,7 +367,6 @@ 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); @@ -375,9 +379,9 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -605,6 +609,10 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) /// public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -620,7 +628,6 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } - string apiVersion = "2019-05-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -628,7 +635,6 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) { _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); @@ -639,9 +645,9 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -794,11 +800,14 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) /// public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-05-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -806,7 +815,6 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -815,9 +823,9 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) 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)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -976,6 +984,10 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) /// public async System.Threading.Tasks.Task> ListCredentialsWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -1010,7 +1022,6 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2019-05-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1018,7 +1029,6 @@ 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); @@ -1031,9 +1041,9 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1197,6 +1207,10 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) /// public async System.Threading.Tasks.Task> RegenerateCredentialWithHttpMessagesAsync(string resourceGroupName, string registryName, PasswordName name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -1231,7 +1245,6 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2019-05-01"; RegenerateCredentialParameters regenerateCredentialParameters = new RegenerateCredentialParameters(); regenerateCredentialParameters.Name = name; // Tracing @@ -1241,7 +1254,6 @@ 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("regenerateCredentialParameters", regenerateCredentialParameters); @@ -1255,9 +1267,9 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1422,6 +1434,10 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) /// public async System.Threading.Tasks.Task> ListUsagesWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -1456,7 +1472,6 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2019-05-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1464,7 +1479,6 @@ 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); @@ -1477,9 +1491,9 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1606,248 +1620,6 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) return _result; } - /// - /// 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 belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The parameters of a run that needs to scheduled. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> ScheduleRunWithHttpMessagesAsync(string resourceGroupName, string registryName, RunRequest runRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginScheduleRunWithHttpMessagesAsync(resourceGroupName, registryName, runRequest, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// 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 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> GetBuildSourceUploadUrlWithHttpMessagesAsync(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-06-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("registryName", registryName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetBuildSourceUploadUrl", 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}/listBuildSourceUploadUrl").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; - // 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; - } - /// /// Copies an image to this container registry from the specified container /// registry. @@ -1882,6 +1654,10 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) /// public async System.Threading.Tasks.Task BeginImportImageWithHttpMessagesAsync(string resourceGroupName, string registryName, ImportImageParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -1924,7 +1700,6 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) { parameters.Validate(); } - string apiVersion = "2019-05-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1932,7 +1707,6 @@ 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("parameters", parameters); @@ -1946,9 +1720,9 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2098,6 +1872,10 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) /// public async System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string registryName, Registry registry, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -2140,7 +1918,6 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) { registry.Validate(); } - string apiVersion = "2019-05-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2148,7 +1925,6 @@ 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("registry", registry); @@ -2162,9 +1938,9 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2344,6 +2120,10 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) /// public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -2378,7 +2158,6 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2019-05-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2386,7 +2165,6 @@ 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); @@ -2399,9 +2177,9 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2545,6 +2323,10 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) /// public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, RegistryUpdateParameters registryUpdateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -2583,7 +2365,6 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "registryUpdateParameters"); } - string apiVersion = "2019-05-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2591,7 +2372,6 @@ 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("registryUpdateParameters", registryUpdateParameters); @@ -2605,9 +2385,9 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2758,237 +2538,6 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) return _result; } - /// - /// 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 belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The parameters of a run that needs to scheduled. - /// - /// - /// 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> BeginScheduleRunWithHttpMessagesAsync(string resourceGroupName, string registryName, RunRequest runRequest, 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 (runRequest == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "runRequest"); - } - string apiVersion = "2019-06-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("registryName", registryName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("runRequest", runRequest); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginScheduleRun", 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}/scheduleRun").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(runRequest != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(runRequest, 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. /// 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 f9e010d7e7fe..251649ee6036 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/RegistriesOperationsExtensions.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/RegistriesOperationsExtensions.cs @@ -466,94 +466,6 @@ public static RegistryUsageListResult ListUsages(this IRegistriesOperations oper } } - /// - /// Schedules a new run based on the request parameters and add it to the run - /// queue. - /// - /// - /// 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 of a run that needs to scheduled. - /// - public static Run ScheduleRun(this IRegistriesOperations operations, string resourceGroupName, string registryName, RunRequest runRequest) - { - return operations.ScheduleRunAsync(resourceGroupName, registryName, runRequest).GetAwaiter().GetResult(); - } - - /// - /// Schedules a new run based on the request parameters and add it to the run - /// queue. - /// - /// - /// 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 of a run that needs to scheduled. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task ScheduleRunAsync(this IRegistriesOperations operations, string resourceGroupName, string registryName, RunRequest runRequest, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ScheduleRunWithHttpMessagesAsync(resourceGroupName, registryName, runRequest, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get the upload location for the user to be able to upload the source. - /// - /// - /// 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 SourceUploadDefinition GetBuildSourceUploadUrl(this IRegistriesOperations operations, string resourceGroupName, string registryName) - { - return operations.GetBuildSourceUploadUrlAsync(resourceGroupName, registryName).GetAwaiter().GetResult(); - } - - /// - /// Get the upload location for the user to be able to upload the source. - /// - /// - /// 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 GetBuildSourceUploadUrlAsync(this IRegistriesOperations operations, string resourceGroupName, string registryName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetBuildSourceUploadUrlWithHttpMessagesAsync(resourceGroupName, registryName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Copies an image to this container registry from the specified container /// registry. @@ -730,54 +642,6 @@ public static Registry BeginUpdate(this IRegistriesOperations operations, string } } - /// - /// Schedules a new run based on the request parameters and add it to the run - /// queue. - /// - /// - /// 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 of a run that needs to scheduled. - /// - public static Run BeginScheduleRun(this IRegistriesOperations operations, string resourceGroupName, string registryName, RunRequest runRequest) - { - return operations.BeginScheduleRunAsync(resourceGroupName, registryName, runRequest).GetAwaiter().GetResult(); - } - - /// - /// Schedules a new run based on the request parameters and add it to the run - /// queue. - /// - /// - /// 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 of a run that needs to scheduled. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task BeginScheduleRunAsync(this IRegistriesOperations operations, string resourceGroupName, string registryName, RunRequest runRequest, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginScheduleRunWithHttpMessagesAsync(resourceGroupName, registryName, runRequest, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Lists all the container registries under the specified resource group. /// 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 b44eb4bb9fb9..106cc7ecf5a2 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ReplicationsOperations.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ReplicationsOperations.cs @@ -84,6 +84,10 @@ internal ReplicationsOperations(ContainerRegistryManagementClient client) /// public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string registryName, string replicationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -137,7 +141,6 @@ internal ReplicationsOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "replicationName", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2019-05-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -145,7 +148,6 @@ internal ReplicationsOperations(ContainerRegistryManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("registryName", registryName); tracingParameters.Add("replicationName", replicationName); @@ -160,9 +162,9 @@ internal ReplicationsOperations(ContainerRegistryManagementClient client) _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); _url = _url.Replace("{replicationName}", System.Uri.EscapeDataString(replicationName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -408,6 +410,10 @@ internal ReplicationsOperations(ContainerRegistryManagementClient client) /// public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -442,7 +448,6 @@ internal ReplicationsOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2019-05-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -450,7 +455,6 @@ internal ReplicationsOperations(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); @@ -463,9 +467,9 @@ internal ReplicationsOperations(ContainerRegistryManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -635,6 +639,10 @@ internal ReplicationsOperations(ContainerRegistryManagementClient client) /// public async System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string registryName, string replicationName, string location, IDictionary tags = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -692,7 +700,6 @@ internal ReplicationsOperations(ContainerRegistryManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "location"); } - string apiVersion = "2019-05-01"; Replication replication = new Replication(); if (location != null || tags != null) { @@ -706,7 +713,6 @@ internal ReplicationsOperations(ContainerRegistryManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("registryName", registryName); tracingParameters.Add("replicationName", replicationName); @@ -722,9 +728,9 @@ internal ReplicationsOperations(ContainerRegistryManagementClient client) _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); _url = _url.Replace("{replicationName}", System.Uri.EscapeDataString(replicationName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -907,6 +913,10 @@ internal ReplicationsOperations(ContainerRegistryManagementClient client) /// public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string replicationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -960,7 +970,6 @@ internal ReplicationsOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "replicationName", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2019-05-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -968,7 +977,6 @@ internal ReplicationsOperations(ContainerRegistryManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("registryName", registryName); tracingParameters.Add("replicationName", replicationName); @@ -983,9 +991,9 @@ internal ReplicationsOperations(ContainerRegistryManagementClient client) _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); _url = _url.Replace("{replicationName}", System.Uri.EscapeDataString(replicationName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1133,6 +1141,10 @@ internal ReplicationsOperations(ContainerRegistryManagementClient client) /// public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, string replicationName, IDictionary tags = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -1186,7 +1198,6 @@ internal ReplicationsOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "replicationName", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2019-05-01"; ReplicationUpdateParameters replicationUpdateParameters = new ReplicationUpdateParameters(); if (tags != null) { @@ -1199,7 +1210,6 @@ internal ReplicationsOperations(ContainerRegistryManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("registryName", registryName); tracingParameters.Add("replicationName", replicationName); @@ -1215,9 +1225,9 @@ internal ReplicationsOperations(ContainerRegistryManagementClient client) _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); _url = _url.Replace("{replicationName}", System.Uri.EscapeDataString(replicationName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/RunsOperations.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/RunsOperations.cs deleted file mode 100644 index dcdfea6ef500..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/RunsOperations.cs +++ /dev/null @@ -1,1420 +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 Microsoft.Rest.Azure.OData; - 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; - - /// - /// RunsOperations operations. - /// - internal partial class RunsOperations : IServiceOperations, IRunsOperations - { - /// - /// Initializes a new instance of the RunsOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal RunsOperations(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 all the runs for a registry. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// OData parameters to apply to the 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>> ListWithHttpMessagesAsync(string resourceGroupName, string registryName, ODataQuery odataQuery = default(ODataQuery), 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-06-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("registryName", registryName); - tracingParameters.Add("apiVersion", apiVersion); - 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}/runs").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 (odataQuery != null) - { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) - { - _queryParameters.Add(_odataFilter); - } - } - 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; - } - - /// - /// Gets the detailed information for a given run. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The run ID. - /// - /// - /// 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 runId, 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 (runId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "runId"); - } - string apiVersion = "2019-06-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("registryName", registryName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("runId", runId); - 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}/runs/{runId}").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("{runId}", System.Uri.EscapeDataString(runId)); - 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; - } - - /// - /// Patch the run properties. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The run ID. - /// - /// - /// The value that indicates whether archiving is enabled or not. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, string runId, bool? isArchiveEnabled = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, registryName, runId, isArchiveEnabled, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets a link to download the run logs. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The run ID. - /// - /// - /// 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> GetLogSasUrlWithHttpMessagesAsync(string resourceGroupName, string registryName, string runId, 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 (runId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "runId"); - } - string apiVersion = "2019-06-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("registryName", registryName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("runId", runId); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetLogSasUrl", 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}/runs/{runId}/listLogSasUrl").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("{runId}", System.Uri.EscapeDataString(runId)); - 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; - // 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; - } - - /// - /// Cancel an existing run. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The run ID. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task CancelWithHttpMessagesAsync(string resourceGroupName, string registryName, string runId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginCancelWithHttpMessagesAsync(resourceGroupName, registryName, runId, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Patch the run properties. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The run ID. - /// - /// - /// The value that indicates whether archiving is enabled or not. - /// - /// - /// 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 runId, bool? isArchiveEnabled = default(bool?), 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 (runId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "runId"); - } - string apiVersion = "2019-06-01-preview"; - RunUpdateParameters runUpdateParameters = new RunUpdateParameters(); - if (isArchiveEnabled != null) - { - runUpdateParameters.IsArchiveEnabled = isArchiveEnabled; - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("registryName", registryName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("runId", runId); - tracingParameters.Add("runUpdateParameters", runUpdateParameters); - 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}/runs/{runId}").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("{runId}", System.Uri.EscapeDataString(runId)); - 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(runUpdateParameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(runUpdateParameters, 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; - } - - /// - /// Cancel an existing run. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The run ID. - /// - /// - /// 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 BeginCancelWithHttpMessagesAsync(string resourceGroupName, string registryName, string runId, 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 (runId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "runId"); - } - string apiVersion = "2019-06-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("registryName", registryName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("runId", runId); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCancel", 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}/runs/{runId}/cancel").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("{runId}", System.Uri.EscapeDataString(runId)); - 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; - // 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(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Gets all the runs for a 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/RunsOperationsExtensions.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/RunsOperationsExtensions.cs deleted file mode 100644 index 408b5dbc9f12..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/RunsOperationsExtensions.cs +++ /dev/null @@ -1,387 +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 Microsoft.Rest.Azure.OData; - using Models; - using System.Threading; - - /// - /// Extension methods for RunsOperations. - /// - public static partial class RunsOperationsExtensions - { - /// - /// Gets all the runs for a 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. - /// - /// - /// OData parameters to apply to the operation. - /// - public static IPage List(this IRunsOperations operations, string resourceGroupName, string registryName, ODataQuery odataQuery = default(ODataQuery)) - { - return operations.ListAsync(resourceGroupName, registryName, odataQuery).GetAwaiter().GetResult(); - } - - /// - /// Gets all the runs for a 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. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task> ListAsync(this IRunsOperations operations, string resourceGroupName, string registryName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, registryName, odataQuery, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the detailed information for a given 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 run ID. - /// - public static Run Get(this IRunsOperations operations, string resourceGroupName, string registryName, string runId) - { - return operations.GetAsync(resourceGroupName, registryName, runId).GetAwaiter().GetResult(); - } - - /// - /// Gets the detailed information for a given 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 run ID. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task GetAsync(this IRunsOperations operations, string resourceGroupName, string registryName, string runId, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, registryName, runId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Patch the run properties. - /// - /// - /// 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 run ID. - /// - /// - /// The value that indicates whether archiving is enabled or not. - /// - public static Run Update(this IRunsOperations operations, string resourceGroupName, string registryName, string runId, bool? isArchiveEnabled = default(bool?)) - { - return operations.UpdateAsync(resourceGroupName, registryName, runId, isArchiveEnabled).GetAwaiter().GetResult(); - } - - /// - /// Patch the run properties. - /// - /// - /// 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 run ID. - /// - /// - /// The value that indicates whether archiving is enabled or not. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task UpdateAsync(this IRunsOperations operations, string resourceGroupName, string registryName, string runId, bool? isArchiveEnabled = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, registryName, runId, isArchiveEnabled, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a link to download the run logs. - /// - /// - /// 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 run ID. - /// - public static RunGetLogResult GetLogSasUrl(this IRunsOperations operations, string resourceGroupName, string registryName, string runId) - { - return operations.GetLogSasUrlAsync(resourceGroupName, registryName, runId).GetAwaiter().GetResult(); - } - - /// - /// Gets a link to download the run logs. - /// - /// - /// 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 run ID. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task GetLogSasUrlAsync(this IRunsOperations operations, string resourceGroupName, string registryName, string runId, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetLogSasUrlWithHttpMessagesAsync(resourceGroupName, registryName, runId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Cancel an existing 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 run ID. - /// - public static void Cancel(this IRunsOperations operations, string resourceGroupName, string registryName, string runId) - { - operations.CancelAsync(resourceGroupName, registryName, runId).GetAwaiter().GetResult(); - } - - /// - /// Cancel an existing 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 run ID. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task CancelAsync(this IRunsOperations operations, string resourceGroupName, string registryName, string runId, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.CancelWithHttpMessagesAsync(resourceGroupName, registryName, runId, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Patch the run properties. - /// - /// - /// 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 run ID. - /// - /// - /// The value that indicates whether archiving is enabled or not. - /// - public static Run BeginUpdate(this IRunsOperations operations, string resourceGroupName, string registryName, string runId, bool? isArchiveEnabled = default(bool?)) - { - return operations.BeginUpdateAsync(resourceGroupName, registryName, runId, isArchiveEnabled).GetAwaiter().GetResult(); - } - - /// - /// Patch the run properties. - /// - /// - /// 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 run ID. - /// - /// - /// The value that indicates whether archiving is enabled or not. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task BeginUpdateAsync(this IRunsOperations operations, string resourceGroupName, string registryName, string runId, bool? isArchiveEnabled = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, registryName, runId, isArchiveEnabled, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Cancel an existing 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 run ID. - /// - public static void BeginCancel(this IRunsOperations operations, string resourceGroupName, string registryName, string runId) - { - operations.BeginCancelAsync(resourceGroupName, registryName, runId).GetAwaiter().GetResult(); - } - - /// - /// Cancel an existing 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 run ID. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task BeginCancelAsync(this IRunsOperations operations, string resourceGroupName, string registryName, string runId, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginCancelWithHttpMessagesAsync(resourceGroupName, registryName, runId, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets all the runs for a registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IRunsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all the runs for a 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 IRunsOperations 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 3d8804e0c1f3..dafe0a87f898 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 @@ -19,13 +19,10 @@ public static IEnumerable> ApiInfo_ContainerRegist { return new Tuple[] { - new Tuple("ContainerRegistry", "Operations", "2019-05-01"), - new Tuple("ContainerRegistry", "Registries", "2019-05-01"), - new Tuple("ContainerRegistry", "Registries", "2019-06-01-preview"), - new Tuple("ContainerRegistry", "Replications", "2019-05-01"), - new Tuple("ContainerRegistry", "Runs", "2019-06-01-preview"), - new Tuple("ContainerRegistry", "Tasks", "2019-06-01-preview"), - new Tuple("ContainerRegistry", "Webhooks", "2019-05-01"), + new Tuple("ContainerRegistry", "Operations", "2019-12-01-preview"), + new Tuple("ContainerRegistry", "Registries", "2019-12-01-preview"), + new Tuple("ContainerRegistry", "Replications", "2019-12-01-preview"), + new Tuple("ContainerRegistry", "Webhooks", "2019-12-01-preview"), }.AsEnumerable(); } } diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/TasksOperations.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/TasksOperations.cs deleted file mode 100644 index bbf284e9bf6e..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/TasksOperations.cs +++ /dev/null @@ -1,1770 +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; - - /// - /// TasksOperations operations. - /// - internal partial class TasksOperations : IServiceOperations, ITasksOperations - { - /// - /// Initializes a new instance of the TasksOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal TasksOperations(ContainerRegistryManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the ContainerRegistryManagementClient - /// - public ContainerRegistryManagementClient Client { get; private set; } - - /// - /// Lists all the tasks for a 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-06-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("registryName", registryName); - tracingParameters.Add("apiVersion", apiVersion); - 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}/tasks").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; - } - - /// - /// Get the properties of a specified task. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the container registry task. - /// - /// - /// 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 taskName, 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 (taskName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "taskName"); - } - if (taskName != null) - { - if (taskName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "taskName", 50); - } - if (taskName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "taskName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(taskName, "^[a-zA-Z0-9-_]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "taskName", "^[a-zA-Z0-9-_]*$"); - } - } - string apiVersion = "2019-06-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("registryName", registryName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("taskName", taskName); - 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}/tasks/{taskName}").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("{taskName}", System.Uri.EscapeDataString(taskName)); - 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 task 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 container registry task. - /// - /// - /// The parameters for creating a task. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string registryName, string taskName, Task taskCreateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, registryName, taskName, taskCreateParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes a specified task. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the container registry task. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string taskName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, registryName, taskName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Updates a task 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 container registry task. - /// - /// - /// The parameters for updating a task. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, string taskName, TaskUpdateParameters taskUpdateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, registryName, taskName, taskUpdateParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Returns a task with extended information that includes all secrets. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the container registry task. - /// - /// - /// 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> GetDetailsWithHttpMessagesAsync(string resourceGroupName, string registryName, string taskName, 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 (taskName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "taskName"); - } - if (taskName != null) - { - if (taskName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "taskName", 50); - } - if (taskName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "taskName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(taskName, "^[a-zA-Z0-9-_]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "taskName", "^[a-zA-Z0-9-_]*$"); - } - } - string apiVersion = "2019-06-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("registryName", registryName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("taskName", taskName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetDetails", 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}/tasks/{taskName}/listDetails").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("{taskName}", System.Uri.EscapeDataString(taskName)); - 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; - // 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 task 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 container registry task. - /// - /// - /// The parameters for creating a task. - /// - /// - /// 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 taskName, Task taskCreateParameters, 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 (taskName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "taskName"); - } - if (taskName != null) - { - if (taskName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "taskName", 50); - } - if (taskName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "taskName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(taskName, "^[a-zA-Z0-9-_]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "taskName", "^[a-zA-Z0-9-_]*$"); - } - } - if (taskCreateParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "taskCreateParameters"); - } - if (taskCreateParameters != null) - { - taskCreateParameters.Validate(); - } - string apiVersion = "2019-06-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("registryName", registryName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("taskName", taskName); - tracingParameters.Add("taskCreateParameters", taskCreateParameters); - 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}/tasks/{taskName}").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("{taskName}", System.Uri.EscapeDataString(taskName)); - 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(taskCreateParameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(taskCreateParameters, 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 specified task. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the container registry task. - /// - /// - /// 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 taskName, 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 (taskName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "taskName"); - } - if (taskName != null) - { - if (taskName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "taskName", 50); - } - if (taskName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "taskName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(taskName, "^[a-zA-Z0-9-_]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "taskName", "^[a-zA-Z0-9-_]*$"); - } - } - string apiVersion = "2019-06-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("registryName", registryName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("taskName", taskName); - 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}/tasks/{taskName}").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("{taskName}", System.Uri.EscapeDataString(taskName)); - 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 task 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 container registry task. - /// - /// - /// The parameters for updating a task. - /// - /// - /// 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 taskName, TaskUpdateParameters taskUpdateParameters, 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 (taskName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "taskName"); - } - if (taskName != null) - { - if (taskName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "taskName", 50); - } - if (taskName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "taskName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(taskName, "^[a-zA-Z0-9-_]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "taskName", "^[a-zA-Z0-9-_]*$"); - } - } - if (taskUpdateParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "taskUpdateParameters"); - } - string apiVersion = "2019-06-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("registryName", registryName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("taskName", taskName); - tracingParameters.Add("taskUpdateParameters", taskUpdateParameters); - 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}/tasks/{taskName}").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("{taskName}", System.Uri.EscapeDataString(taskName)); - 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(taskUpdateParameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(taskUpdateParameters, 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 tasks for a 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/TasksOperationsExtensions.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/TasksOperationsExtensions.cs deleted file mode 100644 index 8e1a77173a40..000000000000 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/TasksOperationsExtensions.cs +++ /dev/null @@ -1,484 +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 TasksOperations. - /// - public static partial class TasksOperationsExtensions - { - /// - /// Lists all the tasks for 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. - /// - public static IPage List(this ITasksOperations operations, string resourceGroupName, string registryName) - { - return operations.ListAsync(resourceGroupName, registryName).GetAwaiter().GetResult(); - } - - /// - /// Lists all the tasks for 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 cancellation token. - /// - public static async System.Threading.Tasks.Task> ListAsync(this ITasksOperations 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 properties of a specified task. - /// - /// - /// 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 container registry task. - /// - public static Task Get(this ITasksOperations operations, string resourceGroupName, string registryName, string taskName) - { - return operations.GetAsync(resourceGroupName, registryName, taskName).GetAwaiter().GetResult(); - } - - /// - /// Get the properties of a specified task. - /// - /// - /// 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 container registry task. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task GetAsync(this ITasksOperations operations, string resourceGroupName, string registryName, string taskName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, registryName, taskName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates a task 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 container registry task. - /// - /// - /// The parameters for creating a task. - /// - public static Task Create(this ITasksOperations operations, string resourceGroupName, string registryName, string taskName, Task taskCreateParameters) - { - return operations.CreateAsync(resourceGroupName, registryName, taskName, taskCreateParameters).GetAwaiter().GetResult(); - } - - /// - /// Creates a task 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 container registry task. - /// - /// - /// The parameters for creating a task. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task CreateAsync(this ITasksOperations operations, string resourceGroupName, string registryName, string taskName, Task taskCreateParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, registryName, taskName, taskCreateParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a specified task. - /// - /// - /// 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 container registry task. - /// - public static void Delete(this ITasksOperations operations, string resourceGroupName, string registryName, string taskName) - { - operations.DeleteAsync(resourceGroupName, registryName, taskName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a specified task. - /// - /// - /// 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 container registry task. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task DeleteAsync(this ITasksOperations operations, string resourceGroupName, string registryName, string taskName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, registryName, taskName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Updates a task 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 container registry task. - /// - /// - /// The parameters for updating a task. - /// - public static Task Update(this ITasksOperations operations, string resourceGroupName, string registryName, string taskName, TaskUpdateParameters taskUpdateParameters) - { - return operations.UpdateAsync(resourceGroupName, registryName, taskName, taskUpdateParameters).GetAwaiter().GetResult(); - } - - /// - /// Updates a task 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 container registry task. - /// - /// - /// The parameters for updating a task. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task UpdateAsync(this ITasksOperations operations, string resourceGroupName, string registryName, string taskName, TaskUpdateParameters taskUpdateParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, registryName, taskName, taskUpdateParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Returns a task with extended information that includes all secrets. - /// - /// - /// 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 container registry task. - /// - public static Task GetDetails(this ITasksOperations operations, string resourceGroupName, string registryName, string taskName) - { - return operations.GetDetailsAsync(resourceGroupName, registryName, taskName).GetAwaiter().GetResult(); - } - - /// - /// Returns a task with extended information that includes all secrets. - /// - /// - /// 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 container registry task. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task GetDetailsAsync(this ITasksOperations operations, string resourceGroupName, string registryName, string taskName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetDetailsWithHttpMessagesAsync(resourceGroupName, registryName, taskName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates a task 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 container registry task. - /// - /// - /// The parameters for creating a task. - /// - public static Task BeginCreate(this ITasksOperations operations, string resourceGroupName, string registryName, string taskName, Task taskCreateParameters) - { - return operations.BeginCreateAsync(resourceGroupName, registryName, taskName, taskCreateParameters).GetAwaiter().GetResult(); - } - - /// - /// Creates a task 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 container registry task. - /// - /// - /// The parameters for creating a task. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task BeginCreateAsync(this ITasksOperations operations, string resourceGroupName, string registryName, string taskName, Task taskCreateParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateWithHttpMessagesAsync(resourceGroupName, registryName, taskName, taskCreateParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a specified task. - /// - /// - /// 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 container registry task. - /// - public static void BeginDelete(this ITasksOperations operations, string resourceGroupName, string registryName, string taskName) - { - operations.BeginDeleteAsync(resourceGroupName, registryName, taskName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a specified task. - /// - /// - /// 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 container registry task. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task BeginDeleteAsync(this ITasksOperations operations, string resourceGroupName, string registryName, string taskName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, registryName, taskName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Updates a task 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 container registry task. - /// - /// - /// The parameters for updating a task. - /// - public static Task BeginUpdate(this ITasksOperations operations, string resourceGroupName, string registryName, string taskName, TaskUpdateParameters taskUpdateParameters) - { - return operations.BeginUpdateAsync(resourceGroupName, registryName, taskName, taskUpdateParameters).GetAwaiter().GetResult(); - } - - /// - /// Updates a task 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 container registry task. - /// - /// - /// The parameters for updating a task. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task BeginUpdateAsync(this ITasksOperations operations, string resourceGroupName, string registryName, string taskName, TaskUpdateParameters taskUpdateParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, registryName, taskName, taskUpdateParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all the tasks for a 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 ITasksOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all the tasks for a 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 ITasksOperations 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 e9996d857e25..91ff80b0275c 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/WebhooksOperations.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/WebhooksOperations.cs @@ -84,6 +84,10 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) /// public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string registryName, string webhookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -137,7 +141,6 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "webhookName", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2019-05-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -145,7 +148,6 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("registryName", registryName); tracingParameters.Add("webhookName", webhookName); @@ -160,9 +162,9 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); _url = _url.Replace("{webhookName}", System.Uri.EscapeDataString(webhookName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -402,6 +404,10 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) /// public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -436,7 +442,6 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2019-05-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -444,7 +449,6 @@ internal WebhooksOperations(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); @@ -457,9 +461,9 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -621,6 +625,10 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) /// public async System.Threading.Tasks.Task> PingWithHttpMessagesAsync(string resourceGroupName, string registryName, string webhookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -674,7 +682,6 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "webhookName", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2019-05-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -682,7 +689,6 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("registryName", registryName); tracingParameters.Add("webhookName", webhookName); @@ -697,9 +703,9 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); _url = _url.Replace("{webhookName}", System.Uri.EscapeDataString(webhookName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -861,6 +867,10 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) /// public async System.Threading.Tasks.Task> GetCallbackConfigWithHttpMessagesAsync(string resourceGroupName, string registryName, string webhookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -914,7 +924,6 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "webhookName", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2019-05-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -922,7 +931,6 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("registryName", registryName); tracingParameters.Add("webhookName", webhookName); @@ -937,9 +945,9 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); _url = _url.Replace("{webhookName}", System.Uri.EscapeDataString(webhookName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1101,6 +1109,10 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) /// public async System.Threading.Tasks.Task>> ListEventsWithHttpMessagesAsync(string resourceGroupName, string registryName, string webhookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -1154,7 +1166,6 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "webhookName", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2019-05-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1162,7 +1173,6 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("registryName", registryName); tracingParameters.Add("webhookName", webhookName); @@ -1177,9 +1187,9 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); _url = _url.Replace("{webhookName}", System.Uri.EscapeDataString(webhookName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1344,6 +1354,10 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) /// public async System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string registryName, string webhookName, WebhookCreateParameters webhookCreateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -1405,7 +1419,6 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) { webhookCreateParameters.Validate(); } - string apiVersion = "2019-05-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1413,7 +1426,6 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("registryName", registryName); tracingParameters.Add("webhookName", webhookName); @@ -1429,9 +1441,9 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); _url = _url.Replace("{webhookName}", System.Uri.EscapeDataString(webhookName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1614,6 +1626,10 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) /// public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string webhookName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -1667,7 +1683,6 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "webhookName", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2019-05-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1675,7 +1690,6 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("registryName", registryName); tracingParameters.Add("webhookName", webhookName); @@ -1690,9 +1704,9 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); _url = _url.Replace("{webhookName}", System.Uri.EscapeDataString(webhookName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1839,6 +1853,10 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) /// public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, string webhookName, WebhookUpdateParameters webhookUpdateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -1896,7 +1914,6 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "webhookUpdateParameters"); } - string apiVersion = "2019-05-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1904,7 +1921,6 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("registryName", registryName); tracingParameters.Add("webhookName", webhookName); @@ -1920,9 +1936,9 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); _url = _url.Replace("{webhookName}", System.Uri.EscapeDataString(webhookName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) {