From afbdcb74fa39b083b14f9ba1614101297bdcc46e Mon Sep 17 00:00:00 2001 From: adxsdknet <39844661+adxsdknet@users.noreply.github.com> Date: Tue, 28 May 2019 10:32:06 -0700 Subject: [PATCH] .NET SDK Resource Provider:'ContainerRegistry' (#6416) REST Spec PR 'https://github.com/Azure/azure-rest-api-specs/pull/6111' REST Spec PR Author 'lmazuel' REST Spec PR Last commit --- src/SDKs/ContainerRegistry/AzSdk.RP.props | 2 +- .../ContainerRegistryManagementClient.cs | 18 +- .../IContainerRegistryManagementClient.cs | 8 +- .../Generated/IRegistriesOperations.cs | 91 +-- ...TokensOperations.cs => IRunsOperations.cs} | 117 ++-- ...eMapsOperations.cs => ITasksOperations.cs} | 133 +++-- .../Generated/Models/AgentProperties.cs | 53 ++ ...okenCertificateName.cs => Architecture.cs} | 9 +- .../Generated/Models/Argument.cs | 87 +++ .../Generated/Models/AuthInfo.cs | 107 ++++ .../Models/AuthInfoUpdateParameters.cs | 89 +++ .../Generated/Models/BaseImageDependency.cs | 86 +++ .../Models/BaseImageDependencyType.cs | 22 + .../Generated/Models/BaseImageTrigger.cs | 90 +++ ...asswordName.cs => BaseImageTriggerType.cs} | 8 +- .../BaseImageTriggerUpdateParameters.cs | 88 +++ .../Generated/Models/Credentials.cs | 74 +++ .../Models/CustomRegistryCredentials.cs | 90 +++ .../Generated/Models/DockerBuildRequest.cs | 199 +++++++ .../Generated/Models/DockerBuildStep.cs | 138 +++++ .../Models/DockerBuildStepUpdateParameters.cs | 114 ++++ .../Generated/Models/EncodedTaskRunRequest.cs | 169 ++++++ .../Generated/Models/EncodedTaskStep.cs | 108 ++++ .../Models/EncodedTaskStepUpdateParameters.cs | 84 +++ .../Generated/Models/FileTaskRunRequest.cs | 169 ++++++ .../Generated/Models/FileTaskStep.cs | 108 ++++ .../Models/FileTaskStepUpdateParameters.cs | 84 +++ .../Models/GenerateCredentialsParameters.cs | 78 --- .../Models/GenerateCredentialsResult.cs | 63 --- .../Generated/Models/IdentityProperties.cs | 90 +++ .../Generated/Models/ImageDescriptor.cs | 76 +++ .../Generated/Models/ImageUpdateTrigger.cs | 71 +++ .../Generated/Models/OS.cs | 22 + .../Generated/Models/PlatformProperties.cs | 87 +++ .../Models/PlatformUpdateParameters.cs | 73 +++ .../{RegistryPolicies.cs => Policies.cs} | 35 +- .../Generated/Models/QuarantinePolicy.cs | 2 +- .../Generated/Models/Registry.cs | 13 +- .../Models/RegistryUpdateParameters.cs | 29 +- .../Generated/Models/Replication.cs | 4 +- .../Generated/Models/ResourceIdentityType.cs | 72 +++ .../Generated/Models/RetentionPolicy.cs | 73 +++ .../Generated/Models/Run.cs | 240 ++++++++ .../Generated/Models/RunFilter.cs | 121 ++++ .../Generated/Models/RunGetLogResult.cs | 53 ++ .../Generated/Models/RunRequest.cs | 53 ++ .../Generated/Models/RunStatus.cs | 28 + .../Generated/Models/RunType.cs | 24 + .../Generated/Models/RunUpdateParameters.cs | 53 ++ .../Generated/Models/ScopeMap.cs | 116 ---- .../Models/ScopeMapUpdateParameters.cs | 70 --- .../Generated/Models/SecretObject.cs | 72 +++ .../Generated/Models/SecretObjectType.cs | 22 + .../Generated/Models/SetValue.cs | 88 +++ .../Generated/Models/SourceControlType.cs | 22 + .../Generated/Models/SourceProperties.cs | 105 ++++ .../Models/SourceRegistryCredentials.cs | 62 ++ .../Models/SourceRegistryLoginMode.cs | 22 + .../Generated/Models/SourceTrigger.cs | 108 ++++ .../Models/SourceTriggerDescriptor.cs | 102 ++++ .../Generated/Models/SourceTriggerEvent.cs | 22 + .../Models/SourceTriggerUpdateParameters.cs | 98 ++++ .../Models/SourceUpdateParameters.cs | 83 +++ .../Models/SourceUploadDefinition.cs | 62 ++ .../Generated/Models/Status.cs | 57 +- .../Generated/Models/Status1.cs | 71 --- .../Generated/Models/Task.cs | 183 ++++++ .../Generated/Models/TaskRunRequest.cs | 91 +++ .../Generated/Models/TaskStatus.cs | 22 + .../Generated/Models/TaskStepProperties.cs | 75 +++ .../Models/TaskStepUpdateParameters.cs | 64 +++ .../Generated/Models/TaskUpdateParameters.cs | 141 +++++ .../Generated/Models/TimerTrigger.cs | 88 +++ .../Models/TimerTriggerUpdateParameters.cs | 86 +++ .../Generated/Models/Token.cs | 110 ---- .../Generated/Models/TokenCertificate.cs | 81 --- .../Models/TokenCredentialsProperties.cs | 58 -- .../Generated/Models/TokenPassword.cs | 79 --- .../Generated/Models/TokenType.cs | 22 + .../Generated/Models/TokenUpdateParameters.cs | 76 --- .../Generated/Models/TriggerProperties.cs | 106 ++++ .../Generated/Models/TriggerStatus.cs | 22 + .../Models/TriggerUpdateParameters.cs | 106 ++++ .../Generated/Models/TrustPolicy.cs | 3 +- .../Models/UserIdentityProperties.cs | 58 ++ .../Generated/Models/Variant.cs | 23 + .../Generated/Operations.cs | 2 +- .../Generated/RegistriesOperations.cs | 383 ++----------- .../RegistriesOperationsExtensions.cs | 160 +----- .../Generated/ReplicationsOperations.cs | 10 +- ...{TokensOperations.cs => RunsOperations.cs} | 494 +++++++--------- ...ensions.cs => RunsOperationsExtensions.cs} | 235 +++----- ...kInfo_ContainerRegistryManagementClient.cs | 14 +- ...peMapsOperations.cs => TasksOperations.cs} | 528 ++++++++++++------ ...nsions.cs => TasksOperationsExtensions.cs} | 284 +++++----- .../Generated/WebhooksOperations.cs | 16 +- 96 files changed, 6215 insertions(+), 2292 deletions(-) rename src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/{ITokensOperations.cs => IRunsOperations.cs} (62%) rename src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/{IScopeMapsOperations.cs => ITasksOperations.cs} (66%) create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/AgentProperties.cs rename src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/{TokenCertificateName.cs => Architecture.cs} (68%) create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/Argument.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/AuthInfo.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/AuthInfoUpdateParameters.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/BaseImageDependency.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/BaseImageDependencyType.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/BaseImageTrigger.cs rename src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/{TokenPasswordName.cs => BaseImageTriggerType.cs} (70%) create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/BaseImageTriggerUpdateParameters.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/Credentials.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/CustomRegistryCredentials.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/DockerBuildRequest.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/DockerBuildStep.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/DockerBuildStepUpdateParameters.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/EncodedTaskRunRequest.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/EncodedTaskStep.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/EncodedTaskStepUpdateParameters.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/FileTaskRunRequest.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/FileTaskStep.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/FileTaskStepUpdateParameters.cs delete mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/GenerateCredentialsParameters.cs delete mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/GenerateCredentialsResult.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/IdentityProperties.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/ImageDescriptor.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/ImageUpdateTrigger.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/OS.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/PlatformProperties.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/PlatformUpdateParameters.cs rename src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/{RegistryPolicies.cs => Policies.cs} (51%) create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/ResourceIdentityType.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/RetentionPolicy.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/Run.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/RunFilter.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/RunGetLogResult.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/RunRequest.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/RunStatus.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/RunType.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/RunUpdateParameters.cs delete mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/ScopeMap.cs delete mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/ScopeMapUpdateParameters.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SecretObject.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SecretObjectType.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SetValue.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SourceControlType.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SourceProperties.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SourceRegistryCredentials.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SourceRegistryLoginMode.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SourceTrigger.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SourceTriggerDescriptor.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SourceTriggerEvent.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SourceTriggerUpdateParameters.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SourceUpdateParameters.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SourceUploadDefinition.cs delete mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/Status1.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/Task.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TaskRunRequest.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TaskStatus.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TaskStepProperties.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TaskStepUpdateParameters.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TaskUpdateParameters.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TimerTrigger.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TimerTriggerUpdateParameters.cs delete mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/Token.cs delete mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TokenCertificate.cs delete mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TokenCredentialsProperties.cs delete mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TokenPassword.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TokenType.cs delete mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TokenUpdateParameters.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TriggerProperties.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TriggerStatus.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TriggerUpdateParameters.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/UserIdentityProperties.cs create mode 100644 src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/Variant.cs rename src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/{TokensOperations.cs => RunsOperations.cs} (82%) rename src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/{TokensOperationsExtensions.cs => RunsOperationsExtensions.cs} (52%) rename src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/{ScopeMapsOperations.cs => TasksOperations.cs} (76%) rename src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/{ScopeMapsOperationsExtensions.cs => TasksOperationsExtensions.cs} (56%) diff --git a/src/SDKs/ContainerRegistry/AzSdk.RP.props b/src/SDKs/ContainerRegistry/AzSdk.RP.props index 9c79e71c504d5..1a2a148f341b4 100644 --- a/src/SDKs/ContainerRegistry/AzSdk.RP.props +++ b/src/SDKs/ContainerRegistry/AzSdk.RP.props @@ -1,7 +1,7 @@ - ContainerRegistry_2017-10-01;ContainerRegistry_2019-05-01-preview; + ContainerRegistry_2019-05-01;ContainerRegistry_2019-04-01; $(PackageTags);$(CommonTags);$(AzureApiTag); \ No newline at end of file diff --git a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/ContainerRegistryManagementClient.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/ContainerRegistryManagementClient.cs index 5d070a2a1e3ca..b8f5a8bb5e92c 100644 --- a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/ContainerRegistryManagementClient.cs +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/ContainerRegistryManagementClient.cs @@ -87,14 +87,14 @@ public partial class ContainerRegistryManagementClient : ServiceClient - /// Gets the IScopeMapsOperations. + /// Gets the IRunsOperations. /// - public virtual IScopeMapsOperations ScopeMaps { get; private set; } + public virtual IRunsOperations Runs { get; private set; } /// - /// Gets the ITokensOperations. + /// Gets the ITasksOperations. /// - public virtual ITokensOperations Tokens { get; private set; } + public virtual ITasksOperations Tasks { get; private set; } /// /// Initializes a new instance of the ContainerRegistryManagementClient class. @@ -341,8 +341,8 @@ private void Initialize() Operations = new Operations(this); Replications = new ReplicationsOperations(this); Webhooks = new WebhooksOperations(this); - ScopeMaps = new ScopeMapsOperations(this); - Tokens = new TokensOperations(this); + Runs = new RunsOperations(this); + Tasks = new TasksOperations(this); BaseUri = new System.Uri("https://management.azure.com"); AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; @@ -373,6 +373,12 @@ 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/IContainerRegistryManagementClient.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/IContainerRegistryManagementClient.cs index 6960ea760ae70..e245c60618293 100644 --- a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/IContainerRegistryManagementClient.cs +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/IContainerRegistryManagementClient.cs @@ -84,14 +84,14 @@ public partial interface IContainerRegistryManagementClient : System.IDisposable IWebhooksOperations Webhooks { get; } /// - /// Gets the IScopeMapsOperations. + /// Gets the IRunsOperations. /// - IScopeMapsOperations ScopeMaps { get; } + IRunsOperations Runs { get; } /// - /// Gets the ITokensOperations. + /// Gets the ITasksOperations. /// - ITokensOperations Tokens { get; } + ITasksOperations Tasks { get; } } } diff --git a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/IRegistriesOperations.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/IRegistriesOperations.cs index 68c284d2b1409..4c90452f8283d 100644 --- a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/IRegistriesOperations.cs +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/IRegistriesOperations.cs @@ -310,7 +310,8 @@ public partial interface IRegistriesOperations /// System.Threading.Tasks.Task> ListUsagesWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists the policies for the specified container registry. + /// 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 @@ -319,39 +320,8 @@ public partial interface IRegistriesOperations /// /// 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> ListPoliciesWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Updates the policies for the specified container registry. - /// - /// - /// The name of the resource group to which the container registry - /// belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// An object that represents quarantine policy for a container - /// registry. - /// - /// - /// An object that represents content trust policy for a container - /// registry. + /// + /// The parameters of a run that needs to scheduled. /// /// /// The headers that will be added to request. @@ -368,9 +338,10 @@ public partial interface IRegistriesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> UpdatePoliciesWithHttpMessagesAsync(string resourceGroupName, string registryName, QuarantinePolicy quarantinePolicy = default(QuarantinePolicy), TrustPolicy trustPolicy = default(TrustPolicy), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ScheduleRunWithHttpMessagesAsync(string resourceGroupName, string registryName, RunRequest runRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Generate keys for a token of a specified container registry. + /// Get the upload location for the user to be able to upload the + /// source. /// /// /// The name of the resource group to which the container registry @@ -379,9 +350,6 @@ public partial interface IRegistriesOperations /// /// The name of the container registry. /// - /// - /// The parameters for generating credentials. - /// /// /// The headers that will be added to request. /// @@ -397,7 +365,7 @@ public partial interface IRegistriesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GenerateCredentialsWithHttpMessagesAsync(string resourceGroupName, string registryName, GenerateCredentialsParameters generateCredentialsParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetBuildSourceUploadUrlWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Copies an image to this container registry from the specified /// container registry. @@ -508,41 +476,8 @@ public partial interface IRegistriesOperations /// System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, RegistryUpdateParameters registryUpdateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Updates the policies for the specified container registry. - /// - /// - /// The name of the resource group to which the container registry - /// belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// An object that represents quarantine policy for a container - /// registry. - /// - /// - /// An object that represents content trust policy for a 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> BeginUpdatePoliciesWithHttpMessagesAsync(string resourceGroupName, string registryName, QuarantinePolicy quarantinePolicy = default(QuarantinePolicy), TrustPolicy trustPolicy = default(TrustPolicy), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Generate keys for a token of a specified container registry. + /// 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 @@ -551,8 +486,8 @@ public partial interface IRegistriesOperations /// /// The name of the container registry. /// - /// - /// The parameters for generating credentials. + /// + /// The parameters of a run that needs to scheduled. /// /// /// The headers that will be added to request. @@ -569,7 +504,7 @@ public partial interface IRegistriesOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> BeginGenerateCredentialsWithHttpMessagesAsync(string resourceGroupName, string registryName, GenerateCredentialsParameters generateCredentialsParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/ITokensOperations.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/IRunsOperations.cs similarity index 62% rename from src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/ITokensOperations.cs rename to src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/IRunsOperations.cs index 54ea4e6b411e2..b3e05481a630c 100644 --- a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/ITokensOperations.cs +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/IRunsOperations.cs @@ -12,18 +12,19 @@ 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; /// - /// TokensOperations operations. + /// RunsOperations operations. /// - public partial interface ITokensOperations + public partial interface IRunsOperations { /// - /// Gets the properties of the specified token. + /// Gets all the runs for a registry. /// /// /// The name of the resource group to which the container registry @@ -32,8 +33,8 @@ public partial interface ITokensOperations /// /// The name of the container registry. /// - /// - /// The name of the token. + /// + /// OData parameters to apply to the operation. /// /// /// The headers that will be added to request. @@ -50,10 +51,9 @@ public partial interface ITokensOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string registryName, string tokenName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string registryName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates a token for a container registry with the specified - /// parameters. + /// Gets the detailed information for a given run. /// /// /// The name of the resource group to which the container registry @@ -62,11 +62,8 @@ public partial interface ITokensOperations /// /// The name of the container registry. /// - /// - /// The name of the token. - /// - /// - /// The parameters for creating a token. + /// + /// The run ID. /// /// /// The headers that will be added to request. @@ -83,35 +80,9 @@ public partial interface ITokensOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string registryName, string tokenName, Token tokenCreateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes a token from a container registry. - /// - /// - /// The name of the resource group to which the container registry - /// belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the token. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string tokenName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string registryName, string runId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Updates a token with the specified parameters. + /// Patch the run properties. /// /// /// The name of the resource group to which the container registry @@ -120,11 +91,11 @@ public partial interface ITokensOperations /// /// The name of the container registry. /// - /// - /// The name of the token. + /// + /// The run ID. /// - /// - /// The parameters for updating a token. + /// + /// The value that indicates whether archiving is enabled or not. /// /// /// The headers that will be added to request. @@ -141,9 +112,9 @@ public partial interface ITokensOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, string tokenName, TokenUpdateParameters tokenUpdateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, string runId, bool? isArchiveEnabled = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists all the tokens for the specified container registry. + /// Gets a link to download the run logs. /// /// /// The name of the resource group to which the container registry @@ -152,6 +123,9 @@ public partial interface ITokensOperations /// /// The name of the container registry. /// + /// + /// The run ID. + /// /// /// The headers that will be added to request. /// @@ -167,10 +141,9 @@ public partial interface ITokensOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetLogSasUrlWithHttpMessagesAsync(string resourceGroupName, string registryName, string runId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates a token for a container registry with the specified - /// parameters. + /// Cancel an existing run. /// /// /// The name of the resource group to which the container registry @@ -179,11 +152,8 @@ public partial interface ITokensOperations /// /// The name of the container registry. /// - /// - /// The name of the token. - /// - /// - /// The parameters for creating a token. + /// + /// The run ID. /// /// /// The headers that will be added to request. @@ -194,15 +164,12 @@ public partial interface ITokensOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string registryName, string tokenName, Token tokenCreateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task CancelWithHttpMessagesAsync(string resourceGroupName, string registryName, string runId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes a token from a container registry. + /// Patch the run properties. /// /// /// The name of the resource group to which the container registry @@ -211,8 +178,11 @@ public partial interface ITokensOperations /// /// The name of the container registry. /// - /// - /// The name of the token. + /// + /// The run ID. + /// + /// + /// The value that indicates whether archiving is enabled or not. /// /// /// The headers that will be added to request. @@ -223,12 +193,15 @@ public partial interface ITokensOperations /// /// 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 BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string tokenName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, string runId, bool? isArchiveEnabled = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Updates a token with the specified parameters. + /// Cancel an existing run. /// /// /// The name of the resource group to which the container registry @@ -237,11 +210,8 @@ public partial interface ITokensOperations /// /// The name of the container registry. /// - /// - /// The name of the token. - /// - /// - /// The parameters for updating a token. + /// + /// The run ID. /// /// /// The headers that will be added to request. @@ -252,15 +222,12 @@ public partial interface ITokensOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, string tokenName, TokenUpdateParameters tokenUpdateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginCancelWithHttpMessagesAsync(string resourceGroupName, string registryName, string runId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists all the tokens for the specified container registry. + /// Gets all the runs for a registry. /// /// /// The NextLink from the previous successful call to List operation. @@ -280,6 +247,6 @@ public partial interface ITokensOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/IScopeMapsOperations.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/ITasksOperations.cs similarity index 66% rename from src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/IScopeMapsOperations.cs rename to src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/ITasksOperations.cs index 582dbe5cba91b..02c631b70494e 100644 --- a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/IScopeMapsOperations.cs +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/ITasksOperations.cs @@ -18,12 +18,12 @@ namespace Microsoft.Azure.Management.ContainerRegistry using System.Threading; /// - /// ScopeMapsOperations operations. + /// TasksOperations operations. /// - public partial interface IScopeMapsOperations + public partial interface ITasksOperations { /// - /// Gets the properties of the specified scope map. + /// Lists all the tasks for a specified container registry. /// /// /// The name of the resource group to which the container registry @@ -32,8 +32,34 @@ public partial interface IScopeMapsOperations /// /// The name of the container registry. /// - /// - /// The name of the scope map. + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task>> 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. @@ -50,9 +76,9 @@ public partial interface IScopeMapsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string registryName, string scopeMapName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string registryName, string taskName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates a scope map for a container registry with the specified + /// Creates a task for a container registry with the specified /// parameters. /// /// @@ -62,16 +88,11 @@ public partial interface IScopeMapsOperations /// /// The name of the container registry. /// - /// - /// The name of the scope map. + /// + /// The name of the container registry task. /// - /// - /// The list of scoped permissions for registry artifacts. - /// E.g. repositories/repository-name/pull, - /// repositories/repository-name/delete - /// - /// - /// The user friendly description of the scope map. + /// + /// The parameters for creating a task. /// /// /// The headers that will be added to request. @@ -88,9 +109,9 @@ public partial interface IScopeMapsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string registryName, string scopeMapName, IList actions, string description = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string registryName, string taskName, Task taskCreateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes a scope map from a container registry. + /// Deletes a specified task. /// /// /// The name of the resource group to which the container registry @@ -99,8 +120,8 @@ public partial interface IScopeMapsOperations /// /// The name of the container registry. /// - /// - /// The name of the scope map. + /// + /// The name of the container registry task. /// /// /// The headers that will be added to request. @@ -114,9 +135,9 @@ public partial interface IScopeMapsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string scopeMapName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string taskName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Updates a scope map with the specified parameters. + /// Updates a task with the specified parameters. /// /// /// The name of the resource group to which the container registry @@ -125,16 +146,11 @@ public partial interface IScopeMapsOperations /// /// The name of the container registry. /// - /// - /// The name of the scope map. - /// - /// - /// The user friendly description of the scope map. + /// + /// The name of the container registry task. /// - /// - /// The list of scope permissions for registry artifacts. - /// E.g. repositories/repository-name/pull, - /// repositories/repository-name/delete + /// + /// The parameters for updating a task. /// /// /// The headers that will be added to request. @@ -151,9 +167,9 @@ public partial interface IScopeMapsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, string scopeMapName, string description = default(string), IList actions = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, string taskName, TaskUpdateParameters taskUpdateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists all the scope maps for the specified container registry. + /// Returns a task with extended information that includes all secrets. /// /// /// The name of the resource group to which the container registry @@ -162,6 +178,9 @@ public partial interface IScopeMapsOperations /// /// The name of the container registry. /// + /// + /// The name of the container registry task. + /// /// /// The headers that will be added to request. /// @@ -177,9 +196,9 @@ public partial interface IScopeMapsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetDetailsWithHttpMessagesAsync(string resourceGroupName, string registryName, string taskName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates a scope map for a container registry with the specified + /// Creates a task for a container registry with the specified /// parameters. /// /// @@ -189,16 +208,11 @@ public partial interface IScopeMapsOperations /// /// The name of the container registry. /// - /// - /// The name of the scope map. - /// - /// - /// The list of scoped permissions for registry artifacts. - /// E.g. repositories/repository-name/pull, - /// repositories/repository-name/delete + /// + /// The name of the container registry task. /// - /// - /// The user friendly description of the scope map. + /// + /// The parameters for creating a task. /// /// /// The headers that will be added to request. @@ -215,9 +229,9 @@ public partial interface IScopeMapsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string registryName, string scopeMapName, IList actions, string description = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string registryName, string taskName, Task taskCreateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes a scope map from a container registry. + /// Deletes a specified task. /// /// /// The name of the resource group to which the container registry @@ -226,8 +240,8 @@ public partial interface IScopeMapsOperations /// /// The name of the container registry. /// - /// - /// The name of the scope map. + /// + /// The name of the container registry task. /// /// /// The headers that will be added to request. @@ -241,9 +255,9 @@ public partial interface IScopeMapsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string scopeMapName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string taskName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Updates a scope map with the specified parameters. + /// Updates a task with the specified parameters. /// /// /// The name of the resource group to which the container registry @@ -252,16 +266,11 @@ public partial interface IScopeMapsOperations /// /// The name of the container registry. /// - /// - /// The name of the scope map. - /// - /// - /// The user friendly description of the scope map. + /// + /// The name of the container registry task. /// - /// - /// The list of scope permissions for registry artifacts. - /// E.g. repositories/repository-name/pull, - /// repositories/repository-name/delete + /// + /// The parameters for updating a task. /// /// /// The headers that will be added to request. @@ -278,9 +287,9 @@ public partial interface IScopeMapsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, string scopeMapName, string description = default(string), IList actions = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, string taskName, TaskUpdateParameters taskUpdateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists all the scope maps for the specified container registry. + /// Lists all the tasks for a specified container registry. /// /// /// The NextLink from the previous successful call to List operation. @@ -300,6 +309,6 @@ public partial interface IScopeMapsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/AgentProperties.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/AgentProperties.cs new file mode 100644 index 0000000000000..bcff3e94e6919 --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/AgentProperties.cs @@ -0,0 +1,53 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TokenCertificateName.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/Architecture.cs similarity index 68% rename from src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TokenCertificateName.cs rename to src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/Architecture.cs index a975121ef70d5..f595764f86d80 100644 --- a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TokenCertificateName.cs +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/Architecture.cs @@ -12,11 +12,12 @@ namespace Microsoft.Azure.Management.ContainerRegistry.Models { /// - /// Defines values for TokenCertificateName. + /// Defines values for Architecture. /// - public static class TokenCertificateName + public static class Architecture { - public const string Certificate1 = "certificate1"; - public const string Certificate2 = "certificate2"; + public const string Amd64 = "amd64"; + public const string X86 = "x86"; + public const string Arm = "arm"; } } diff --git a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/Argument.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/Argument.cs new file mode 100644 index 0000000000000..062e04c316855 --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/Argument.cs @@ -0,0 +1,87 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/AuthInfo.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/AuthInfo.cs new file mode 100644 index 0000000000000..07d63c7ad03f0 --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/AuthInfo.cs @@ -0,0 +1,107 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/AuthInfoUpdateParameters.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/AuthInfoUpdateParameters.cs new file mode 100644 index 0000000000000..06ef9043d09c1 --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/AuthInfoUpdateParameters.cs @@ -0,0 +1,89 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/BaseImageDependency.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/BaseImageDependency.cs new file mode 100644 index 0000000000000..d9ba2aeba66de --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/BaseImageDependency.cs @@ -0,0 +1,86 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/BaseImageDependencyType.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/BaseImageDependencyType.cs new file mode 100644 index 0000000000000..6ed6a272dd3c2 --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/BaseImageDependencyType.cs @@ -0,0 +1,22 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/BaseImageTrigger.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/BaseImageTrigger.cs new file mode 100644 index 0000000000000..eda102f29f6de --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/BaseImageTrigger.cs @@ -0,0 +1,90 @@ +// +// 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 current status of trigger. Possible values + /// include: 'Disabled', 'Enabled' + public BaseImageTrigger(string baseImageTriggerType, string name, string status = default(string)) + { + BaseImageTriggerType = baseImageTriggerType; + 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 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TokenPasswordName.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/BaseImageTriggerType.cs similarity index 70% rename from src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TokenPasswordName.cs rename to src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/BaseImageTriggerType.cs index 78d44e77dc4d2..5acfd504ba390 100644 --- a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TokenPasswordName.cs +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/BaseImageTriggerType.cs @@ -12,11 +12,11 @@ namespace Microsoft.Azure.Management.ContainerRegistry.Models { /// - /// Defines values for TokenPasswordName. + /// Defines values for BaseImageTriggerType. /// - public static class TokenPasswordName + public static class BaseImageTriggerType { - public const string Password1 = "password1"; - public const string Password2 = "password2"; + public const string All = "All"; + public const string Runtime = "Runtime"; } } diff --git a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/BaseImageTriggerUpdateParameters.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/BaseImageTriggerUpdateParameters.cs new file mode 100644 index 0000000000000..8ae0c6948d120 --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/BaseImageTriggerUpdateParameters.cs @@ -0,0 +1,88 @@ +// +// 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 current status of trigger. Possible values + /// include: 'Disabled', 'Enabled' + public BaseImageTriggerUpdateParameters(string name, string baseImageTriggerType = default(string), string status = default(string)) + { + BaseImageTriggerType = baseImageTriggerType; + 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 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/Credentials.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/Credentials.cs new file mode 100644 index 0000000000000..07776d7bc489e --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/Credentials.cs @@ -0,0 +1,74 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/CustomRegistryCredentials.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/CustomRegistryCredentials.cs new file mode 100644 index 0000000000000..d9d86083d41c3 --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/CustomRegistryCredentials.cs @@ -0,0 +1,90 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/DockerBuildRequest.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/DockerBuildRequest.cs new file mode 100644 index 0000000000000..5bc87940653b7 --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/DockerBuildRequest.cs @@ -0,0 +1,199 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/DockerBuildStep.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/DockerBuildStep.cs new file mode 100644 index 0000000000000..988962d16bbef --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/DockerBuildStep.cs @@ -0,0 +1,138 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/DockerBuildStepUpdateParameters.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/DockerBuildStepUpdateParameters.cs new file mode 100644 index 0000000000000..e39facf5dbf05 --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/DockerBuildStepUpdateParameters.cs @@ -0,0 +1,114 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/EncodedTaskRunRequest.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/EncodedTaskRunRequest.cs new file mode 100644 index 0000000000000..c910939bf762b --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/EncodedTaskRunRequest.cs @@ -0,0 +1,169 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/EncodedTaskStep.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/EncodedTaskStep.cs new file mode 100644 index 0000000000000..89e87a36a6185 --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/EncodedTaskStep.cs @@ -0,0 +1,108 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/EncodedTaskStepUpdateParameters.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/EncodedTaskStepUpdateParameters.cs new file mode 100644 index 0000000000000..bbaceea2f41a4 --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/EncodedTaskStepUpdateParameters.cs @@ -0,0 +1,84 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/FileTaskRunRequest.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/FileTaskRunRequest.cs new file mode 100644 index 0000000000000..3ac8c3b7218b2 --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/FileTaskRunRequest.cs @@ -0,0 +1,169 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/FileTaskStep.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/FileTaskStep.cs new file mode 100644 index 0000000000000..bbacfedeaf25a --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/FileTaskStep.cs @@ -0,0 +1,108 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/FileTaskStepUpdateParameters.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/FileTaskStepUpdateParameters.cs new file mode 100644 index 0000000000000..8fcdaeb423aef --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/FileTaskStepUpdateParameters.cs @@ -0,0 +1,84 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/GenerateCredentialsParameters.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/GenerateCredentialsParameters.cs deleted file mode 100644 index 5a9f7fb746f46..0000000000000 --- a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/GenerateCredentialsParameters.cs +++ /dev/null @@ -1,78 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.ContainerRegistry.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// The parameters used to generate credentials for a specified token or - /// user of a container registry. - /// - public partial class GenerateCredentialsParameters - { - /// - /// Initializes a new instance of the GenerateCredentialsParameters - /// class. - /// - public GenerateCredentialsParameters() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the GenerateCredentialsParameters - /// class. - /// - /// The resource ID of the token for which - /// credentials have to be generated. - /// The expiry date of the generated credentials - /// after which the credentials become invalid. - /// Specifies name of the password which should be - /// regenerated if any -- password or password2. Possible values - /// include: 'password1', 'password2' - public GenerateCredentialsParameters(string tokenId = default(string), System.DateTime? expiry = default(System.DateTime?), string name = default(string)) - { - TokenId = tokenId; - Expiry = expiry; - Name = name; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the resource ID of the token for which credentials - /// have to be generated. - /// - [JsonProperty(PropertyName = "tokenId")] - public string TokenId { get; set; } - - /// - /// Gets or sets the expiry date of the generated credentials after - /// which the credentials become invalid. - /// - [JsonProperty(PropertyName = "expiry")] - public System.DateTime? Expiry { get; set; } - - /// - /// Gets or sets specifies name of the password which should be - /// regenerated if any -- password or password2. Possible values - /// include: 'password1', 'password2' - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - } -} diff --git a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/GenerateCredentialsResult.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/GenerateCredentialsResult.cs deleted file mode 100644 index 054a3ea3eabd5..0000000000000 --- a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/GenerateCredentialsResult.cs +++ /dev/null @@ -1,63 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.ContainerRegistry.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The response from the GenerateCredentials operation. - /// - public partial class GenerateCredentialsResult - { - /// - /// Initializes a new instance of the GenerateCredentialsResult class. - /// - public GenerateCredentialsResult() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the GenerateCredentialsResult class. - /// - /// The username for a container - /// registry. - /// The list of passwords for a container - /// registry. - public GenerateCredentialsResult(string username = default(string), IList passwords = default(IList)) - { - Username = username; - Passwords = passwords; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the username for a container registry. - /// - [JsonProperty(PropertyName = "username")] - public string Username { get; set; } - - /// - /// Gets or sets the list of passwords for a container registry. - /// - [JsonProperty(PropertyName = "passwords")] - public IList Passwords { get; set; } - - } -} diff --git a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/IdentityProperties.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/IdentityProperties.cs new file mode 100644 index 0000000000000..b4328a2e79c10 --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/IdentityProperties.cs @@ -0,0 +1,90 @@ +// +// 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; + + /// + /// Managed identity for the resource. + /// + public partial class IdentityProperties + { + /// + /// Initializes a new instance of the IdentityProperties class. + /// + public IdentityProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the IdentityProperties class. + /// + /// The principal ID of resource + /// identity. + /// The tenant ID of resource. + /// The identity type. Possible values include: + /// 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', + /// 'None' + /// The list of user identities + /// associated with the resource. The user identity + /// dictionary key references will be ARM resource ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ + /// providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + public IdentityProperties(string principalId = default(string), string tenantId = default(string), ResourceIdentityType? type = default(ResourceIdentityType?), IDictionary userAssignedIdentities = default(IDictionary)) + { + PrincipalId = principalId; + TenantId = tenantId; + Type = type; + UserAssignedIdentities = userAssignedIdentities; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the principal ID of resource identity. + /// + [JsonProperty(PropertyName = "principalId")] + public string PrincipalId { get; set; } + + /// + /// Gets or sets the tenant ID of resource. + /// + [JsonProperty(PropertyName = "tenantId")] + public string TenantId { get; set; } + + /// + /// Gets or sets the identity type. Possible values include: + /// 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', + /// 'None' + /// + [JsonProperty(PropertyName = "type")] + public ResourceIdentityType? Type { get; set; } + + /// + /// Gets or sets the list of user identities associated with the + /// resource. The user identity + /// dictionary key references will be ARM resource ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ + /// providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// + [JsonProperty(PropertyName = "userAssignedIdentities")] + public IDictionary UserAssignedIdentities { get; set; } + + } +} diff --git a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/ImageDescriptor.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/ImageDescriptor.cs new file mode 100644 index 0000000000000..730bd6ce66d44 --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/ImageDescriptor.cs @@ -0,0 +1,76 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/ImageUpdateTrigger.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/ImageUpdateTrigger.cs new file mode 100644 index 0000000000000..0830e28af8a6f --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/ImageUpdateTrigger.cs @@ -0,0 +1,71 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/OS.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/OS.cs new file mode 100644 index 0000000000000..6c5ae120bb07c --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/OS.cs @@ -0,0 +1,22 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/PlatformProperties.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/PlatformProperties.cs new file mode 100644 index 0000000000000..12f5821ec7f9c --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/PlatformProperties.cs @@ -0,0 +1,87 @@ +// +// 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', 'arm' + /// 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', 'arm' + /// + [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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/PlatformUpdateParameters.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/PlatformUpdateParameters.cs new file mode 100644 index 0000000000000..37ea9e4f338d7 --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/PlatformUpdateParameters.cs @@ -0,0 +1,73 @@ +// +// 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', 'arm' + /// 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', 'arm' + /// + [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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/RegistryPolicies.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/Policies.cs similarity index 51% rename from src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/RegistryPolicies.cs rename to src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/Policies.cs index e8137a3ba03aa..28ea311fd6521 100644 --- a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/RegistryPolicies.cs +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/Policies.cs @@ -14,29 +14,32 @@ namespace Microsoft.Azure.Management.ContainerRegistry.Models using System.Linq; /// - /// An object that represents policies for a container registry. + /// The policies for a container registry. /// - public partial class RegistryPolicies + public partial class Policies { /// - /// Initializes a new instance of the RegistryPolicies class. + /// Initializes a new instance of the Policies class. /// - public RegistryPolicies() + public Policies() { CustomInit(); } /// - /// Initializes a new instance of the RegistryPolicies class. + /// Initializes a new instance of the Policies class. /// - /// An object that represents quarantine - /// policy for a container registry. - /// An object that represents content trust - /// policy for a container registry. - public RegistryPolicies(QuarantinePolicy quarantinePolicy = default(QuarantinePolicy), TrustPolicy trustPolicy = default(TrustPolicy)) + /// The quarantine policy for a + /// container registry. + /// The content trust policy for a container + /// registry. + /// The retention policy for a container + /// registry. + public Policies(QuarantinePolicy quarantinePolicy = default(QuarantinePolicy), TrustPolicy trustPolicy = default(TrustPolicy), RetentionPolicy retentionPolicy = default(RetentionPolicy)) { QuarantinePolicy = quarantinePolicy; TrustPolicy = trustPolicy; + RetentionPolicy = retentionPolicy; CustomInit(); } @@ -46,18 +49,22 @@ public RegistryPolicies() partial void CustomInit(); /// - /// Gets or sets an object that represents quarantine policy for a - /// container registry. + /// Gets or sets the quarantine policy for a container registry. /// [JsonProperty(PropertyName = "quarantinePolicy")] public QuarantinePolicy QuarantinePolicy { get; set; } /// - /// Gets or sets an object that represents content trust policy for a - /// container registry. + /// Gets or sets the content trust policy for a container registry. /// [JsonProperty(PropertyName = "trustPolicy")] public TrustPolicy TrustPolicy { get; set; } + /// + /// Gets or sets the retention policy for a container registry. + /// + [JsonProperty(PropertyName = "retentionPolicy")] + public RetentionPolicy RetentionPolicy { get; set; } + } } diff --git a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/QuarantinePolicy.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/QuarantinePolicy.cs index 662265cd0d82f..83ee840da10a4 100644 --- a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/QuarantinePolicy.cs +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/QuarantinePolicy.cs @@ -14,7 +14,7 @@ namespace Microsoft.Azure.Management.ContainerRegistry.Models using System.Linq; /// - /// An object that represents quarantine policy for a container registry. + /// The quarantine policy for a container registry. /// public partial class QuarantinePolicy { diff --git a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/Registry.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/Registry.cs index e05e2da5fdae5..49d723eea4d70 100644 --- a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/Registry.cs +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/Registry.cs @@ -57,7 +57,9 @@ public Registry() /// for the container registry. Only applicable to Classic SKU. /// The network rule set 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), Status1 status = default(Status1), bool? adminUserEnabled = default(bool?), StorageAccountProperties storageAccount = default(StorageAccountProperties), NetworkRuleSet networkRuleSet = default(NetworkRuleSet)) + /// 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)) : base(location, id, name, type, tags) { Sku = sku; @@ -68,6 +70,7 @@ public Registry() AdminUserEnabled = adminUserEnabled; StorageAccount = storageAccount; NetworkRuleSet = networkRuleSet; + Policies = policies; CustomInit(); } @@ -107,7 +110,7 @@ public Registry() /// was called. /// [JsonProperty(PropertyName = "properties.status")] - public Status1 Status { get; private set; } + public Status Status { get; private set; } /// /// Gets or sets the value that indicates whether the admin user is @@ -129,6 +132,12 @@ public Registry() [JsonProperty(PropertyName = "properties.networkRuleSet")] public NetworkRuleSet NetworkRuleSet { get; set; } + /// + /// Gets or sets the policies for a container registry. + /// + [JsonProperty(PropertyName = "properties.policies")] + public Policies Policies { get; set; } + /// /// Validate the object. /// diff --git a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/RegistryUpdateParameters.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/RegistryUpdateParameters.cs index 0162faa13108f..e638598a2ef1c 100644 --- a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/RegistryUpdateParameters.cs +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/RegistryUpdateParameters.cs @@ -38,19 +38,17 @@ public RegistryUpdateParameters() /// The SKU of the container registry. /// The value that indicates whether the /// admin user is enabled. - /// The parameters of a storage account - /// for the container registry. Only applicable to Classic SKU. If - /// specified, the storage account must be in the same physical - /// location as the container registry. /// The network rule set for a container /// registry. - public RegistryUpdateParameters(IDictionary tags = default(IDictionary), Sku sku = default(Sku), bool? adminUserEnabled = default(bool?), StorageAccountProperties storageAccount = default(StorageAccountProperties), NetworkRuleSet networkRuleSet = default(NetworkRuleSet)) + /// 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)) { Tags = tags; Sku = sku; AdminUserEnabled = adminUserEnabled; - StorageAccount = storageAccount; NetworkRuleSet = networkRuleSet; + Policies = policies; CustomInit(); } @@ -78,21 +76,18 @@ public RegistryUpdateParameters() [JsonProperty(PropertyName = "properties.adminUserEnabled")] public bool? AdminUserEnabled { get; set; } - /// - /// Gets or sets the parameters of a storage account for the container - /// registry. Only applicable to Classic SKU. If specified, the storage - /// account must be in the same physical location as the container - /// registry. - /// - [JsonProperty(PropertyName = "properties.storageAccount")] - public StorageAccountProperties StorageAccount { get; set; } - /// /// Gets or sets the network rule set for a container registry. /// [JsonProperty(PropertyName = "properties.networkRuleSet")] public NetworkRuleSet NetworkRuleSet { get; set; } + /// + /// Gets or sets the policies for a container registry. + /// + [JsonProperty(PropertyName = "properties.policies")] + public Policies Policies { get; set; } + /// /// Validate the object. /// @@ -105,10 +100,6 @@ public virtual void Validate() { Sku.Validate(); } - if (StorageAccount != null) - { - StorageAccount.Validate(); - } if (NetworkRuleSet != null) { NetworkRuleSet.Validate(); diff --git a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/Replication.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/Replication.cs index 974768be0afd1..09cca0fdaf990 100644 --- a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/Replication.cs +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/Replication.cs @@ -46,7 +46,7 @@ public Replication() /// 'Canceled' /// The status of the replication at the time the /// operation was called. - public Replication(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string provisioningState = default(string), Status1 status = default(Status1)) + public Replication(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string provisioningState = default(string), Status status = default(Status)) : base(location, id, name, type, tags) { ProvisioningState = provisioningState; @@ -72,7 +72,7 @@ public Replication() /// called. /// [JsonProperty(PropertyName = "properties.status")] - public Status1 Status { get; private set; } + public Status Status { get; private set; } /// /// Validate the object. diff --git a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/ResourceIdentityType.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/ResourceIdentityType.cs new file mode 100644 index 0000000000000..3aab5aa7140bb --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/ResourceIdentityType.cs @@ -0,0 +1,72 @@ +// +// 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 Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for ResourceIdentityType. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum ResourceIdentityType + { + [EnumMember(Value = "SystemAssigned")] + SystemAssigned, + [EnumMember(Value = "UserAssigned")] + UserAssigned, + [EnumMember(Value = "SystemAssigned, UserAssigned")] + SystemAssignedUserAssigned, + [EnumMember(Value = "None")] + None + } + internal static class ResourceIdentityTypeEnumExtension + { + internal static string ToSerializedValue(this ResourceIdentityType? value) + { + return value == null ? null : ((ResourceIdentityType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this ResourceIdentityType value) + { + switch( value ) + { + case ResourceIdentityType.SystemAssigned: + return "SystemAssigned"; + case ResourceIdentityType.UserAssigned: + return "UserAssigned"; + case ResourceIdentityType.SystemAssignedUserAssigned: + return "SystemAssigned, UserAssigned"; + case ResourceIdentityType.None: + return "None"; + } + return null; + } + + internal static ResourceIdentityType? ParseResourceIdentityType(this string value) + { + switch( value ) + { + case "SystemAssigned": + return ResourceIdentityType.SystemAssigned; + case "UserAssigned": + return ResourceIdentityType.UserAssigned; + case "SystemAssigned, UserAssigned": + return ResourceIdentityType.SystemAssignedUserAssigned; + case "None": + return ResourceIdentityType.None; + } + return null; + } + } +} diff --git a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/RetentionPolicy.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/RetentionPolicy.cs new file mode 100644 index 0000000000000..c758137bfda08 --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/RetentionPolicy.cs @@ -0,0 +1,73 @@ +// +// 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 retention policy for a container registry. + /// + public partial class RetentionPolicy + { + /// + /// Initializes a new instance of the RetentionPolicy class. + /// + public RetentionPolicy() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RetentionPolicy class. + /// + /// The number of days to retain manifest before it + /// expires. + /// The timestamp when the the policy was + /// last updated. + /// The value that indicates whether the policy is + /// enabled or not. Possible values include: 'enabled', + /// 'disabled' + public RetentionPolicy(int? days = default(int?), System.DateTime? lastUpdatedTime = default(System.DateTime?), string status = default(string)) + { + Days = days; + LastUpdatedTime = lastUpdatedTime; + Status = status; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the number of days to retain manifest before it + /// expires. + /// + [JsonProperty(PropertyName = "days")] + public int? Days { get; set; } + + /// + /// Gets the timestamp when the the policy was last updated. + /// + [JsonProperty(PropertyName = "lastUpdatedTime")] + public System.DateTime? LastUpdatedTime { get; private set; } + + /// + /// Gets or sets the value that indicates whether the policy is enabled + /// or not. Possible values include: 'enabled', 'disabled' + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + } +} diff --git a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/Run.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/Run.cs new file mode 100644 index 0000000000000..122eb6150c8ad --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/Run.cs @@ -0,0 +1,240 @@ +// +// 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 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 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), PlatformProperties platform = default(PlatformProperties), AgentProperties agentConfiguration = default(AgentProperties), string sourceRegistryAuth = default(string), IList customRegistries = default(IList), string runErrorMessage = 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; + Platform = platform; + AgentConfiguration = agentConfiguration; + SourceRegistryAuth = sourceRegistryAuth; + CustomRegistries = customRegistries; + RunErrorMessage = runErrorMessage; + 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 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 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/RunFilter.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/RunFilter.cs new file mode 100644 index 0000000000000..19d86ef940a97 --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/RunFilter.cs @@ -0,0 +1,121 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/RunGetLogResult.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/RunGetLogResult.cs new file mode 100644 index 0000000000000..718af610a69f9 --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/RunGetLogResult.cs @@ -0,0 +1,53 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/RunRequest.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/RunRequest.cs new file mode 100644 index 0000000000000..a04a91b58c0bc --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/RunRequest.cs @@ -0,0 +1,53 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/RunStatus.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/RunStatus.cs new file mode 100644 index 0000000000000..fb785a55f3920 --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/RunStatus.cs @@ -0,0 +1,28 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/RunType.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/RunType.cs new file mode 100644 index 0000000000000..119c45c17dde7 --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/RunType.cs @@ -0,0 +1,24 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/RunUpdateParameters.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/RunUpdateParameters.cs new file mode 100644 index 0000000000000..5a3e461c4d7e7 --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/RunUpdateParameters.cs @@ -0,0 +1,53 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/ScopeMap.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/ScopeMap.cs deleted file mode 100644 index 9e642969f3b01..0000000000000 --- a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/ScopeMap.cs +++ /dev/null @@ -1,116 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.ContainerRegistry.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// An object that represents a scope map for a container registry. - /// - [Rest.Serialization.JsonTransformation] - public partial class ScopeMap : ProxyResource - { - /// - /// Initializes a new instance of the ScopeMap class. - /// - public ScopeMap() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ScopeMap class. - /// - /// The list of scoped permissions for registry - /// artifacts. - /// E.g. repositories/repository-name/pull, - /// repositories/repository-name/delete - /// The resource ID. - /// The name of the resource. - /// The type of the resource. - /// The user friendly description of the - /// scope map. - /// The type of the scope map. E.g. BuildIn - /// scope map. - /// The creation date of scope map. - /// Provisioning state of the resource. - /// Possible values include: 'Creating', 'Updating', 'Deleting', - /// 'Succeeded', 'Failed', 'Canceled' - public ScopeMap(IList actions, string id = default(string), string name = default(string), string type = default(string), string description = default(string), string scopeMapType = default(string), System.DateTime? creationDate = default(System.DateTime?), string provisioningState = default(string)) - : base(id, name, type) - { - Description = description; - ScopeMapType = scopeMapType; - CreationDate = creationDate; - ProvisioningState = provisioningState; - Actions = actions; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the user friendly description of the scope map. - /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } - - /// - /// Gets the type of the scope map. E.g. BuildIn scope map. - /// - [JsonProperty(PropertyName = "properties.type")] - public string ScopeMapType { get; private set; } - - /// - /// Gets the creation date of scope map. - /// - [JsonProperty(PropertyName = "properties.creationDate")] - public System.DateTime? CreationDate { get; private set; } - - /// - /// Gets provisioning state of the resource. Possible values include: - /// 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', - /// 'Canceled' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } - - /// - /// Gets or sets the list of scoped permissions for registry artifacts. - /// E.g. repositories/repository-name/pull, - /// repositories/repository-name/delete - /// - [JsonProperty(PropertyName = "properties.actions")] - public IList Actions { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Actions == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Actions"); - } - } - } -} diff --git a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/ScopeMapUpdateParameters.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/ScopeMapUpdateParameters.cs deleted file mode 100644 index da1b18ca66b1c..0000000000000 --- a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/ScopeMapUpdateParameters.cs +++ /dev/null @@ -1,70 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.ContainerRegistry.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The properties for updating the scope map. - /// - [Rest.Serialization.JsonTransformation] - public partial class ScopeMapUpdateParameters - { - /// - /// Initializes a new instance of the ScopeMapUpdateParameters class. - /// - public ScopeMapUpdateParameters() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ScopeMapUpdateParameters class. - /// - /// The user friendly description of the - /// scope map. - /// The list of scope permissions for registry - /// artifacts. - /// E.g. repositories/repository-name/pull, - /// repositories/repository-name/delete - public ScopeMapUpdateParameters(string description = default(string), IList actions = default(IList)) - { - Description = description; - Actions = actions; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the user friendly description of the scope map. - /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } - - /// - /// Gets or sets the list of scope permissions for registry artifacts. - /// E.g. repositories/repository-name/pull, - /// repositories/repository-name/delete - /// - [JsonProperty(PropertyName = "properties.actions")] - public IList Actions { get; set; } - - } -} diff --git a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SecretObject.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SecretObject.cs new file mode 100644 index 0000000000000..6479ac4fed925 --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SecretObject.cs @@ -0,0 +1,72 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SecretObjectType.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SecretObjectType.cs new file mode 100644 index 0000000000000..eb65d8737e164 --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SecretObjectType.cs @@ -0,0 +1,22 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SetValue.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SetValue.cs new file mode 100644 index 0000000000000..f289d64c84dcb --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SetValue.cs @@ -0,0 +1,88 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SourceControlType.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SourceControlType.cs new file mode 100644 index 0000000000000..9d3f76fc5d064 --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SourceControlType.cs @@ -0,0 +1,22 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SourceProperties.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SourceProperties.cs new file mode 100644 index 0000000000000..4c514b6b0e270 --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SourceProperties.cs @@ -0,0 +1,105 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SourceRegistryCredentials.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SourceRegistryCredentials.cs new file mode 100644 index 0000000000000..525444084ea7a --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SourceRegistryCredentials.cs @@ -0,0 +1,62 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SourceRegistryLoginMode.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SourceRegistryLoginMode.cs new file mode 100644 index 0000000000000..61e0d3ae8d671 --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SourceRegistryLoginMode.cs @@ -0,0 +1,22 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SourceTrigger.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SourceTrigger.cs new file mode 100644 index 0000000000000..f484086dd36e9 --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SourceTrigger.cs @@ -0,0 +1,108 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SourceTriggerDescriptor.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SourceTriggerDescriptor.cs new file mode 100644 index 0000000000000..46f74e57bbf4a --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SourceTriggerDescriptor.cs @@ -0,0 +1,102 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SourceTriggerEvent.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SourceTriggerEvent.cs new file mode 100644 index 0000000000000..6aa6c680930cc --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SourceTriggerEvent.cs @@ -0,0 +1,22 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SourceTriggerUpdateParameters.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SourceTriggerUpdateParameters.cs new file mode 100644 index 0000000000000..a393cb88ff6f0 --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SourceTriggerUpdateParameters.cs @@ -0,0 +1,98 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SourceUpdateParameters.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SourceUpdateParameters.cs new file mode 100644 index 0000000000000..67fea46e67220 --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SourceUpdateParameters.cs @@ -0,0 +1,83 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SourceUploadDefinition.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SourceUploadDefinition.cs new file mode 100644 index 0000000000000..c6530415aa2fa --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/SourceUploadDefinition.cs @@ -0,0 +1,62 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/Status.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/Status.cs index 895cf1073cf24..41032fd63519a 100644 --- a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/Status.cs +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/Status.cs @@ -10,13 +10,62 @@ namespace Microsoft.Azure.Management.ContainerRegistry.Models { + using Newtonsoft.Json; + using System.Linq; /// - /// Defines values for Status. + /// The status of an Azure resource at the time the operation was called. /// - public static class Status + public partial class Status { - public const string Enabled = "enabled"; - public const string Disabled = "disabled"; + /// + /// Initializes a new instance of the Status class. + /// + public Status() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Status class. + /// + /// The short label for the status. + /// The detailed message for the status, + /// including alerts and error messages. + /// The timestamp when the status was changed + /// to the current value. + public Status(string displayStatus = default(string), string message = default(string), System.DateTime? timestamp = default(System.DateTime?)) + { + DisplayStatus = displayStatus; + Message = message; + Timestamp = timestamp; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the short label for the status. + /// + [JsonProperty(PropertyName = "displayStatus")] + public string DisplayStatus { get; private set; } + + /// + /// Gets the detailed message for the status, including alerts and + /// error messages. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; private set; } + + /// + /// Gets the timestamp when the status was changed to the current + /// value. + /// + [JsonProperty(PropertyName = "timestamp")] + public System.DateTime? Timestamp { get; private set; } + } } diff --git a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/Status1.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/Status1.cs deleted file mode 100644 index 3035c46f3cc60..0000000000000 --- a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/Status1.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.Linq; - - /// - /// The status of an Azure resource at the time the operation was called. - /// - public partial class Status1 - { - /// - /// Initializes a new instance of the Status1 class. - /// - public Status1() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Status1 class. - /// - /// The short label for the status. - /// The detailed message for the status, - /// including alerts and error messages. - /// The timestamp when the status was changed - /// to the current value. - public Status1(string displayStatus = default(string), string message = default(string), System.DateTime? timestamp = default(System.DateTime?)) - { - DisplayStatus = displayStatus; - Message = message; - Timestamp = timestamp; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the short label for the status. - /// - [JsonProperty(PropertyName = "displayStatus")] - public string DisplayStatus { get; private set; } - - /// - /// Gets the detailed message for the status, including alerts and - /// error messages. - /// - [JsonProperty(PropertyName = "message")] - public string Message { get; private set; } - - /// - /// Gets the timestamp when the status was changed to the current - /// value. - /// - [JsonProperty(PropertyName = "timestamp")] - public System.DateTime? Timestamp { get; private set; } - - } -} diff --git a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/Task.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/Task.cs new file mode 100644 index 0000000000000..ac5f23bb44a78 --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/Task.cs @@ -0,0 +1,183 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TaskRunRequest.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TaskRunRequest.cs new file mode 100644 index 0000000000000..fde6bcb2d6d5a --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TaskRunRequest.cs @@ -0,0 +1,91 @@ +// +// 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 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 name of task against which run has to be + /// queued. + /// The value that indicates whether + /// archiving is enabled for the run or not. + /// The collection of overridable values that can + /// be passed when running a task. + public TaskRunRequest(string taskName, bool? isArchiveEnabled = default(bool?), IList values = default(IList)) + : base(isArchiveEnabled) + { + TaskName = taskName; + Values = values; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the name of task against which run has to be queued. + /// + [JsonProperty(PropertyName = "taskName")] + public string TaskName { 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 (TaskName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "TaskName"); + } + if (Values != null) + { + foreach (var element in Values) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} diff --git a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TaskStatus.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TaskStatus.cs new file mode 100644 index 0000000000000..23910be329ed1 --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TaskStatus.cs @@ -0,0 +1,22 @@ +// +// 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 TaskStatus. + /// + public static class TaskStatus + { + public const string Disabled = "Disabled"; + public const string Enabled = "Enabled"; + } +} diff --git a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TaskStepProperties.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TaskStepProperties.cs new file mode 100644 index 0000000000000..d8d9d9cdda4f0 --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TaskStepProperties.cs @@ -0,0 +1,75 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TaskStepUpdateParameters.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TaskStepUpdateParameters.cs new file mode 100644 index 0000000000000..ef33025f10556 --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TaskStepUpdateParameters.cs @@ -0,0 +1,64 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TaskUpdateParameters.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TaskUpdateParameters.cs new file mode 100644 index 0000000000000..16b784c190d6f --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TaskUpdateParameters.cs @@ -0,0 +1,141 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TimerTrigger.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TimerTrigger.cs new file mode 100644 index 0000000000000..5eccfcf912e44 --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TimerTrigger.cs @@ -0,0 +1,88 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TimerTriggerUpdateParameters.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TimerTriggerUpdateParameters.cs new file mode 100644 index 0000000000000..9cbef21bd7b62 --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TimerTriggerUpdateParameters.cs @@ -0,0 +1,86 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/Token.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/Token.cs deleted file mode 100644 index 941327d5cc1ea..0000000000000 --- a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/Token.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 Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// An object that represents a token for a container registry. - /// - [Rest.Serialization.JsonTransformation] - public partial class Token : ProxyResource - { - /// - /// Initializes a new instance of the Token class. - /// - public Token() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Token class. - /// - /// The resource ID. - /// The name of the resource. - /// The type of the resource. - /// The creation date of scope map. - /// Provisioning state of the resource. - /// Possible values include: 'Creating', 'Updating', 'Deleting', - /// 'Succeeded', 'Failed', 'Canceled' - /// The resource ID of the scope map to which - /// the token will be associated with. - /// The user/group/application object ID for - /// which the token has to be created. - /// The credentials that can be used for - /// authenticating the token. - /// The status of the token example enabled or - /// disabled. Possible values include: 'enabled', 'disabled' - public Token(string id = default(string), string name = default(string), string type = default(string), System.DateTime? creationDate = default(System.DateTime?), string provisioningState = default(string), string scopeMapId = default(string), string objectId = default(string), TokenCredentialsProperties credentials = default(TokenCredentialsProperties), string status = default(string)) - : base(id, name, type) - { - CreationDate = creationDate; - ProvisioningState = provisioningState; - ScopeMapId = scopeMapId; - ObjectId = objectId; - Credentials = credentials; - Status = status; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the creation date of scope map. - /// - [JsonProperty(PropertyName = "properties.creationDate")] - public System.DateTime? CreationDate { get; private set; } - - /// - /// Gets provisioning state of the resource. Possible values include: - /// 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', - /// 'Canceled' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } - - /// - /// Gets or sets the resource ID of the scope map to which the token - /// will be associated with. - /// - [JsonProperty(PropertyName = "properties.scopeMapId")] - public string ScopeMapId { get; set; } - - /// - /// Gets or sets the user/group/application object ID for which the - /// token has to be created. - /// - [JsonProperty(PropertyName = "properties.objectId")] - public string ObjectId { get; set; } - - /// - /// Gets or sets the credentials that can be used for authenticating - /// the token. - /// - [JsonProperty(PropertyName = "properties.credentials")] - public TokenCredentialsProperties Credentials { get; set; } - - /// - /// Gets or sets the status of the token example enabled or disabled. - /// Possible values include: 'enabled', 'disabled' - /// - [JsonProperty(PropertyName = "properties.status")] - public string Status { get; set; } - - } -} diff --git a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TokenCertificate.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TokenCertificate.cs deleted file mode 100644 index 58d68a3973237..0000000000000 --- a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TokenCertificate.cs +++ /dev/null @@ -1,81 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.ContainerRegistry.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// The properties of a certificate used for authenticating a token. - /// - public partial class TokenCertificate - { - /// - /// Initializes a new instance of the TokenCertificate class. - /// - public TokenCertificate() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the TokenCertificate class. - /// - /// Possible values include: 'certificate1', - /// 'certificate2' - /// The expiry datetime of the - /// certificate. - /// The thumbprint of the certificate. - /// Base 64 encoded string of the - /// public certificate1 in PEM format that will be used for - /// authenticating the token. - public TokenCertificate(string name = default(string), System.DateTime? expiry = default(System.DateTime?), string thumbprint = default(string), string encodedPemCertificate = default(string)) - { - Name = name; - Expiry = expiry; - Thumbprint = thumbprint; - EncodedPemCertificate = encodedPemCertificate; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets possible values include: 'certificate1', - /// 'certificate2' - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets the expiry datetime of the certificate. - /// - [JsonProperty(PropertyName = "expiry")] - public System.DateTime? Expiry { get; set; } - - /// - /// Gets or sets the thumbprint of the certificate. - /// - [JsonProperty(PropertyName = "thumbprint")] - public string Thumbprint { get; set; } - - /// - /// Gets or sets base 64 encoded string of the public certificate1 in - /// PEM format that will be used for authenticating the token. - /// - [JsonProperty(PropertyName = "encodedPemCertificate")] - public string EncodedPemCertificate { get; set; } - - } -} diff --git a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TokenCredentialsProperties.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TokenCredentialsProperties.cs deleted file mode 100644 index c87fbb8cb1e8f..0000000000000 --- a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TokenCredentialsProperties.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.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The properties of the credentials that can be used for authenticating - /// the token. - /// - public partial class TokenCredentialsProperties - { - /// - /// Initializes a new instance of the TokenCredentialsProperties class. - /// - public TokenCredentialsProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the TokenCredentialsProperties class. - /// - public TokenCredentialsProperties(IList certificates = default(IList), IList passwords = default(IList)) - { - Certificates = certificates; - Passwords = passwords; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "certificates")] - public IList Certificates { get; set; } - - /// - /// - [JsonProperty(PropertyName = "passwords")] - public IList Passwords { get; set; } - - } -} diff --git a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TokenPassword.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TokenPassword.cs deleted file mode 100644 index 172f1b05324e8..0000000000000 --- a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TokenPassword.cs +++ /dev/null @@ -1,79 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.ContainerRegistry.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// The password that will be used for authenticating the token of a - /// container registry. - /// - public partial class TokenPassword - { - /// - /// Initializes a new instance of the TokenPassword class. - /// - public TokenPassword() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the TokenPassword class. - /// - /// The password created datetime of the - /// password. - /// The expiry datetime of the password. - /// The password name "password" or "password2". - /// Possible values include: 'password1', 'password2' - /// The password value. - public TokenPassword(System.DateTime? creationTime = default(System.DateTime?), System.DateTime? expiry = default(System.DateTime?), string name = default(string), string value = default(string)) - { - CreationTime = creationTime; - Expiry = expiry; - Name = name; - Value = value; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the password created datetime of the password. - /// - [JsonProperty(PropertyName = "creationTime")] - public System.DateTime? CreationTime { get; set; } - - /// - /// Gets or sets the expiry datetime of the password. - /// - [JsonProperty(PropertyName = "expiry")] - public System.DateTime? Expiry { get; set; } - - /// - /// Gets or sets the password name "password" or "password2". Possible - /// values include: 'password1', 'password2' - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets the password value. - /// - [JsonProperty(PropertyName = "value")] - public string Value { get; private set; } - - } -} diff --git a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TokenType.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TokenType.cs new file mode 100644 index 0000000000000..263e5897669e1 --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TokenType.cs @@ -0,0 +1,22 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TokenUpdateParameters.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TokenUpdateParameters.cs deleted file mode 100644 index d79f504453969..0000000000000 --- a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TokenUpdateParameters.cs +++ /dev/null @@ -1,76 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.ContainerRegistry.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// The parameters for updating a token. - /// - [Rest.Serialization.JsonTransformation] - public partial class TokenUpdateParameters - { - /// - /// Initializes a new instance of the TokenUpdateParameters class. - /// - public TokenUpdateParameters() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the TokenUpdateParameters class. - /// - /// The resource ID of the scope map to which - /// the token will be associated with. - /// The status of the token example enabled or - /// disabled. Possible values include: 'enabled', 'disabled' - /// The credentials that can be used for - /// authenticating the token. - public TokenUpdateParameters(string scopeMapId = default(string), string status = default(string), TokenCredentialsProperties credentials = default(TokenCredentialsProperties)) - { - ScopeMapId = scopeMapId; - Status = status; - Credentials = credentials; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the resource ID of the scope map to which the token - /// will be associated with. - /// - [JsonProperty(PropertyName = "properties.scopeMapId")] - public string ScopeMapId { get; set; } - - /// - /// Gets or sets the status of the token example enabled or disabled. - /// Possible values include: 'enabled', 'disabled' - /// - [JsonProperty(PropertyName = "properties.status")] - public string Status { get; set; } - - /// - /// Gets or sets the credentials that can be used for authenticating - /// the token. - /// - [JsonProperty(PropertyName = "properties.credentials")] - public TokenCredentialsProperties Credentials { get; set; } - - } -} diff --git a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TriggerProperties.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TriggerProperties.cs new file mode 100644 index 0000000000000..7e9287922ff68 --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TriggerProperties.cs @@ -0,0 +1,106 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TriggerStatus.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TriggerStatus.cs new file mode 100644 index 0000000000000..067d64b490055 --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TriggerStatus.cs @@ -0,0 +1,22 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TriggerUpdateParameters.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TriggerUpdateParameters.cs new file mode 100644 index 0000000000000..0dc2d066cc862 --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TriggerUpdateParameters.cs @@ -0,0 +1,106 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TrustPolicy.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TrustPolicy.cs index 45adc9a9a67a1..248d8fc179e6a 100644 --- a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TrustPolicy.cs +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/TrustPolicy.cs @@ -14,8 +14,7 @@ namespace Microsoft.Azure.Management.ContainerRegistry.Models using System.Linq; /// - /// An object that represents content trust policy for a container - /// registry. + /// The content trust policy for a container registry. /// public partial class TrustPolicy { diff --git a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/UserIdentityProperties.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/UserIdentityProperties.cs new file mode 100644 index 0000000000000..4bfc202034301 --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/UserIdentityProperties.cs @@ -0,0 +1,58 @@ +// +// 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 UserIdentityProperties + { + /// + /// Initializes a new instance of the UserIdentityProperties class. + /// + public UserIdentityProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the UserIdentityProperties class. + /// + /// The principal id of user assigned + /// identity. + /// The client id of user assigned + /// identity. + public UserIdentityProperties(string principalId = default(string), string clientId = default(string)) + { + PrincipalId = principalId; + ClientId = clientId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the principal id of user assigned identity. + /// + [JsonProperty(PropertyName = "principalId")] + public string PrincipalId { get; set; } + + /// + /// Gets or sets the client id of user assigned identity. + /// + [JsonProperty(PropertyName = "clientId")] + public string ClientId { get; set; } + + } +} diff --git a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/Variant.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/Variant.cs new file mode 100644 index 0000000000000..6adb3bba7e520 --- /dev/null +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Models/Variant.cs @@ -0,0 +1,23 @@ +// +// 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/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Operations.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Operations.cs index 5b2adff0376db..343bb80e5037d 100644 --- a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Operations.cs +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/Operations.cs @@ -69,7 +69,7 @@ internal Operations(ContainerRegistryManagementClient client) /// public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - string apiVersion = "2017-10-01"; + string apiVersion = "2019-05-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/RegistriesOperations.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/RegistriesOperations.cs index df24db14acda9..91e9df9776914 100644 --- a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/RegistriesOperations.cs +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/RegistriesOperations.cs @@ -130,7 +130,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "name", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2017-10-01"; + string apiVersion = "2019-05-01"; RegistryNameCheckRequest registryNameCheckRequest = new RegistryNameCheckRequest(); if (name != null) { @@ -354,7 +354,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2017-10-01"; + string apiVersion = "2019-05-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -620,7 +620,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } - string apiVersion = "2017-10-01"; + string apiVersion = "2019-05-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -798,7 +798,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2017-10-01"; + string apiVersion = "2019-05-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1010,7 +1010,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2017-10-01"; + string apiVersion = "2019-05-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1231,7 +1231,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2017-10-01"; + string apiVersion = "2019-05-01"; RegenerateCredentialParameters regenerateCredentialParameters = new RegenerateCredentialParameters(); regenerateCredentialParameters.Name = name; // Tracing @@ -1456,7 +1456,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2017-10-01"; + string apiVersion = "2019-05-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1607,7 +1607,33 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) } /// - /// Lists the policies for the specified container registry. + /// 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. @@ -1636,7 +1662,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> ListPoliciesWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetBuildSourceUploadUrlWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -1672,7 +1698,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2017-10-01"; + string apiVersion = "2019-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1680,15 +1706,15 @@ 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("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListPolicies", tracingParameters); + 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}/listPolicies").ToString(); + 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)); @@ -1704,7 +1730,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1790,7 +1816,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1803,7 +1829,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1822,59 +1848,6 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) return _result; } - /// - /// Updates the policies for the specified container registry. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// An object that represents quarantine policy for a container registry. - /// - /// - /// An object that represents content trust policy for a container registry. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> UpdatePoliciesWithHttpMessagesAsync(string resourceGroupName, string registryName, QuarantinePolicy quarantinePolicy = default(QuarantinePolicy), TrustPolicy trustPolicy = default(TrustPolicy), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginUpdatePoliciesWithHttpMessagesAsync(resourceGroupName, registryName, quarantinePolicy, trustPolicy, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Generate keys for a token of a specified container registry. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The parameters for generating credentials. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> GenerateCredentialsWithHttpMessagesAsync(string resourceGroupName, string registryName, GenerateCredentialsParameters generateCredentialsParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginGenerateCredentialsWithHttpMessagesAsync(resourceGroupName, registryName, generateCredentialsParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - /// /// Copies an image to this container registry from the specified container /// registry. @@ -1951,7 +1924,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) { parameters.Validate(); } - string apiVersion = "2017-10-01"; + string apiVersion = "2019-05-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2167,7 +2140,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) { registry.Validate(); } - string apiVersion = "2017-10-01"; + string apiVersion = "2019-05-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2405,7 +2378,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2017-10-01"; + string apiVersion = "2019-05-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2610,7 +2583,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "registryUpdateParameters"); } - string apiVersion = "2017-10-01"; + string apiVersion = "2019-05-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2786,7 +2759,8 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) } /// - /// Updates the policies for the specified container registry. + /// 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. @@ -2794,11 +2768,8 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) /// /// The name of the container registry. /// - /// - /// An object that represents quarantine policy for a container registry. - /// - /// - /// An object that represents content trust policy for a container registry. + /// + /// The parameters of a run that needs to scheduled. /// /// /// Headers that will be added to request. @@ -2821,7 +2792,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginUpdatePoliciesWithHttpMessagesAsync(string resourceGroupName, string registryName, QuarantinePolicy quarantinePolicy = default(QuarantinePolicy), TrustPolicy trustPolicy = default(TrustPolicy), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> BeginScheduleRunWithHttpMessagesAsync(string resourceGroupName, string registryName, RunRequest runRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -2857,13 +2828,11 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2017-10-01"; - RegistryPolicies registryPoliciesUpdateParameters = new RegistryPolicies(); - if (quarantinePolicy != null || trustPolicy != null) + if (runRequest == null) { - registryPoliciesUpdateParameters.QuarantinePolicy = quarantinePolicy; - registryPoliciesUpdateParameters.TrustPolicy = trustPolicy; + throw new ValidationException(ValidationRules.CannotBeNull, "runRequest"); } + string apiVersion = "2019-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2871,246 +2840,16 @@ 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("registryPoliciesUpdateParameters", registryPoliciesUpdateParameters); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdatePolicies", 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}/updatePolicies").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(registryPoliciesUpdateParameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(registryPoliciesUpdateParameters, 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; - } - - /// - /// Generate keys for a token of a specified container registry. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The parameters for generating credentials. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async System.Threading.Tasks.Task> BeginGenerateCredentialsWithHttpMessagesAsync(string resourceGroupName, string registryName, GenerateCredentialsParameters generateCredentialsParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - } - if (registryName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "registryName"); - } - if (registryName != null) - { - if (registryName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "registryName", 50); - } - if (registryName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "registryName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(registryName, "^[a-zA-Z0-9]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); - } - } - if (generateCredentialsParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "generateCredentialsParameters"); - } - string apiVersion = "2019-05-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("registryName", registryName); - tracingParameters.Add("generateCredentialsParameters", generateCredentialsParameters); + tracingParameters.Add("runRequest", runRequest); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginGenerateCredentials", tracingParameters); + 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}/generateCredentials").ToString(); + 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)); @@ -3157,9 +2896,9 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) // Serialize Request string _requestContent = null; - if(generateCredentialsParameters != null) + if(runRequest != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(generateCredentialsParameters, Client.SerializationSettings); + _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"); } @@ -3218,7 +2957,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -3231,7 +2970,7 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/RegistriesOperationsExtensions.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/RegistriesOperationsExtensions.cs index 88672615d09be..f9e010d7e7fe8 100644 --- a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/RegistriesOperationsExtensions.cs +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/RegistriesOperationsExtensions.cs @@ -467,7 +467,8 @@ public static RegistryUsageListResult ListUsages(this IRegistriesOperations oper } /// - /// Lists the policies for the specified container registry. + /// Schedules a new run based on the request parameters and add it to the run + /// queue. /// /// /// The operations group for this extension method. @@ -478,59 +479,17 @@ public static RegistryUsageListResult ListUsages(this IRegistriesOperations oper /// /// The name of the container registry. /// - public static RegistryPolicies ListPolicies(this IRegistriesOperations operations, string resourceGroupName, string registryName) - { - return operations.ListPoliciesAsync(resourceGroupName, registryName).GetAwaiter().GetResult(); - } - - /// - /// Lists the policies for the specified container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task ListPoliciesAsync(this IRegistriesOperations operations, string resourceGroupName, string registryName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListPoliciesWithHttpMessagesAsync(resourceGroupName, registryName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Updates the policies for the specified container registry. - /// - /// - /// The operations group for this extension method. + /// + /// The parameters of a run that needs to scheduled. /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// An object that represents quarantine policy for a container registry. - /// - /// - /// An object that represents content trust policy for a container registry. - /// - public static RegistryPolicies UpdatePolicies(this IRegistriesOperations operations, string resourceGroupName, string registryName, QuarantinePolicy quarantinePolicy = default(QuarantinePolicy), TrustPolicy trustPolicy = default(TrustPolicy)) + public static Run ScheduleRun(this IRegistriesOperations operations, string resourceGroupName, string registryName, RunRequest runRequest) { - return operations.UpdatePoliciesAsync(resourceGroupName, registryName, quarantinePolicy, trustPolicy).GetAwaiter().GetResult(); + return operations.ScheduleRunAsync(resourceGroupName, registryName, runRequest).GetAwaiter().GetResult(); } /// - /// Updates the policies for the specified container registry. + /// Schedules a new run based on the request parameters and add it to the run + /// queue. /// /// /// The operations group for this extension method. @@ -541,25 +500,22 @@ public static RegistryPolicies ListPolicies(this IRegistriesOperations operation /// /// The name of the container registry. /// - /// - /// An object that represents quarantine policy for a container registry. - /// - /// - /// An object that represents content trust policy for a container registry. + /// + /// The parameters of a run that needs to scheduled. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task UpdatePoliciesAsync(this IRegistriesOperations operations, string resourceGroupName, string registryName, QuarantinePolicy quarantinePolicy = default(QuarantinePolicy), TrustPolicy trustPolicy = default(TrustPolicy), CancellationToken cancellationToken = default(CancellationToken)) + 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.UpdatePoliciesWithHttpMessagesAsync(resourceGroupName, registryName, quarantinePolicy, trustPolicy, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ScheduleRunWithHttpMessagesAsync(resourceGroupName, registryName, runRequest, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Generate keys for a token of a specified container registry. + /// Get the upload location for the user to be able to upload the source. /// /// /// The operations group for this extension method. @@ -570,16 +526,13 @@ public static RegistryPolicies ListPolicies(this IRegistriesOperations operation /// /// The name of the container registry. /// - /// - /// The parameters for generating credentials. - /// - public static GenerateCredentialsResult GenerateCredentials(this IRegistriesOperations operations, string resourceGroupName, string registryName, GenerateCredentialsParameters generateCredentialsParameters) + public static SourceUploadDefinition GetBuildSourceUploadUrl(this IRegistriesOperations operations, string resourceGroupName, string registryName) { - return operations.GenerateCredentialsAsync(resourceGroupName, registryName, generateCredentialsParameters).GetAwaiter().GetResult(); + return operations.GetBuildSourceUploadUrlAsync(resourceGroupName, registryName).GetAwaiter().GetResult(); } /// - /// Generate keys for a token of a specified container registry. + /// Get the upload location for the user to be able to upload the source. /// /// /// The operations group for this extension method. @@ -590,15 +543,12 @@ public static GenerateCredentialsResult GenerateCredentials(this IRegistriesOper /// /// The name of the container registry. /// - /// - /// The parameters for generating credentials. - /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GenerateCredentialsAsync(this IRegistriesOperations operations, string resourceGroupName, string registryName, GenerateCredentialsParameters generateCredentialsParameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task GetBuildSourceUploadUrlAsync(this IRegistriesOperations operations, string resourceGroupName, string registryName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GenerateCredentialsWithHttpMessagesAsync(resourceGroupName, registryName, generateCredentialsParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetBuildSourceUploadUrlWithHttpMessagesAsync(resourceGroupName, registryName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -781,59 +731,8 @@ public static Registry BeginUpdate(this IRegistriesOperations operations, string } /// - /// Updates the policies for the specified container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// An object that represents quarantine policy for a container registry. - /// - /// - /// An object that represents content trust policy for a container registry. - /// - public static RegistryPolicies BeginUpdatePolicies(this IRegistriesOperations operations, string resourceGroupName, string registryName, QuarantinePolicy quarantinePolicy = default(QuarantinePolicy), TrustPolicy trustPolicy = default(TrustPolicy)) - { - return operations.BeginUpdatePoliciesAsync(resourceGroupName, registryName, quarantinePolicy, trustPolicy).GetAwaiter().GetResult(); - } - - /// - /// Updates the policies for the specified container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// An object that represents quarantine policy for a container registry. - /// - /// - /// An object that represents content trust policy for a container registry. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task BeginUpdatePoliciesAsync(this IRegistriesOperations operations, string resourceGroupName, string registryName, QuarantinePolicy quarantinePolicy = default(QuarantinePolicy), TrustPolicy trustPolicy = default(TrustPolicy), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdatePoliciesWithHttpMessagesAsync(resourceGroupName, registryName, quarantinePolicy, trustPolicy, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Generate keys for a token of a specified container registry. + /// Schedules a new run based on the request parameters and add it to the run + /// queue. /// /// /// The operations group for this extension method. @@ -844,16 +743,17 @@ public static Registry BeginUpdate(this IRegistriesOperations operations, string /// /// The name of the container registry. /// - /// - /// The parameters for generating credentials. + /// + /// The parameters of a run that needs to scheduled. /// - public static GenerateCredentialsResult BeginGenerateCredentials(this IRegistriesOperations operations, string resourceGroupName, string registryName, GenerateCredentialsParameters generateCredentialsParameters) + public static Run BeginScheduleRun(this IRegistriesOperations operations, string resourceGroupName, string registryName, RunRequest runRequest) { - return operations.BeginGenerateCredentialsAsync(resourceGroupName, registryName, generateCredentialsParameters).GetAwaiter().GetResult(); + return operations.BeginScheduleRunAsync(resourceGroupName, registryName, runRequest).GetAwaiter().GetResult(); } /// - /// Generate keys for a token of a specified container registry. + /// Schedules a new run based on the request parameters and add it to the run + /// queue. /// /// /// The operations group for this extension method. @@ -864,15 +764,15 @@ public static GenerateCredentialsResult BeginGenerateCredentials(this IRegistrie /// /// The name of the container registry. /// - /// - /// The parameters for generating credentials. + /// + /// The parameters of a run that needs to scheduled. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginGenerateCredentialsAsync(this IRegistriesOperations operations, string resourceGroupName, string registryName, GenerateCredentialsParameters generateCredentialsParameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task BeginScheduleRunAsync(this IRegistriesOperations operations, string resourceGroupName, string registryName, RunRequest runRequest, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginGenerateCredentialsWithHttpMessagesAsync(resourceGroupName, registryName, generateCredentialsParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginScheduleRunWithHttpMessagesAsync(resourceGroupName, registryName, runRequest, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/ReplicationsOperations.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/ReplicationsOperations.cs index 9e53ad44453dd..b44eb4bb9fb9c 100644 --- a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/ReplicationsOperations.cs +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/ReplicationsOperations.cs @@ -137,7 +137,7 @@ internal ReplicationsOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "replicationName", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2017-10-01"; + string apiVersion = "2019-05-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -442,7 +442,7 @@ internal ReplicationsOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2017-10-01"; + string apiVersion = "2019-05-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -692,7 +692,7 @@ internal ReplicationsOperations(ContainerRegistryManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "location"); } - string apiVersion = "2017-10-01"; + string apiVersion = "2019-05-01"; Replication replication = new Replication(); if (location != null || tags != null) { @@ -960,7 +960,7 @@ internal ReplicationsOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "replicationName", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2017-10-01"; + string apiVersion = "2019-05-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1186,7 +1186,7 @@ internal ReplicationsOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "replicationName", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2017-10-01"; + string apiVersion = "2019-05-01"; ReplicationUpdateParameters replicationUpdateParameters = new ReplicationUpdateParameters(); if (tags != null) { diff --git a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/TokensOperations.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/RunsOperations.cs similarity index 82% rename from src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/TokensOperations.cs rename to src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/RunsOperations.cs index 02b13a6f7ee14..a2dbc626509a4 100644 --- a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/TokensOperations.cs +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/RunsOperations.cs @@ -12,6 +12,7 @@ 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; @@ -22,12 +23,12 @@ namespace Microsoft.Azure.Management.ContainerRegistry using System.Threading; /// - /// TokensOperations operations. + /// RunsOperations operations. /// - internal partial class TokensOperations : IServiceOperations, ITokensOperations + internal partial class RunsOperations : IServiceOperations, IRunsOperations { /// - /// Initializes a new instance of the TokensOperations class. + /// Initializes a new instance of the RunsOperations class. /// /// /// Reference to the service client. @@ -35,7 +36,7 @@ internal partial class TokensOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal TokensOperations(ContainerRegistryManagementClient client) + internal RunsOperations(ContainerRegistryManagementClient client) { if (client == null) { @@ -50,7 +51,7 @@ internal TokensOperations(ContainerRegistryManagementClient client) public ContainerRegistryManagementClient Client { get; private set; } /// - /// Gets the properties of the specified token. + /// Gets all the runs for a registry. /// /// /// The name of the resource group to which the container registry belongs. @@ -58,8 +59,8 @@ internal TokensOperations(ContainerRegistryManagementClient client) /// /// The name of the container registry. /// - /// - /// The name of the token. + /// + /// OData parameters to apply to the operation. /// /// /// Headers that will be added to request. @@ -82,7 +83,7 @@ internal TokensOperations(ContainerRegistryManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string registryName, string tokenName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + 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) { @@ -118,26 +119,7 @@ internal TokensOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); } } - if (tokenName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "tokenName"); - } - if (tokenName != null) - { - if (tokenName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "tokenName", 50); - } - if (tokenName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "tokenName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(tokenName, "^[a-zA-Z0-9-]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "tokenName", "^[a-zA-Z0-9-]*$"); - } - } - string apiVersion = "2019-05-01-preview"; + string apiVersion = "2019-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -145,21 +127,28 @@ internal TokensOperations(ContainerRegistryManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("odataQuery", odataQuery); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("registryName", registryName); - tracingParameters.Add("tokenName", tokenName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tokens/{tokenName}").ToString(); + 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)); - _url = _url.Replace("{tokenName}", System.Uri.EscapeDataString(tokenName)); 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))); @@ -257,7 +246,7 @@ internal TokensOperations(ContainerRegistryManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -270,7 +259,7 @@ internal TokensOperations(ContainerRegistryManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -290,60 +279,7 @@ internal TokensOperations(ContainerRegistryManagementClient client) } /// - /// Creates a token for a container registry with the specified parameters. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the token. - /// - /// - /// The parameters for creating a token. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string registryName, string tokenName, Token tokenCreateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, registryName, tokenName, tokenCreateParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes a token from a container registry. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the token. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string tokenName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, registryName, tokenName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Updates a token with the specified parameters. + /// Gets the detailed information for a given run. /// /// /// The name of the resource group to which the container registry belongs. @@ -351,33 +287,8 @@ internal TokensOperations(ContainerRegistryManagementClient client) /// /// The name of the container registry. /// - /// - /// The name of the token. - /// - /// - /// The parameters for updating a token. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, string tokenName, TokenUpdateParameters tokenUpdateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, registryName, tokenName, tokenUpdateParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Lists all the tokens for the specified container registry. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. + /// + /// The run ID. /// /// /// Headers that will be added to request. @@ -400,7 +311,7 @@ internal TokensOperations(ContainerRegistryManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string registryName, string runId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -436,7 +347,11 @@ internal TokensOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2019-05-01-preview"; + if (runId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "runId"); + } + string apiVersion = "2019-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -444,18 +359,20 @@ internal TokensOperations(ContainerRegistryManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("registryName", registryName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("runId", runId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tokens").ToString(); + 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) { @@ -554,7 +471,7 @@ internal TokensOperations(ContainerRegistryManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -567,7 +484,7 @@ internal TokensOperations(ContainerRegistryManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -587,7 +504,7 @@ internal TokensOperations(ContainerRegistryManagementClient client) } /// - /// Creates a token for a container registry with the specified parameters. + /// Patch the run properties. /// /// /// The name of the resource group to which the container registry belongs. @@ -595,11 +512,36 @@ internal TokensOperations(ContainerRegistryManagementClient client) /// /// The name of the container registry. /// - /// - /// The name of the token. + /// + /// 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 parameters for creating a token. + /// + /// The run ID. /// /// /// Headers that will be added to request. @@ -622,7 +564,7 @@ internal TokensOperations(ContainerRegistryManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string registryName, string tokenName, Token tokenCreateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetLogSasUrlWithHttpMessagesAsync(string resourceGroupName, string registryName, string runId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -658,30 +600,11 @@ internal TokensOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); } } - if (tokenName == null) + if (runId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "tokenName"); + throw new ValidationException(ValidationRules.CannotBeNull, "runId"); } - if (tokenName != null) - { - if (tokenName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "tokenName", 50); - } - if (tokenName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "tokenName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(tokenName, "^[a-zA-Z0-9-]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "tokenName", "^[a-zA-Z0-9-]*$"); - } - } - if (tokenCreateParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "tokenCreateParameters"); - } - string apiVersion = "2019-05-01-preview"; + string apiVersion = "2019-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -689,21 +612,20 @@ internal TokensOperations(ContainerRegistryManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("registryName", registryName); - tracingParameters.Add("tokenName", tokenName); - tracingParameters.Add("tokenCreateParameters", tokenCreateParameters); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("runId", runId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", tracingParameters); + 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}/tokens/{tokenName}").ToString(); + 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("{tokenName}", System.Uri.EscapeDataString(tokenName)); + _url = _url.Replace("{runId}", System.Uri.EscapeDataString(runId)); List _queryParameters = new List(); if (apiVersion != null) { @@ -716,7 +638,7 @@ internal TokensOperations(ContainerRegistryManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -747,12 +669,6 @@ internal TokensOperations(ContainerRegistryManagementClient client) // Serialize Request string _requestContent = null; - if(tokenCreateParameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(tokenCreateParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -773,7 +689,7 @@ internal TokensOperations(ContainerRegistryManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -808,7 +724,7 @@ internal TokensOperations(ContainerRegistryManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -821,25 +737,7 @@ internal TokensOperations(ContainerRegistryManagementClient client) _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); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -859,7 +757,32 @@ internal TokensOperations(ContainerRegistryManagementClient client) } /// - /// Deletes a token from a container registry. + /// 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. @@ -867,8 +790,11 @@ internal TokensOperations(ContainerRegistryManagementClient client) /// /// The name of the container registry. /// - /// - /// The name of the token. + /// + /// The run ID. + /// + /// + /// The value that indicates whether archiving is enabled or not. /// /// /// Headers that will be added to request. @@ -879,6 +805,9 @@ internal TokensOperations(ContainerRegistryManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -888,7 +817,7 @@ internal TokensOperations(ContainerRegistryManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string tokenName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + 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) { @@ -924,26 +853,16 @@ internal TokensOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); } } - if (tokenName == null) + if (runId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "tokenName"); + throw new ValidationException(ValidationRules.CannotBeNull, "runId"); } - if (tokenName != null) + string apiVersion = "2019-04-01"; + RunUpdateParameters runUpdateParameters = new RunUpdateParameters(); + if (isArchiveEnabled != null) { - if (tokenName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "tokenName", 50); - } - if (tokenName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "tokenName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(tokenName, "^[a-zA-Z0-9-]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "tokenName", "^[a-zA-Z0-9-]*$"); - } + runUpdateParameters.IsArchiveEnabled = isArchiveEnabled; } - string apiVersion = "2019-05-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -951,20 +870,21 @@ internal TokensOperations(ContainerRegistryManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("registryName", registryName); - tracingParameters.Add("tokenName", tokenName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("runId", runId); + tracingParameters.Add("runUpdateParameters", runUpdateParameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tokens/{tokenName}").ToString(); + 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("{tokenName}", System.Uri.EscapeDataString(tokenName)); + _url = _url.Replace("{runId}", System.Uri.EscapeDataString(runId)); List _queryParameters = new List(); if (apiVersion != null) { @@ -977,7 +897,7 @@ internal TokensOperations(ContainerRegistryManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1008,6 +928,12 @@ internal TokensOperations(ContainerRegistryManagementClient client) // 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) { @@ -1028,7 +954,7 @@ internal TokensOperations(ContainerRegistryManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1063,13 +989,49 @@ internal TokensOperations(ContainerRegistryManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _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); @@ -1078,7 +1040,7 @@ internal TokensOperations(ContainerRegistryManagementClient client) } /// - /// Updates a token with the specified parameters. + /// Cancel an existing run. /// /// /// The name of the resource group to which the container registry belongs. @@ -1086,11 +1048,8 @@ internal TokensOperations(ContainerRegistryManagementClient client) /// /// The name of the container registry. /// - /// - /// The name of the token. - /// - /// - /// The parameters for updating a token. + /// + /// The run ID. /// /// /// Headers that will be added to request. @@ -1101,9 +1060,6 @@ internal TokensOperations(ContainerRegistryManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -1113,7 +1069,7 @@ internal TokensOperations(ContainerRegistryManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, string tokenName, TokenUpdateParameters tokenUpdateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginCancelWithHttpMessagesAsync(string resourceGroupName, string registryName, string runId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -1149,30 +1105,11 @@ internal TokensOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); } } - if (tokenName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "tokenName"); - } - if (tokenName != null) - { - if (tokenName.Length > 50) - { - throw new ValidationException(ValidationRules.MaxLength, "tokenName", 50); - } - if (tokenName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "tokenName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(tokenName, "^[a-zA-Z0-9-]*$")) - { - throw new ValidationException(ValidationRules.Pattern, "tokenName", "^[a-zA-Z0-9-]*$"); - } - } - if (tokenUpdateParameters == null) + if (runId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "tokenUpdateParameters"); + throw new ValidationException(ValidationRules.CannotBeNull, "runId"); } - string apiVersion = "2019-05-01-preview"; + string apiVersion = "2019-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1180,21 +1117,20 @@ internal TokensOperations(ContainerRegistryManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("registryName", registryName); - tracingParameters.Add("tokenName", tokenName); - tracingParameters.Add("tokenUpdateParameters", tokenUpdateParameters); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("runId", runId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + 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}/tokens/{tokenName}").ToString(); + 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("{tokenName}", System.Uri.EscapeDataString(tokenName)); + _url = _url.Replace("{runId}", System.Uri.EscapeDataString(runId)); List _queryParameters = new List(); if (apiVersion != null) { @@ -1207,7 +1143,7 @@ internal TokensOperations(ContainerRegistryManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1238,12 +1174,6 @@ internal TokensOperations(ContainerRegistryManagementClient client) // Serialize Request string _requestContent = null; - if(tokenUpdateParameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(tokenUpdateParameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -1264,7 +1194,7 @@ internal TokensOperations(ContainerRegistryManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1299,49 +1229,13 @@ internal TokensOperations(ContainerRegistryManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _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); @@ -1350,7 +1244,7 @@ internal TokensOperations(ContainerRegistryManagementClient client) } /// - /// Lists all the tokens for the specified container registry. + /// Gets all the runs for a registry. /// /// /// The NextLink from the previous successful call to List operation. @@ -1376,7 +1270,7 @@ internal TokensOperations(ContainerRegistryManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -1490,7 +1384,7 @@ internal TokensOperations(ContainerRegistryManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1503,7 +1397,7 @@ internal TokensOperations(ContainerRegistryManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/TokensOperationsExtensions.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/RunsOperationsExtensions.cs similarity index 52% rename from src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/TokensOperationsExtensions.cs rename to src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/RunsOperationsExtensions.cs index 1624952dc581e..408b5dbc9f121 100644 --- a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/TokensOperationsExtensions.cs +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/RunsOperationsExtensions.cs @@ -12,16 +12,17 @@ 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 TokensOperations. + /// Extension methods for RunsOperations. /// - public static partial class TokensOperationsExtensions + public static partial class RunsOperationsExtensions { /// - /// Gets the properties of the specified token. + /// Gets all the runs for a registry. /// /// /// The operations group for this extension method. @@ -32,16 +33,16 @@ public static partial class TokensOperationsExtensions /// /// The name of the container registry. /// - /// - /// The name of the token. + /// + /// OData parameters to apply to the operation. /// - public static Token Get(this ITokensOperations operations, string resourceGroupName, string registryName, string tokenName) + public static IPage List(this IRunsOperations operations, string resourceGroupName, string registryName, ODataQuery odataQuery = default(ODataQuery)) { - return operations.GetAsync(resourceGroupName, registryName, tokenName).GetAwaiter().GetResult(); + return operations.ListAsync(resourceGroupName, registryName, odataQuery).GetAwaiter().GetResult(); } /// - /// Gets the properties of the specified token. + /// Gets all the runs for a registry. /// /// /// The operations group for this extension method. @@ -52,22 +53,22 @@ public static Token Get(this ITokensOperations operations, string resourceGroupN /// /// The name of the container registry. /// - /// - /// The name of the token. + /// + /// OData parameters to apply to the operation. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this ITokensOperations operations, string resourceGroupName, string registryName, string tokenName, CancellationToken cancellationToken = default(CancellationToken)) + 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.GetWithHttpMessagesAsync(resourceGroupName, registryName, tokenName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, registryName, odataQuery, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Creates a token for a container registry with the specified parameters. + /// Gets the detailed information for a given run. /// /// /// The operations group for this extension method. @@ -78,19 +79,16 @@ public static Token Get(this ITokensOperations operations, string resourceGroupN /// /// The name of the container registry. /// - /// - /// The name of the token. + /// + /// The run ID. /// - /// - /// The parameters for creating a token. - /// - public static Token Create(this ITokensOperations operations, string resourceGroupName, string registryName, string tokenName, Token tokenCreateParameters) + public static Run Get(this IRunsOperations operations, string resourceGroupName, string registryName, string runId) { - return operations.CreateAsync(resourceGroupName, registryName, tokenName, tokenCreateParameters).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, registryName, runId).GetAwaiter().GetResult(); } /// - /// Creates a token for a container registry with the specified parameters. + /// Gets the detailed information for a given run. /// /// /// The operations group for this extension method. @@ -101,68 +99,22 @@ public static Token Create(this ITokensOperations operations, string resourceGro /// /// The name of the container registry. /// - /// - /// The name of the token. - /// - /// - /// The parameters for creating a token. + /// + /// The run ID. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateAsync(this ITokensOperations operations, string resourceGroupName, string registryName, string tokenName, Token tokenCreateParameters, CancellationToken cancellationToken = default(CancellationToken)) + 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.CreateWithHttpMessagesAsync(resourceGroupName, registryName, tokenName, tokenCreateParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, registryName, runId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Deletes a token from a container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the token. - /// - public static void Delete(this ITokensOperations operations, string resourceGroupName, string registryName, string tokenName) - { - operations.DeleteAsync(resourceGroupName, registryName, tokenName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a token from a container registry. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group to which the container registry belongs. - /// - /// - /// The name of the container registry. - /// - /// - /// The name of the token. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task DeleteAsync(this ITokensOperations operations, string resourceGroupName, string registryName, string tokenName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, registryName, tokenName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Updates a token with the specified parameters. + /// Patch the run properties. /// /// /// The operations group for this extension method. @@ -173,19 +125,19 @@ public static void Delete(this ITokensOperations operations, string resourceGrou /// /// The name of the container registry. /// - /// - /// The name of the token. + /// + /// The run ID. /// - /// - /// The parameters for updating a token. + /// + /// The value that indicates whether archiving is enabled or not. /// - public static Token Update(this ITokensOperations operations, string resourceGroupName, string registryName, string tokenName, TokenUpdateParameters tokenUpdateParameters) + public static Run Update(this IRunsOperations operations, string resourceGroupName, string registryName, string runId, bool? isArchiveEnabled = default(bool?)) { - return operations.UpdateAsync(resourceGroupName, registryName, tokenName, tokenUpdateParameters).GetAwaiter().GetResult(); + return operations.UpdateAsync(resourceGroupName, registryName, runId, isArchiveEnabled).GetAwaiter().GetResult(); } /// - /// Updates a token with the specified parameters. + /// Patch the run properties. /// /// /// The operations group for this extension method. @@ -196,25 +148,25 @@ public static Token Update(this ITokensOperations operations, string resourceGro /// /// The name of the container registry. /// - /// - /// The name of the token. + /// + /// The run ID. /// - /// - /// The parameters for updating a token. + /// + /// The value that indicates whether archiving is enabled or not. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task UpdateAsync(this ITokensOperations operations, string resourceGroupName, string registryName, string tokenName, TokenUpdateParameters tokenUpdateParameters, CancellationToken cancellationToken = default(CancellationToken)) + 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, tokenName, tokenUpdateParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, registryName, runId, isArchiveEnabled, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Lists all the tokens for the specified container registry. + /// Gets a link to download the run logs. /// /// /// The operations group for this extension method. @@ -225,13 +177,16 @@ public static Token Update(this ITokensOperations operations, string resourceGro /// /// The name of the container registry. /// - public static IPage List(this ITokensOperations operations, string resourceGroupName, string registryName) + /// + /// The run ID. + /// + public static RunGetLogResult GetLogSasUrl(this IRunsOperations operations, string resourceGroupName, string registryName, string runId) { - return operations.ListAsync(resourceGroupName, registryName).GetAwaiter().GetResult(); + return operations.GetLogSasUrlAsync(resourceGroupName, registryName, runId).GetAwaiter().GetResult(); } /// - /// Lists all the tokens for the specified container registry. + /// Gets a link to download the run logs. /// /// /// The operations group for this extension method. @@ -242,19 +197,22 @@ public static IPage List(this ITokensOperations operations, string resour /// /// The name of the container registry. /// + /// + /// The run ID. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListAsync(this ITokensOperations operations, string resourceGroupName, string registryName, CancellationToken cancellationToken = default(CancellationToken)) + 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.ListWithHttpMessagesAsync(resourceGroupName, registryName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetLogSasUrlWithHttpMessagesAsync(resourceGroupName, registryName, runId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Creates a token for a container registry with the specified parameters. + /// Cancel an existing run. /// /// /// The operations group for this extension method. @@ -265,19 +223,16 @@ public static IPage List(this ITokensOperations operations, string resour /// /// The name of the container registry. /// - /// - /// The name of the token. - /// - /// - /// The parameters for creating a token. + /// + /// The run ID. /// - public static Token BeginCreate(this ITokensOperations operations, string resourceGroupName, string registryName, string tokenName, Token tokenCreateParameters) + public static void Cancel(this IRunsOperations operations, string resourceGroupName, string registryName, string runId) { - return operations.BeginCreateAsync(resourceGroupName, registryName, tokenName, tokenCreateParameters).GetAwaiter().GetResult(); + operations.CancelAsync(resourceGroupName, registryName, runId).GetAwaiter().GetResult(); } /// - /// Creates a token for a container registry with the specified parameters. + /// Cancel an existing run. /// /// /// The operations group for this extension method. @@ -288,25 +243,19 @@ public static Token BeginCreate(this ITokensOperations operations, string resour /// /// The name of the container registry. /// - /// - /// The name of the token. - /// - /// - /// The parameters for creating a token. + /// + /// The run ID. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginCreateAsync(this ITokensOperations operations, string resourceGroupName, string registryName, string tokenName, Token tokenCreateParameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task CancelAsync(this IRunsOperations operations, string resourceGroupName, string registryName, string runId, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginCreateWithHttpMessagesAsync(resourceGroupName, registryName, tokenName, tokenCreateParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + (await operations.CancelWithHttpMessagesAsync(resourceGroupName, registryName, runId, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Deletes a token from a container registry. + /// Patch the run properties. /// /// /// The operations group for this extension method. @@ -317,16 +266,19 @@ public static Token BeginCreate(this ITokensOperations operations, string resour /// /// The name of the container registry. /// - /// - /// The name of the token. + /// + /// The run ID. + /// + /// + /// The value that indicates whether archiving is enabled or not. /// - public static void BeginDelete(this ITokensOperations operations, string resourceGroupName, string registryName, string tokenName) + public static Run BeginUpdate(this IRunsOperations operations, string resourceGroupName, string registryName, string runId, bool? isArchiveEnabled = default(bool?)) { - operations.BeginDeleteAsync(resourceGroupName, registryName, tokenName).GetAwaiter().GetResult(); + return operations.BeginUpdateAsync(resourceGroupName, registryName, runId, isArchiveEnabled).GetAwaiter().GetResult(); } /// - /// Deletes a token from a container registry. + /// Patch the run properties. /// /// /// The operations group for this extension method. @@ -337,19 +289,25 @@ public static void BeginDelete(this ITokensOperations operations, string resourc /// /// The name of the container registry. /// - /// - /// The name of the token. + /// + /// The run ID. + /// + /// + /// The value that indicates whether archiving is enabled or not. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginDeleteAsync(this ITokensOperations operations, string resourceGroupName, string registryName, string tokenName, CancellationToken cancellationToken = default(CancellationToken)) + 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)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, registryName, tokenName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, registryName, runId, isArchiveEnabled, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Updates a token with the specified parameters. + /// Cancel an existing run. /// /// /// The operations group for this extension method. @@ -360,19 +318,16 @@ public static void BeginDelete(this ITokensOperations operations, string resourc /// /// The name of the container registry. /// - /// - /// The name of the token. - /// - /// - /// The parameters for updating a token. + /// + /// The run ID. /// - public static Token BeginUpdate(this ITokensOperations operations, string resourceGroupName, string registryName, string tokenName, TokenUpdateParameters tokenUpdateParameters) + public static void BeginCancel(this IRunsOperations operations, string resourceGroupName, string registryName, string runId) { - return operations.BeginUpdateAsync(resourceGroupName, registryName, tokenName, tokenUpdateParameters).GetAwaiter().GetResult(); + operations.BeginCancelAsync(resourceGroupName, registryName, runId).GetAwaiter().GetResult(); } /// - /// Updates a token with the specified parameters. + /// Cancel an existing run. /// /// /// The operations group for this extension method. @@ -383,25 +338,19 @@ public static Token BeginUpdate(this ITokensOperations operations, string resour /// /// The name of the container registry. /// - /// - /// The name of the token. - /// - /// - /// The parameters for updating a token. + /// + /// The run ID. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginUpdateAsync(this ITokensOperations operations, string resourceGroupName, string registryName, string tokenName, TokenUpdateParameters tokenUpdateParameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task BeginCancelAsync(this IRunsOperations operations, string resourceGroupName, string registryName, string runId, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, registryName, tokenName, tokenUpdateParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + (await operations.BeginCancelWithHttpMessagesAsync(resourceGroupName, registryName, runId, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Lists all the tokens for the specified container registry. + /// Gets all the runs for a registry. /// /// /// The operations group for this extension method. @@ -409,13 +358,13 @@ public static Token BeginUpdate(this ITokensOperations operations, string resour /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListNext(this ITokensOperations operations, string nextPageLink) + public static IPage ListNext(this IRunsOperations operations, string nextPageLink) { return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// - /// Lists all the tokens for the specified container registry. + /// Gets all the runs for a registry. /// /// /// The operations group for this extension method. @@ -426,7 +375,7 @@ public static IPage ListNext(this ITokensOperations operations, string ne /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListNextAsync(this ITokensOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + 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)) { diff --git a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/SdkInfo_ContainerRegistryManagementClient.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/SdkInfo_ContainerRegistryManagementClient.cs index edcebd54b5bd6..c02e8fc89df0b 100644 --- a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/SdkInfo_ContainerRegistryManagementClient.cs +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/SdkInfo_ContainerRegistryManagementClient.cs @@ -19,13 +19,13 @@ public static IEnumerable> ApiInfo_ContainerRegist { return new Tuple[] { - new Tuple("ContainerRegistry", "Operations", "2017-10-01"), - new Tuple("ContainerRegistry", "Registries", "2017-10-01"), - new Tuple("ContainerRegistry", "Registries", "2019-05-01-preview"), - new Tuple("ContainerRegistry", "Replications", "2017-10-01"), - new Tuple("ContainerRegistry", "ScopeMaps", "2019-05-01-preview"), - new Tuple("ContainerRegistry", "Tokens", "2019-05-01-preview"), - new Tuple("ContainerRegistry", "Webhooks", "2017-10-01"), + new Tuple("ContainerRegistry", "Operations", "2019-05-01"), + new Tuple("ContainerRegistry", "Registries", "2019-04-01"), + new Tuple("ContainerRegistry", "Registries", "2019-05-01"), + new Tuple("ContainerRegistry", "Replications", "2019-05-01"), + new Tuple("ContainerRegistry", "Runs", "2019-04-01"), + new Tuple("ContainerRegistry", "Tasks", "2019-04-01"), + new Tuple("ContainerRegistry", "Webhooks", "2019-05-01"), }.AsEnumerable(); } } diff --git a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/ScopeMapsOperations.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/TasksOperations.cs similarity index 76% rename from src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/ScopeMapsOperations.cs rename to src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/TasksOperations.cs index 4a0e0b6ddd9f6..cd8205f6c8644 100644 --- a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/ScopeMapsOperations.cs +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/TasksOperations.cs @@ -22,12 +22,12 @@ namespace Microsoft.Azure.Management.ContainerRegistry using System.Threading; /// - /// ScopeMapsOperations operations. + /// TasksOperations operations. /// - internal partial class ScopeMapsOperations : IServiceOperations, IScopeMapsOperations + internal partial class TasksOperations : IServiceOperations, ITasksOperations { /// - /// Initializes a new instance of the ScopeMapsOperations class. + /// Initializes a new instance of the TasksOperations class. /// /// /// Reference to the service client. @@ -35,7 +35,7 @@ internal partial class ScopeMapsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal ScopeMapsOperations(ContainerRegistryManagementClient client) + internal TasksOperations(ContainerRegistryManagementClient client) { if (client == null) { @@ -50,7 +50,7 @@ internal ScopeMapsOperations(ContainerRegistryManagementClient client) public ContainerRegistryManagementClient Client { get; private set; } /// - /// Gets the properties of the specified scope map. + /// Lists all the tasks for a specified container registry. /// /// /// The name of the resource group to which the container registry belongs. @@ -58,8 +58,224 @@ internal ScopeMapsOperations(ContainerRegistryManagementClient client) /// /// The name of the container registry. /// - /// - /// The name of the scope map. + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async System.Threading.Tasks.Task>> 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-04-01"; + // 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. @@ -82,7 +298,7 @@ internal ScopeMapsOperations(ContainerRegistryManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string registryName, string scopeMapName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string registryName, string taskName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -118,26 +334,26 @@ internal ScopeMapsOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); } } - if (scopeMapName == null) + if (taskName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "scopeMapName"); + throw new ValidationException(ValidationRules.CannotBeNull, "taskName"); } - if (scopeMapName != null) + if (taskName != null) { - if (scopeMapName.Length > 50) + if (taskName.Length > 50) { - throw new ValidationException(ValidationRules.MaxLength, "scopeMapName", 50); + throw new ValidationException(ValidationRules.MaxLength, "taskName", 50); } - if (scopeMapName.Length < 5) + if (taskName.Length < 5) { - throw new ValidationException(ValidationRules.MinLength, "scopeMapName", 5); + throw new ValidationException(ValidationRules.MinLength, "taskName", 5); } - if (!System.Text.RegularExpressions.Regex.IsMatch(scopeMapName, "^[a-zA-Z0-9-]*$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(taskName, "^[a-zA-Z0-9-_]*$")) { - throw new ValidationException(ValidationRules.Pattern, "scopeMapName", "^[a-zA-Z0-9-]*$"); + throw new ValidationException(ValidationRules.Pattern, "taskName", "^[a-zA-Z0-9-_]*$"); } } - string apiVersion = "2019-05-01-preview"; + string apiVersion = "2019-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -145,20 +361,20 @@ internal ScopeMapsOperations(ContainerRegistryManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("registryName", registryName); - tracingParameters.Add("scopeMapName", scopeMapName); + tracingParameters.Add("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}/scopeMaps/{scopeMapName}").ToString(); + 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("{scopeMapName}", System.Uri.EscapeDataString(scopeMapName)); + _url = _url.Replace("{taskName}", System.Uri.EscapeDataString(taskName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -257,7 +473,7 @@ internal ScopeMapsOperations(ContainerRegistryManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -270,7 +486,7 @@ internal ScopeMapsOperations(ContainerRegistryManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -290,7 +506,7 @@ internal ScopeMapsOperations(ContainerRegistryManagementClient client) } /// - /// Creates a scope map for a container registry with the specified parameters. + /// Creates a task for a container registry with the specified parameters. /// /// /// The name of the resource group to which the container registry belongs. @@ -298,16 +514,11 @@ internal ScopeMapsOperations(ContainerRegistryManagementClient client) /// /// The name of the container registry. /// - /// - /// The name of the scope map. + /// + /// The name of the container registry task. /// - /// - /// The list of scoped permissions for registry artifacts. - /// E.g. repositories/repository-name/pull, - /// repositories/repository-name/delete - /// - /// - /// The user friendly description of the scope map. + /// + /// The parameters for creating a task. /// /// /// The headers that will be added to request. @@ -315,15 +526,15 @@ internal ScopeMapsOperations(ContainerRegistryManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string registryName, string scopeMapName, IList actions, string description = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + 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, scopeMapName, actions, description, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, registryName, taskName, taskCreateParameters, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Deletes a scope map from a container registry. + /// Deletes a specified task. /// /// /// The name of the resource group to which the container registry belongs. @@ -331,8 +542,8 @@ internal ScopeMapsOperations(ContainerRegistryManagementClient client) /// /// The name of the container registry. /// - /// - /// The name of the scope map. + /// + /// The name of the container registry task. /// /// /// The headers that will be added to request. @@ -340,15 +551,15 @@ internal ScopeMapsOperations(ContainerRegistryManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string scopeMapName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + 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, scopeMapName, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, registryName, taskName, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Updates a scope map with the specified parameters. + /// Updates a task with the specified parameters. /// /// /// The name of the resource group to which the container registry belongs. @@ -356,16 +567,11 @@ internal ScopeMapsOperations(ContainerRegistryManagementClient client) /// /// The name of the container registry. /// - /// - /// The name of the scope map. - /// - /// - /// The user friendly description of the scope map. + /// + /// The name of the container registry task. /// - /// - /// The list of scope permissions for registry artifacts. - /// E.g. repositories/repository-name/pull, - /// repositories/repository-name/delete + /// + /// The parameters for updating a task. /// /// /// The headers that will be added to request. @@ -373,15 +579,15 @@ internal ScopeMapsOperations(ContainerRegistryManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, string scopeMapName, string description = default(string), IList actions = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + 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, scopeMapName, description, actions, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, registryName, taskName, taskUpdateParameters, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Lists all the scope maps for the specified container registry. + /// Returns a task with extended information that includes all secrets. /// /// /// The name of the resource group to which the container registry belongs. @@ -389,6 +595,9 @@ internal ScopeMapsOperations(ContainerRegistryManagementClient client) /// /// The name of the container registry. /// + /// + /// The name of the container registry task. + /// /// /// Headers that will be added to request. /// @@ -410,7 +619,7 @@ internal ScopeMapsOperations(ContainerRegistryManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetDetailsWithHttpMessagesAsync(string resourceGroupName, string registryName, string taskName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -446,7 +655,26 @@ internal ScopeMapsOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2019-05-01-preview"; + 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-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -454,18 +682,20 @@ internal ScopeMapsOperations(ContainerRegistryManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("registryName", registryName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("taskName", taskName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + 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}/scopeMaps").ToString(); + 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) { @@ -478,7 +708,7 @@ internal ScopeMapsOperations(ContainerRegistryManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -564,7 +794,7 @@ internal ScopeMapsOperations(ContainerRegistryManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -577,7 +807,7 @@ internal ScopeMapsOperations(ContainerRegistryManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -597,7 +827,7 @@ internal ScopeMapsOperations(ContainerRegistryManagementClient client) } /// - /// Creates a scope map for a container registry with the specified parameters. + /// Creates a task for a container registry with the specified parameters. /// /// /// The name of the resource group to which the container registry belongs. @@ -605,16 +835,11 @@ internal ScopeMapsOperations(ContainerRegistryManagementClient client) /// /// The name of the container registry. /// - /// - /// The name of the scope map. - /// - /// - /// The list of scoped permissions for registry artifacts. - /// E.g. repositories/repository-name/pull, - /// repositories/repository-name/delete + /// + /// The name of the container registry task. /// - /// - /// The user friendly description of the scope map. + /// + /// The parameters for creating a task. /// /// /// Headers that will be added to request. @@ -637,7 +862,7 @@ internal ScopeMapsOperations(ContainerRegistryManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string registryName, string scopeMapName, IList actions, string description = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + 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) { @@ -673,36 +898,34 @@ internal ScopeMapsOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); } } - if (scopeMapName == null) + if (taskName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "scopeMapName"); + throw new ValidationException(ValidationRules.CannotBeNull, "taskName"); } - if (scopeMapName != null) + if (taskName != null) { - if (scopeMapName.Length > 50) + if (taskName.Length > 50) { - throw new ValidationException(ValidationRules.MaxLength, "scopeMapName", 50); + throw new ValidationException(ValidationRules.MaxLength, "taskName", 50); } - if (scopeMapName.Length < 5) + if (taskName.Length < 5) { - throw new ValidationException(ValidationRules.MinLength, "scopeMapName", 5); + throw new ValidationException(ValidationRules.MinLength, "taskName", 5); } - if (!System.Text.RegularExpressions.Regex.IsMatch(scopeMapName, "^[a-zA-Z0-9-]*$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(taskName, "^[a-zA-Z0-9-_]*$")) { - throw new ValidationException(ValidationRules.Pattern, "scopeMapName", "^[a-zA-Z0-9-]*$"); + throw new ValidationException(ValidationRules.Pattern, "taskName", "^[a-zA-Z0-9-_]*$"); } } - if (actions == null) + if (taskCreateParameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "actions"); + throw new ValidationException(ValidationRules.CannotBeNull, "taskCreateParameters"); } - string apiVersion = "2019-05-01-preview"; - ScopeMap scopeMapCreateParameters = new ScopeMap(); - if (description != null || actions != null) + if (taskCreateParameters != null) { - scopeMapCreateParameters.Description = description; - scopeMapCreateParameters.Actions = actions; + taskCreateParameters.Validate(); } + string apiVersion = "2019-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -710,21 +933,21 @@ internal ScopeMapsOperations(ContainerRegistryManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("registryName", registryName); - tracingParameters.Add("scopeMapName", scopeMapName); - tracingParameters.Add("scopeMapCreateParameters", scopeMapCreateParameters); + tracingParameters.Add("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}/scopeMaps/{scopeMapName}").ToString(); + 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("{scopeMapName}", System.Uri.EscapeDataString(scopeMapName)); + _url = _url.Replace("{taskName}", System.Uri.EscapeDataString(taskName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -768,9 +991,9 @@ internal ScopeMapsOperations(ContainerRegistryManagementClient client) // Serialize Request string _requestContent = null; - if(scopeMapCreateParameters != null) + if(taskCreateParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(scopeMapCreateParameters, Client.SerializationSettings); + _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"); } @@ -829,7 +1052,7 @@ internal ScopeMapsOperations(ContainerRegistryManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -842,7 +1065,7 @@ internal ScopeMapsOperations(ContainerRegistryManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -860,7 +1083,7 @@ internal ScopeMapsOperations(ContainerRegistryManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -880,7 +1103,7 @@ internal ScopeMapsOperations(ContainerRegistryManagementClient client) } /// - /// Deletes a scope map from a container registry. + /// Deletes a specified task. /// /// /// The name of the resource group to which the container registry belongs. @@ -888,8 +1111,8 @@ internal ScopeMapsOperations(ContainerRegistryManagementClient client) /// /// The name of the container registry. /// - /// - /// The name of the scope map. + /// + /// The name of the container registry task. /// /// /// Headers that will be added to request. @@ -909,7 +1132,7 @@ internal ScopeMapsOperations(ContainerRegistryManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string scopeMapName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string taskName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -945,26 +1168,26 @@ internal ScopeMapsOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); } } - if (scopeMapName == null) + if (taskName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "scopeMapName"); + throw new ValidationException(ValidationRules.CannotBeNull, "taskName"); } - if (scopeMapName != null) + if (taskName != null) { - if (scopeMapName.Length > 50) + if (taskName.Length > 50) { - throw new ValidationException(ValidationRules.MaxLength, "scopeMapName", 50); + throw new ValidationException(ValidationRules.MaxLength, "taskName", 50); } - if (scopeMapName.Length < 5) + if (taskName.Length < 5) { - throw new ValidationException(ValidationRules.MinLength, "scopeMapName", 5); + throw new ValidationException(ValidationRules.MinLength, "taskName", 5); } - if (!System.Text.RegularExpressions.Regex.IsMatch(scopeMapName, "^[a-zA-Z0-9-]*$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(taskName, "^[a-zA-Z0-9-_]*$")) { - throw new ValidationException(ValidationRules.Pattern, "scopeMapName", "^[a-zA-Z0-9-]*$"); + throw new ValidationException(ValidationRules.Pattern, "taskName", "^[a-zA-Z0-9-_]*$"); } } - string apiVersion = "2019-05-01-preview"; + string apiVersion = "2019-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -972,20 +1195,20 @@ internal ScopeMapsOperations(ContainerRegistryManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("registryName", registryName); - tracingParameters.Add("scopeMapName", scopeMapName); + tracingParameters.Add("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}/scopeMaps/{scopeMapName}").ToString(); + 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("{scopeMapName}", System.Uri.EscapeDataString(scopeMapName)); + _url = _url.Replace("{taskName}", System.Uri.EscapeDataString(taskName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -1099,7 +1322,7 @@ internal ScopeMapsOperations(ContainerRegistryManagementClient client) } /// - /// Updates a scope map with the specified parameters. + /// Updates a task with the specified parameters. /// /// /// The name of the resource group to which the container registry belongs. @@ -1107,16 +1330,11 @@ internal ScopeMapsOperations(ContainerRegistryManagementClient client) /// /// The name of the container registry. /// - /// - /// The name of the scope map. + /// + /// The name of the container registry task. /// - /// - /// The user friendly description of the scope map. - /// - /// - /// The list of scope permissions for registry artifacts. - /// E.g. repositories/repository-name/pull, - /// repositories/repository-name/delete + /// + /// The parameters for updating a task. /// /// /// Headers that will be added to request. @@ -1139,7 +1357,7 @@ internal ScopeMapsOperations(ContainerRegistryManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, string scopeMapName, string description = default(string), IList actions = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + 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) { @@ -1175,32 +1393,30 @@ internal ScopeMapsOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); } } - if (scopeMapName == null) + if (taskName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "scopeMapName"); + throw new ValidationException(ValidationRules.CannotBeNull, "taskName"); } - if (scopeMapName != null) + if (taskName != null) { - if (scopeMapName.Length > 50) + if (taskName.Length > 50) { - throw new ValidationException(ValidationRules.MaxLength, "scopeMapName", 50); + throw new ValidationException(ValidationRules.MaxLength, "taskName", 50); } - if (scopeMapName.Length < 5) + if (taskName.Length < 5) { - throw new ValidationException(ValidationRules.MinLength, "scopeMapName", 5); + throw new ValidationException(ValidationRules.MinLength, "taskName", 5); } - if (!System.Text.RegularExpressions.Regex.IsMatch(scopeMapName, "^[a-zA-Z0-9-]*$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(taskName, "^[a-zA-Z0-9-_]*$")) { - throw new ValidationException(ValidationRules.Pattern, "scopeMapName", "^[a-zA-Z0-9-]*$"); + throw new ValidationException(ValidationRules.Pattern, "taskName", "^[a-zA-Z0-9-_]*$"); } } - string apiVersion = "2019-05-01-preview"; - ScopeMapUpdateParameters scopeMapUpdateParameters = new ScopeMapUpdateParameters(); - if (description != null || actions != null) + if (taskUpdateParameters == null) { - scopeMapUpdateParameters.Description = description; - scopeMapUpdateParameters.Actions = actions; + throw new ValidationException(ValidationRules.CannotBeNull, "taskUpdateParameters"); } + string apiVersion = "2019-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1208,21 +1424,21 @@ internal ScopeMapsOperations(ContainerRegistryManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("registryName", registryName); - tracingParameters.Add("scopeMapName", scopeMapName); - tracingParameters.Add("scopeMapUpdateParameters", scopeMapUpdateParameters); + tracingParameters.Add("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}/scopeMaps/{scopeMapName}").ToString(); + 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("{scopeMapName}", System.Uri.EscapeDataString(scopeMapName)); + _url = _url.Replace("{taskName}", System.Uri.EscapeDataString(taskName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -1266,9 +1482,9 @@ internal ScopeMapsOperations(ContainerRegistryManagementClient client) // Serialize Request string _requestContent = null; - if(scopeMapUpdateParameters != null) + if(taskUpdateParameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(scopeMapUpdateParameters, Client.SerializationSettings); + _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"); } @@ -1327,7 +1543,7 @@ internal ScopeMapsOperations(ContainerRegistryManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1340,7 +1556,7 @@ internal ScopeMapsOperations(ContainerRegistryManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1358,7 +1574,7 @@ internal ScopeMapsOperations(ContainerRegistryManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1378,7 +1594,7 @@ internal ScopeMapsOperations(ContainerRegistryManagementClient client) } /// - /// Lists all the scope maps for the specified container registry. + /// Lists all the tasks for a specified container registry. /// /// /// The NextLink from the previous successful call to List operation. @@ -1404,7 +1620,7 @@ internal ScopeMapsOperations(ContainerRegistryManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -1518,7 +1734,7 @@ internal ScopeMapsOperations(ContainerRegistryManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1531,7 +1747,7 @@ internal ScopeMapsOperations(ContainerRegistryManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/ScopeMapsOperationsExtensions.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/TasksOperationsExtensions.cs similarity index 56% rename from src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/ScopeMapsOperationsExtensions.cs rename to src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/TasksOperationsExtensions.cs index b16e7809db5fe..8e1a77173a405 100644 --- a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/ScopeMapsOperationsExtensions.cs +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/TasksOperationsExtensions.cs @@ -13,17 +13,15 @@ namespace Microsoft.Azure.Management.ContainerRegistry using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; using System.Threading; /// - /// Extension methods for ScopeMapsOperations. + /// Extension methods for TasksOperations. /// - public static partial class ScopeMapsOperationsExtensions + public static partial class TasksOperationsExtensions { /// - /// Gets the properties of the specified scope map. + /// Lists all the tasks for a specified container registry. /// /// /// The operations group for this extension method. @@ -34,16 +32,13 @@ public static partial class ScopeMapsOperationsExtensions /// /// The name of the container registry. /// - /// - /// The name of the scope map. - /// - public static ScopeMap Get(this IScopeMapsOperations operations, string resourceGroupName, string registryName, string scopeMapName) + public static IPage List(this ITasksOperations operations, string resourceGroupName, string registryName) { - return operations.GetAsync(resourceGroupName, registryName, scopeMapName).GetAwaiter().GetResult(); + return operations.ListAsync(resourceGroupName, registryName).GetAwaiter().GetResult(); } /// - /// Gets the properties of the specified scope map. + /// Lists all the tasks for a specified container registry. /// /// /// The operations group for this extension method. @@ -54,22 +49,19 @@ public static ScopeMap Get(this IScopeMapsOperations operations, string resource /// /// The name of the container registry. /// - /// - /// The name of the scope map. - /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this IScopeMapsOperations operations, string resourceGroupName, string registryName, string scopeMapName, CancellationToken cancellationToken = default(CancellationToken)) + public static async System.Threading.Tasks.Task> ListAsync(this ITasksOperations operations, string resourceGroupName, string registryName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, registryName, scopeMapName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, registryName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Creates a scope map for a container registry with the specified parameters. + /// Get the properties of a specified task. /// /// /// The operations group for this extension method. @@ -80,24 +72,42 @@ public static ScopeMap Get(this IScopeMapsOperations operations, string resource /// /// The name of the container registry. /// - /// - /// The name of the scope map. + /// + /// 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 list of scoped permissions for registry artifacts. - /// E.g. repositories/repository-name/pull, - /// repositories/repository-name/delete + /// + /// The name of the container registry task. /// - /// - /// The user friendly description of the scope map. + /// + /// The cancellation token. /// - public static ScopeMap Create(this IScopeMapsOperations operations, string resourceGroupName, string registryName, string scopeMapName, IList actions, string description = default(string)) + public static async System.Threading.Tasks.Task GetAsync(this ITasksOperations operations, string resourceGroupName, string registryName, string taskName, CancellationToken cancellationToken = default(CancellationToken)) { - return operations.CreateAsync(resourceGroupName, registryName, scopeMapName, actions, description).GetAwaiter().GetResult(); + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, registryName, taskName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Creates a scope map for a container registry with the specified parameters. + /// Creates a task for a container registry with the specified parameters. /// /// /// The operations group for this extension method. @@ -108,30 +118,48 @@ public static ScopeMap Get(this IScopeMapsOperations operations, string resource /// /// The name of the container registry. /// - /// - /// The name of the scope map. + /// + /// The name of the container registry task. + /// + /// + /// The parameters for creating a task. /// - /// - /// The list of scoped permissions for registry artifacts. - /// E.g. repositories/repository-name/pull, - /// repositories/repository-name/delete + 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 user friendly description of the scope map. + /// + /// The parameters for creating a task. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateAsync(this IScopeMapsOperations operations, string resourceGroupName, string registryName, string scopeMapName, IList actions, string description = default(string), CancellationToken cancellationToken = default(CancellationToken)) + 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, scopeMapName, actions, description, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, registryName, taskName, taskCreateParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Deletes a scope map from a container registry. + /// Deletes a specified task. /// /// /// The operations group for this extension method. @@ -142,16 +170,16 @@ public static ScopeMap Get(this IScopeMapsOperations operations, string resource /// /// The name of the container registry. /// - /// - /// The name of the scope map. + /// + /// The name of the container registry task. /// - public static void Delete(this IScopeMapsOperations operations, string resourceGroupName, string registryName, string scopeMapName) + public static void Delete(this ITasksOperations operations, string resourceGroupName, string registryName, string taskName) { - operations.DeleteAsync(resourceGroupName, registryName, scopeMapName).GetAwaiter().GetResult(); + operations.DeleteAsync(resourceGroupName, registryName, taskName).GetAwaiter().GetResult(); } /// - /// Deletes a scope map from a container registry. + /// Deletes a specified task. /// /// /// The operations group for this extension method. @@ -162,19 +190,19 @@ public static void Delete(this IScopeMapsOperations operations, string resourceG /// /// The name of the container registry. /// - /// - /// The name of the scope map. + /// + /// The name of the container registry task. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteAsync(this IScopeMapsOperations operations, string resourceGroupName, string registryName, string scopeMapName, CancellationToken cancellationToken = default(CancellationToken)) + 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, scopeMapName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, registryName, taskName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Updates a scope map with the specified parameters. + /// Updates a task with the specified parameters. /// /// /// The operations group for this extension method. @@ -185,24 +213,19 @@ public static void Delete(this IScopeMapsOperations operations, string resourceG /// /// The name of the container registry. /// - /// - /// The name of the scope map. - /// - /// - /// The user friendly description of the scope map. + /// + /// The name of the container registry task. /// - /// - /// The list of scope permissions for registry artifacts. - /// E.g. repositories/repository-name/pull, - /// repositories/repository-name/delete + /// + /// The parameters for updating a task. /// - public static ScopeMap Update(this IScopeMapsOperations operations, string resourceGroupName, string registryName, string scopeMapName, string description = default(string), IList actions = default(IList)) + public static Task Update(this ITasksOperations operations, string resourceGroupName, string registryName, string taskName, TaskUpdateParameters taskUpdateParameters) { - return operations.UpdateAsync(resourceGroupName, registryName, scopeMapName, description, actions).GetAwaiter().GetResult(); + return operations.UpdateAsync(resourceGroupName, registryName, taskName, taskUpdateParameters).GetAwaiter().GetResult(); } /// - /// Updates a scope map with the specified parameters. + /// Updates a task with the specified parameters. /// /// /// The operations group for this extension method. @@ -213,30 +236,25 @@ public static void Delete(this IScopeMapsOperations operations, string resourceG /// /// The name of the container registry. /// - /// - /// The name of the scope map. + /// + /// The name of the container registry task. /// - /// - /// The user friendly description of the scope map. - /// - /// - /// The list of scope permissions for registry artifacts. - /// E.g. repositories/repository-name/pull, - /// repositories/repository-name/delete + /// + /// The parameters for updating a task. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task UpdateAsync(this IScopeMapsOperations operations, string resourceGroupName, string registryName, string scopeMapName, string description = default(string), IList actions = default(IList), CancellationToken cancellationToken = default(CancellationToken)) + 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, scopeMapName, description, actions, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, registryName, taskName, taskUpdateParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Lists all the scope maps for the specified container registry. + /// Returns a task with extended information that includes all secrets. /// /// /// The operations group for this extension method. @@ -247,13 +265,16 @@ public static void Delete(this IScopeMapsOperations operations, string resourceG /// /// The name of the container registry. /// - public static IPage List(this IScopeMapsOperations operations, string resourceGroupName, string registryName) + /// + /// The name of the container registry task. + /// + public static Task GetDetails(this ITasksOperations operations, string resourceGroupName, string registryName, string taskName) { - return operations.ListAsync(resourceGroupName, registryName).GetAwaiter().GetResult(); + return operations.GetDetailsAsync(resourceGroupName, registryName, taskName).GetAwaiter().GetResult(); } /// - /// Lists all the scope maps for the specified container registry. + /// Returns a task with extended information that includes all secrets. /// /// /// The operations group for this extension method. @@ -264,19 +285,22 @@ public static IPage List(this IScopeMapsOperations operations, string /// /// The name of the container registry. /// + /// + /// The name of the container registry task. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListAsync(this IScopeMapsOperations operations, string resourceGroupName, string registryName, CancellationToken cancellationToken = default(CancellationToken)) + 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.ListWithHttpMessagesAsync(resourceGroupName, registryName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetDetailsWithHttpMessagesAsync(resourceGroupName, registryName, taskName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Creates a scope map for a container registry with the specified parameters. + /// Creates a task for a container registry with the specified parameters. /// /// /// The operations group for this extension method. @@ -287,24 +311,19 @@ public static IPage List(this IScopeMapsOperations operations, string /// /// The name of the container registry. /// - /// - /// The name of the scope map. - /// - /// - /// The list of scoped permissions for registry artifacts. - /// E.g. repositories/repository-name/pull, - /// repositories/repository-name/delete + /// + /// The name of the container registry task. /// - /// - /// The user friendly description of the scope map. + /// + /// The parameters for creating a task. /// - public static ScopeMap BeginCreate(this IScopeMapsOperations operations, string resourceGroupName, string registryName, string scopeMapName, IList actions, string description = default(string)) + public static Task BeginCreate(this ITasksOperations operations, string resourceGroupName, string registryName, string taskName, Task taskCreateParameters) { - return operations.BeginCreateAsync(resourceGroupName, registryName, scopeMapName, actions, description).GetAwaiter().GetResult(); + return operations.BeginCreateAsync(resourceGroupName, registryName, taskName, taskCreateParameters).GetAwaiter().GetResult(); } /// - /// Creates a scope map for a container registry with the specified parameters. + /// Creates a task for a container registry with the specified parameters. /// /// /// The operations group for this extension method. @@ -315,30 +334,25 @@ public static IPage List(this IScopeMapsOperations operations, string /// /// The name of the container registry. /// - /// - /// The name of the scope map. + /// + /// The name of the container registry task. /// - /// - /// The list of scoped permissions for registry artifacts. - /// E.g. repositories/repository-name/pull, - /// repositories/repository-name/delete - /// - /// - /// The user friendly description of the scope map. + /// + /// The parameters for creating a task. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginCreateAsync(this IScopeMapsOperations operations, string resourceGroupName, string registryName, string scopeMapName, IList actions, string description = default(string), CancellationToken cancellationToken = default(CancellationToken)) + 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, scopeMapName, actions, description, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateWithHttpMessagesAsync(resourceGroupName, registryName, taskName, taskCreateParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Deletes a scope map from a container registry. + /// Deletes a specified task. /// /// /// The operations group for this extension method. @@ -349,16 +363,16 @@ public static IPage List(this IScopeMapsOperations operations, string /// /// The name of the container registry. /// - /// - /// The name of the scope map. + /// + /// The name of the container registry task. /// - public static void BeginDelete(this IScopeMapsOperations operations, string resourceGroupName, string registryName, string scopeMapName) + public static void BeginDelete(this ITasksOperations operations, string resourceGroupName, string registryName, string taskName) { - operations.BeginDeleteAsync(resourceGroupName, registryName, scopeMapName).GetAwaiter().GetResult(); + operations.BeginDeleteAsync(resourceGroupName, registryName, taskName).GetAwaiter().GetResult(); } /// - /// Deletes a scope map from a container registry. + /// Deletes a specified task. /// /// /// The operations group for this extension method. @@ -369,19 +383,19 @@ public static void BeginDelete(this IScopeMapsOperations operations, string reso /// /// The name of the container registry. /// - /// - /// The name of the scope map. + /// + /// The name of the container registry task. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginDeleteAsync(this IScopeMapsOperations operations, string resourceGroupName, string registryName, string scopeMapName, CancellationToken cancellationToken = default(CancellationToken)) + 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, scopeMapName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, registryName, taskName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Updates a scope map with the specified parameters. + /// Updates a task with the specified parameters. /// /// /// The operations group for this extension method. @@ -392,24 +406,19 @@ public static void BeginDelete(this IScopeMapsOperations operations, string reso /// /// The name of the container registry. /// - /// - /// The name of the scope map. - /// - /// - /// The user friendly description of the scope map. + /// + /// The name of the container registry task. /// - /// - /// The list of scope permissions for registry artifacts. - /// E.g. repositories/repository-name/pull, - /// repositories/repository-name/delete + /// + /// The parameters for updating a task. /// - public static ScopeMap BeginUpdate(this IScopeMapsOperations operations, string resourceGroupName, string registryName, string scopeMapName, string description = default(string), IList actions = default(IList)) + public static Task BeginUpdate(this ITasksOperations operations, string resourceGroupName, string registryName, string taskName, TaskUpdateParameters taskUpdateParameters) { - return operations.BeginUpdateAsync(resourceGroupName, registryName, scopeMapName, description, actions).GetAwaiter().GetResult(); + return operations.BeginUpdateAsync(resourceGroupName, registryName, taskName, taskUpdateParameters).GetAwaiter().GetResult(); } /// - /// Updates a scope map with the specified parameters. + /// Updates a task with the specified parameters. /// /// /// The operations group for this extension method. @@ -420,30 +429,25 @@ public static void BeginDelete(this IScopeMapsOperations operations, string reso /// /// The name of the container registry. /// - /// - /// The name of the scope map. - /// - /// - /// The user friendly description of the scope map. + /// + /// The name of the container registry task. /// - /// - /// The list of scope permissions for registry artifacts. - /// E.g. repositories/repository-name/pull, - /// repositories/repository-name/delete + /// + /// The parameters for updating a task. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginUpdateAsync(this IScopeMapsOperations operations, string resourceGroupName, string registryName, string scopeMapName, string description = default(string), IList actions = default(IList), CancellationToken cancellationToken = default(CancellationToken)) + 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, scopeMapName, description, actions, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, registryName, taskName, taskUpdateParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Lists all the scope maps for the specified container registry. + /// Lists all the tasks for a specified container registry. /// /// /// The operations group for this extension method. @@ -451,13 +455,13 @@ public static void BeginDelete(this IScopeMapsOperations operations, string reso /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListNext(this IScopeMapsOperations operations, string nextPageLink) + public static IPage ListNext(this ITasksOperations operations, string nextPageLink) { return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// - /// Lists all the scope maps for the specified container registry. + /// Lists all the tasks for a specified container registry. /// /// /// The operations group for this extension method. @@ -468,7 +472,7 @@ public static IPage ListNext(this IScopeMapsOperations operations, str /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListNextAsync(this IScopeMapsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + 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)) { diff --git a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/WebhooksOperations.cs b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/WebhooksOperations.cs index 7560cc1e0d124..e9996d857e256 100644 --- a/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/WebhooksOperations.cs +++ b/src/SDKs/ContainerRegistry/Management.ContainerRegistry/Generated/WebhooksOperations.cs @@ -137,7 +137,7 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "webhookName", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2017-10-01"; + string apiVersion = "2019-05-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -436,7 +436,7 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2017-10-01"; + string apiVersion = "2019-05-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -674,7 +674,7 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "webhookName", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2017-10-01"; + string apiVersion = "2019-05-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -914,7 +914,7 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "webhookName", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2017-10-01"; + string apiVersion = "2019-05-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1154,7 +1154,7 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "webhookName", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2017-10-01"; + string apiVersion = "2019-05-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1405,7 +1405,7 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) { webhookCreateParameters.Validate(); } - string apiVersion = "2017-10-01"; + string apiVersion = "2019-05-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1667,7 +1667,7 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) throw new ValidationException(ValidationRules.Pattern, "webhookName", "^[a-zA-Z0-9]*$"); } } - string apiVersion = "2017-10-01"; + string apiVersion = "2019-05-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1896,7 +1896,7 @@ internal WebhooksOperations(ContainerRegistryManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "webhookUpdateParameters"); } - string apiVersion = "2017-10-01"; + string apiVersion = "2019-05-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null;