From 47e8f9592f9a3dfe905afd19c2c3bafbc9df3ba0 Mon Sep 17 00:00:00 2001 From: adxsdknet Date: Tue, 30 Apr 2019 07:08:19 +0000 Subject: [PATCH] .NET SDK Resource Provider:'DataMigration' REST Spec PR 'https://github.com/Azure/azure-rest-api-specs/pull/5801' REST Spec PR Author 'huang91shu' REST Spec PR Last commit --- .../Generated/DataMigrationServiceClient.cs | 8 + .../Generated/IDataMigrationServiceClient.cs | 5 + .../Generated/IServiceTasksOperations.cs | 268 +++ .../Models/CheckOCIDriverTaskInput.cs | 53 + .../Models/CheckOCIDriverTaskOutput.cs | 62 + .../Models/CheckOCIDriverTaskProperties.cs | 73 + .../Models/ConnectToSourceNonSqlTaskOutput.cs | 2 +- .../ConnectToSourceOracleSyncTaskInput.cs | 72 + .../ConnectToSourceOracleSyncTaskOutput.cs | 82 + ...ConnectToSourceOracleSyncTaskProperties.cs | 88 + ...OracleAzureDbForPostgreSqlSyncTaskInput.cs | 74 + ...racleAzureDbForPostgreSqlSyncTaskOutput.cs | 83 + ...eAzureDbForPostgreSqlSyncTaskProperties.cs | 90 + .../Models/InstallOCIDriverTaskInput.cs | 52 + .../Models/InstallOCIDriverTaskOutput.cs | 53 + .../Models/InstallOCIDriverTaskProperties.cs | 73 + ...eAzureDbForPostgreSqlSyncTaskProperties.cs | 89 + ...racleAzureDbPostgreSqlSyncDatabaseInput.cs | 112 ++ ...ateOracleAzureDbPostgreSqlSyncTaskInput.cs | 105 ++ ...teOracleAzureDbPostgreSqlSyncTaskOutput.cs | 54 + ...DbPostgreSqlSyncTaskOutputDatabaseError.cs | 63 + ...DbPostgreSqlSyncTaskOutputDatabaseLevel.cs | 177 ++ ...cleAzureDbPostgreSqlSyncTaskOutputError.cs | 53 + ...bPostgreSqlSyncTaskOutputMigrationLevel.cs | 93 + ...ureDbPostgreSqlSyncTaskOutputTableLevel.cs | 157 ++ .../Generated/Models/OracleConnectionInfo.cs | 69 + .../Generated/Models/OracleOCIDriverInfo.cs | 102 ++ .../Generated/Models/ServerProperties.cs | 2 +- .../Models/UploadOCIDriverTaskInput.cs | 65 + .../Models/UploadOCIDriverTaskOutput.cs | 63 + .../Models/UploadOCIDriverTaskProperties.cs | 86 + ...eAzureDbForPostgreSqlSyncTaskProperties.cs | 87 + ...teOracleAzureDbPostgreSqlSyncTaskOutput.cs | 57 + .../SdkInfo_DataMigrationManagementClient.cs | 12 +- .../Generated/ServiceTasksOperations.cs | 1503 +++++++++++++++++ .../ServiceTasksOperationsExtensions.cs | 438 +++++ 36 files changed, 4512 insertions(+), 13 deletions(-) create mode 100644 src/SDKs/DataMigration/Management.DataMigration/Generated/IServiceTasksOperations.cs create mode 100644 src/SDKs/DataMigration/Management.DataMigration/Generated/Models/CheckOCIDriverTaskInput.cs create mode 100644 src/SDKs/DataMigration/Management.DataMigration/Generated/Models/CheckOCIDriverTaskOutput.cs create mode 100644 src/SDKs/DataMigration/Management.DataMigration/Generated/Models/CheckOCIDriverTaskProperties.cs create mode 100644 src/SDKs/DataMigration/Management.DataMigration/Generated/Models/ConnectToSourceOracleSyncTaskInput.cs create mode 100644 src/SDKs/DataMigration/Management.DataMigration/Generated/Models/ConnectToSourceOracleSyncTaskOutput.cs create mode 100644 src/SDKs/DataMigration/Management.DataMigration/Generated/Models/ConnectToSourceOracleSyncTaskProperties.cs create mode 100644 src/SDKs/DataMigration/Management.DataMigration/Generated/Models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput.cs create mode 100644 src/SDKs/DataMigration/Management.DataMigration/Generated/Models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput.cs create mode 100644 src/SDKs/DataMigration/Management.DataMigration/Generated/Models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties.cs create mode 100644 src/SDKs/DataMigration/Management.DataMigration/Generated/Models/InstallOCIDriverTaskInput.cs create mode 100644 src/SDKs/DataMigration/Management.DataMigration/Generated/Models/InstallOCIDriverTaskOutput.cs create mode 100644 src/SDKs/DataMigration/Management.DataMigration/Generated/Models/InstallOCIDriverTaskProperties.cs create mode 100644 src/SDKs/DataMigration/Management.DataMigration/Generated/Models/MigrateOracleAzureDbForPostgreSqlSyncTaskProperties.cs create mode 100644 src/SDKs/DataMigration/Management.DataMigration/Generated/Models/MigrateOracleAzureDbPostgreSqlSyncDatabaseInput.cs create mode 100644 src/SDKs/DataMigration/Management.DataMigration/Generated/Models/MigrateOracleAzureDbPostgreSqlSyncTaskInput.cs create mode 100644 src/SDKs/DataMigration/Management.DataMigration/Generated/Models/MigrateOracleAzureDbPostgreSqlSyncTaskOutput.cs create mode 100644 src/SDKs/DataMigration/Management.DataMigration/Generated/Models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError.cs create mode 100644 src/SDKs/DataMigration/Management.DataMigration/Generated/Models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.cs create mode 100644 src/SDKs/DataMigration/Management.DataMigration/Generated/Models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputError.cs create mode 100644 src/SDKs/DataMigration/Management.DataMigration/Generated/Models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel.cs create mode 100644 src/SDKs/DataMigration/Management.DataMigration/Generated/Models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.cs create mode 100644 src/SDKs/DataMigration/Management.DataMigration/Generated/Models/OracleConnectionInfo.cs create mode 100644 src/SDKs/DataMigration/Management.DataMigration/Generated/Models/OracleOCIDriverInfo.cs create mode 100644 src/SDKs/DataMigration/Management.DataMigration/Generated/Models/UploadOCIDriverTaskInput.cs create mode 100644 src/SDKs/DataMigration/Management.DataMigration/Generated/Models/UploadOCIDriverTaskOutput.cs create mode 100644 src/SDKs/DataMigration/Management.DataMigration/Generated/Models/UploadOCIDriverTaskProperties.cs create mode 100644 src/SDKs/DataMigration/Management.DataMigration/Generated/Models/ValidateOracleAzureDbForPostgreSqlSyncTaskProperties.cs create mode 100644 src/SDKs/DataMigration/Management.DataMigration/Generated/Models/ValidateOracleAzureDbPostgreSqlSyncTaskOutput.cs create mode 100644 src/SDKs/DataMigration/Management.DataMigration/Generated/ServiceTasksOperations.cs create mode 100644 src/SDKs/DataMigration/Management.DataMigration/Generated/ServiceTasksOperationsExtensions.cs diff --git a/src/SDKs/DataMigration/Management.DataMigration/Generated/DataMigrationServiceClient.cs b/src/SDKs/DataMigration/Management.DataMigration/Generated/DataMigrationServiceClient.cs index 9ffdbe9b22a67..7f7a66d375593 100644 --- a/src/SDKs/DataMigration/Management.DataMigration/Generated/DataMigrationServiceClient.cs +++ b/src/SDKs/DataMigration/Management.DataMigration/Generated/DataMigrationServiceClient.cs @@ -89,6 +89,11 @@ public partial class DataMigrationServiceClient : ServiceClient public virtual ITasksOperations Tasks { get; private set; } + /// + /// Gets the IServiceTasksOperations. + /// + public virtual IServiceTasksOperations ServiceTasks { get; private set; } + /// /// Gets the IProjectsOperations. /// @@ -353,6 +358,7 @@ private void Initialize() ResourceSkus = new ResourceSkusOperations(this); Services = new ServicesOperations(this); Tasks = new TasksOperations(this); + ServiceTasks = new ServiceTasksOperations(this); Projects = new ProjectsOperations(this); Usages = new UsagesOperations(this); Operations = new Operations(this); @@ -392,6 +398,8 @@ private void Initialize() DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("commandType")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("type")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("resultType")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("resultType")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("resultType")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("resultType")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("resultType")); diff --git a/src/SDKs/DataMigration/Management.DataMigration/Generated/IDataMigrationServiceClient.cs b/src/SDKs/DataMigration/Management.DataMigration/Generated/IDataMigrationServiceClient.cs index fb363fd03523b..a9f68c7a86fba 100644 --- a/src/SDKs/DataMigration/Management.DataMigration/Generated/IDataMigrationServiceClient.cs +++ b/src/SDKs/DataMigration/Management.DataMigration/Generated/IDataMigrationServiceClient.cs @@ -84,6 +84,11 @@ public partial interface IDataMigrationServiceClient : System.IDisposable /// ITasksOperations Tasks { get; } + /// + /// Gets the IServiceTasksOperations. + /// + IServiceTasksOperations ServiceTasks { get; } + /// /// Gets the IProjectsOperations. /// diff --git a/src/SDKs/DataMigration/Management.DataMigration/Generated/IServiceTasksOperations.cs b/src/SDKs/DataMigration/Management.DataMigration/Generated/IServiceTasksOperations.cs new file mode 100644 index 0000000000000..afe2170dec4b5 --- /dev/null +++ b/src/SDKs/DataMigration/Management.DataMigration/Generated/IServiceTasksOperations.cs @@ -0,0 +1,268 @@ +// +// 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.DataMigration +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ServiceTasksOperations operations. + /// + public partial interface IServiceTasksOperations + { + /// + /// Get service level tasks for a service + /// + /// + /// The services resource is the top-level resource that represents the + /// Database Migration Service. This method returns a list of service + /// level tasks owned by a service resource. Some tasks may have a + /// status of Unknown, which indicates that an error occurred while + /// querying the status of that task. + /// + /// + /// Name of the resource group + /// + /// + /// Name of the service + /// + /// + /// Filter tasks by task type + /// + /// + /// 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 + /// + Task>> ListWithHttpMessagesAsync(string groupName, string serviceName, string taskType = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create or update service task + /// + /// + /// The service tasks resource is a nested, proxy-only resource + /// representing work performed by a DMS instance. The PUT method + /// creates a new service task or updates an existing one, although + /// since service tasks have no mutable custom properties, there is + /// little reason to update an existing one. + /// + /// + /// Information about the task + /// + /// + /// Name of the resource group + /// + /// + /// Name of the service + /// + /// + /// Name of the Task + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateWithHttpMessagesAsync(ProjectTask parameters, string groupName, string serviceName, string taskName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get service task information + /// + /// + /// The service tasks resource is a nested, proxy-only resource + /// representing work performed by a DMS instance. The GET method + /// retrieves information about a service task. + /// + /// + /// Name of the resource group + /// + /// + /// Name of the service + /// + /// + /// Name of the Task + /// + /// + /// Expand the response + /// + /// + /// 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 + /// + Task> GetWithHttpMessagesAsync(string groupName, string serviceName, string taskName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete service task + /// + /// + /// The service tasks resource is a nested, proxy-only resource + /// representing work performed by a DMS instance. The DELETE method + /// deletes a service task, canceling it first if it's running. + /// + /// + /// Name of the resource group + /// + /// + /// Name of the service + /// + /// + /// Name of the Task + /// + /// + /// Delete the resource even if it contains running tasks + /// + /// + /// 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 + /// + Task DeleteWithHttpMessagesAsync(string groupName, string serviceName, string taskName, bool? deleteRunningTasks = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create or update service task + /// + /// + /// The service tasks resource is a nested, proxy-only resource + /// representing work performed by a DMS instance. The PATCH method + /// updates an existing service task, but since service tasks have no + /// mutable custom properties, there is little reason to do so. + /// + /// + /// Information about the task + /// + /// + /// Name of the resource group + /// + /// + /// Name of the service + /// + /// + /// Name of the Task + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateWithHttpMessagesAsync(ProjectTask parameters, string groupName, string serviceName, string taskName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Cancel a service task + /// + /// + /// The service tasks resource is a nested, proxy-only resource + /// representing work performed by a DMS instance. This method cancels + /// a service task if it's currently queued or running. + /// + /// + /// Name of the resource group + /// + /// + /// Name of the service + /// + /// + /// Name of the Task + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CancelWithHttpMessagesAsync(string groupName, string serviceName, string taskName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get service level tasks for a service + /// + /// + /// The services resource is the top-level resource that represents the + /// Database Migration Service. This method returns a list of service + /// level tasks owned by a service resource. Some tasks may have a + /// status of Unknown, which indicates that an error occurred while + /// querying the status of that task. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/CheckOCIDriverTaskInput.cs b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/CheckOCIDriverTaskInput.cs new file mode 100644 index 0000000000000..f71048c2ab23f --- /dev/null +++ b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/CheckOCIDriverTaskInput.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.DataMigration.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Input for the service task to check for OCI drivers. + /// + public partial class CheckOCIDriverTaskInput + { + /// + /// Initializes a new instance of the CheckOCIDriverTaskInput class. + /// + public CheckOCIDriverTaskInput() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CheckOCIDriverTaskInput class. + /// + /// Version of the source server to check + /// against. Optional. + public CheckOCIDriverTaskInput(string serverVersion = default(string)) + { + ServerVersion = serverVersion; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets version of the source server to check against. + /// Optional. + /// + [JsonProperty(PropertyName = "serverVersion")] + public string ServerVersion { get; set; } + + } +} diff --git a/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/CheckOCIDriverTaskOutput.cs b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/CheckOCIDriverTaskOutput.cs new file mode 100644 index 0000000000000..84ee6b16301c8 --- /dev/null +++ b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/CheckOCIDriverTaskOutput.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.DataMigration.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Output for the service task to check for OCI drivers. + /// + public partial class CheckOCIDriverTaskOutput + { + /// + /// Initializes a new instance of the CheckOCIDriverTaskOutput class. + /// + public CheckOCIDriverTaskOutput() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CheckOCIDriverTaskOutput class. + /// + /// Information about the installed + /// driver if found and valid. + /// Validation errors + public CheckOCIDriverTaskOutput(IDictionary> installedDriver = default(IDictionary>), IList validationErrors = default(IList)) + { + InstalledDriver = installedDriver; + ValidationErrors = validationErrors; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets information about the installed driver if found and valid. + /// + [JsonProperty(PropertyName = "installedDriver")] + public IDictionary> InstalledDriver { get; private set; } + + /// + /// Gets validation errors + /// + [JsonProperty(PropertyName = "validationErrors")] + public IList ValidationErrors { get; private set; } + + } +} diff --git a/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/CheckOCIDriverTaskProperties.cs b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/CheckOCIDriverTaskProperties.cs new file mode 100644 index 0000000000000..f65113c7e1d62 --- /dev/null +++ b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/CheckOCIDriverTaskProperties.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.DataMigration.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Properties for the task that checks for OCI drivers. + /// + [Newtonsoft.Json.JsonObject("Service.Check.OCI")] + public partial class CheckOCIDriverTaskProperties : ProjectTaskProperties + { + /// + /// Initializes a new instance of the CheckOCIDriverTaskProperties + /// class. + /// + public CheckOCIDriverTaskProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CheckOCIDriverTaskProperties + /// class. + /// + /// Array of errors. This is ignored if + /// submitted. + /// The state of the task. This is ignored if + /// submitted. Possible values include: 'Unknown', 'Queued', 'Running', + /// 'Canceled', 'Succeeded', 'Failed', 'FailedInputValidation', + /// 'Faulted' + /// Array of command properties. + /// Key value pairs of client data to attach + /// meta data information to task + /// Task output. This is ignored if + /// submitted. + public CheckOCIDriverTaskProperties(IList errors = default(IList), string state = default(string), IList commands = default(IList), IDictionary clientData = default(IDictionary), CheckOCIDriverTaskInput input = default(CheckOCIDriverTaskInput), IList output = default(IList)) + : base(errors, state, commands, clientData) + { + Input = input; + Output = output; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "input")] + public CheckOCIDriverTaskInput Input { get; set; } + + /// + /// Gets task output. This is ignored if submitted. + /// + [JsonProperty(PropertyName = "output")] + public IList Output { get; private set; } + + } +} diff --git a/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/ConnectToSourceNonSqlTaskOutput.cs b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/ConnectToSourceNonSqlTaskOutput.cs index bf3595f317a57..dd8e13f7e43fd 100644 --- a/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/ConnectToSourceNonSqlTaskOutput.cs +++ b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/ConnectToSourceNonSqlTaskOutput.cs @@ -16,7 +16,7 @@ namespace Microsoft.Azure.Management.DataMigration.Models using System.Linq; /// - /// Output for connect to Oracle, MySQL type source + /// Output for connect to MySQL type source /// public partial class ConnectToSourceNonSqlTaskOutput { diff --git a/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/ConnectToSourceOracleSyncTaskInput.cs b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/ConnectToSourceOracleSyncTaskInput.cs new file mode 100644 index 0000000000000..b05d5db765082 --- /dev/null +++ b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/ConnectToSourceOracleSyncTaskInput.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.DataMigration.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Input for the task that validates Oracle database connection + /// + public partial class ConnectToSourceOracleSyncTaskInput + { + /// + /// Initializes a new instance of the + /// ConnectToSourceOracleSyncTaskInput class. + /// + public ConnectToSourceOracleSyncTaskInput() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ConnectToSourceOracleSyncTaskInput class. + /// + /// Information for connecting to + /// Oracle source + public ConnectToSourceOracleSyncTaskInput(OracleConnectionInfo sourceConnectionInfo) + { + SourceConnectionInfo = sourceConnectionInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets information for connecting to Oracle source + /// + [JsonProperty(PropertyName = "sourceConnectionInfo")] + public OracleConnectionInfo SourceConnectionInfo { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (SourceConnectionInfo == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "SourceConnectionInfo"); + } + if (SourceConnectionInfo != null) + { + SourceConnectionInfo.Validate(); + } + } + } +} diff --git a/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/ConnectToSourceOracleSyncTaskOutput.cs b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/ConnectToSourceOracleSyncTaskOutput.cs new file mode 100644 index 0000000000000..87b65fda58062 --- /dev/null +++ b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/ConnectToSourceOracleSyncTaskOutput.cs @@ -0,0 +1,82 @@ +// +// 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.DataMigration.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Output for the task that validates Oracle database connection + /// + public partial class ConnectToSourceOracleSyncTaskOutput + { + /// + /// Initializes a new instance of the + /// ConnectToSourceOracleSyncTaskOutput class. + /// + public ConnectToSourceOracleSyncTaskOutput() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ConnectToSourceOracleSyncTaskOutput class. + /// + /// Version of the source + /// server + /// List of schemas on source server + /// Source server brand + /// version + /// Validation errors associated with + /// the task + public ConnectToSourceOracleSyncTaskOutput(string sourceServerVersion = default(string), IList databases = default(IList), string sourceServerBrandVersion = default(string), IList validationErrors = default(IList)) + { + SourceServerVersion = sourceServerVersion; + Databases = databases; + SourceServerBrandVersion = sourceServerBrandVersion; + ValidationErrors = validationErrors; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets version of the source server + /// + [JsonProperty(PropertyName = "sourceServerVersion")] + public string SourceServerVersion { get; private set; } + + /// + /// Gets list of schemas on source server + /// + [JsonProperty(PropertyName = "databases")] + public IList Databases { get; private set; } + + /// + /// Gets source server brand version + /// + [JsonProperty(PropertyName = "sourceServerBrandVersion")] + public string SourceServerBrandVersion { get; private set; } + + /// + /// Gets validation errors associated with the task + /// + [JsonProperty(PropertyName = "validationErrors")] + public IList ValidationErrors { get; private set; } + + } +} diff --git a/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/ConnectToSourceOracleSyncTaskProperties.cs b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/ConnectToSourceOracleSyncTaskProperties.cs new file mode 100644 index 0000000000000..84e4507769f07 --- /dev/null +++ b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/ConnectToSourceOracleSyncTaskProperties.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.DataMigration.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Properties for the task that validates Oracle database connection + /// + [Newtonsoft.Json.JsonObject("ConnectToSource.Oracle.Sync")] + public partial class ConnectToSourceOracleSyncTaskProperties : ProjectTaskProperties + { + /// + /// Initializes a new instance of the + /// ConnectToSourceOracleSyncTaskProperties class. + /// + public ConnectToSourceOracleSyncTaskProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ConnectToSourceOracleSyncTaskProperties class. + /// + /// Array of errors. This is ignored if + /// submitted. + /// The state of the task. This is ignored if + /// submitted. Possible values include: 'Unknown', 'Queued', 'Running', + /// 'Canceled', 'Succeeded', 'Failed', 'FailedInputValidation', + /// 'Faulted' + /// Array of command properties. + /// Key value pairs of client data to attach + /// meta data information to task + /// Task input + /// Task output. This is ignored if + /// submitted. + public ConnectToSourceOracleSyncTaskProperties(IList errors = default(IList), string state = default(string), IList commands = default(IList), IDictionary clientData = default(IDictionary), ConnectToSourceOracleSyncTaskInput input = default(ConnectToSourceOracleSyncTaskInput), IList output = default(IList)) + : base(errors, state, commands, clientData) + { + Input = input; + Output = output; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets task input + /// + [JsonProperty(PropertyName = "input")] + public ConnectToSourceOracleSyncTaskInput Input { get; set; } + + /// + /// Gets task output. This is ignored if submitted. + /// + [JsonProperty(PropertyName = "output")] + public IList Output { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Input != null) + { + Input.Validate(); + } + } + } +} diff --git a/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput.cs b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput.cs new file mode 100644 index 0000000000000..8f157f2a748df --- /dev/null +++ b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput.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.DataMigration.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Input for the task that validates connection to Azure Database for + /// PostgreSQL and target server requirements for Oracle source. + /// + public partial class ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput + { + /// + /// Initializes a new instance of the + /// ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput class. + /// + public ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput class. + /// + /// Connection information for + /// target Azure Database for PostgreSQL server + public ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput(PostgreSqlConnectionInfo targetConnectionInfo) + { + TargetConnectionInfo = targetConnectionInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets connection information for target Azure Database for + /// PostgreSQL server + /// + [JsonProperty(PropertyName = "targetConnectionInfo")] + public PostgreSqlConnectionInfo TargetConnectionInfo { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (TargetConnectionInfo == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "TargetConnectionInfo"); + } + if (TargetConnectionInfo != null) + { + TargetConnectionInfo.Validate(); + } + } + } +} diff --git a/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput.cs b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput.cs new file mode 100644 index 0000000000000..069dac0c67398 --- /dev/null +++ b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput.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.DataMigration.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Output for the task that validates connection to Azure Database for + /// PostgreSQL and target server requirements for Oracle source. + /// + public partial class ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput + { + /// + /// Initializes a new instance of the + /// ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput class. + /// + public ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput class. + /// + /// Version of the target + /// server + /// List of databases on target server + /// Target server brand + /// version + /// Validation errors associated with + /// the task + public ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput(string targetServerVersion = default(string), IList databases = default(IList), string targetServerBrandVersion = default(string), IList validationErrors = default(IList)) + { + TargetServerVersion = targetServerVersion; + Databases = databases; + TargetServerBrandVersion = targetServerBrandVersion; + ValidationErrors = validationErrors; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets version of the target server + /// + [JsonProperty(PropertyName = "targetServerVersion")] + public string TargetServerVersion { get; private set; } + + /// + /// Gets list of databases on target server + /// + [JsonProperty(PropertyName = "databases")] + public IList Databases { get; private set; } + + /// + /// Gets target server brand version + /// + [JsonProperty(PropertyName = "targetServerBrandVersion")] + public string TargetServerBrandVersion { get; private set; } + + /// + /// Gets validation errors associated with the task + /// + [JsonProperty(PropertyName = "validationErrors")] + public IList ValidationErrors { get; private set; } + + } +} diff --git a/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties.cs b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties.cs new file mode 100644 index 0000000000000..21ae7b82cfbfb --- /dev/null +++ b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties.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.DataMigration.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Properties for the task that validates connection to Azure Database For + /// PostgreSQL server and target server requirements for online migration + /// for Oracle source. + /// + [Newtonsoft.Json.JsonObject("ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync")] + public partial class ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties : ProjectTaskProperties + { + /// + /// Initializes a new instance of the + /// ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties class. + /// + public ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties class. + /// + /// Array of errors. This is ignored if + /// submitted. + /// The state of the task. This is ignored if + /// submitted. Possible values include: 'Unknown', 'Queued', 'Running', + /// 'Canceled', 'Succeeded', 'Failed', 'FailedInputValidation', + /// 'Faulted' + /// Array of command properties. + /// Key value pairs of client data to attach + /// meta data information to task + /// Task input + /// Task output. This is ignored if + /// submitted. + public ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties(IList errors = default(IList), string state = default(string), IList commands = default(IList), IDictionary clientData = default(IDictionary), ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput input = default(ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput), IList output = default(IList)) + : base(errors, state, commands, clientData) + { + Input = input; + Output = output; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets task input + /// + [JsonProperty(PropertyName = "input")] + public ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput Input { get; set; } + + /// + /// Gets task output. This is ignored if submitted. + /// + [JsonProperty(PropertyName = "output")] + public IList Output { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Input != null) + { + Input.Validate(); + } + } + } +} diff --git a/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/InstallOCIDriverTaskInput.cs b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/InstallOCIDriverTaskInput.cs new file mode 100644 index 0000000000000..3062bf764beea --- /dev/null +++ b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/InstallOCIDriverTaskInput.cs @@ -0,0 +1,52 @@ +// +// 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.DataMigration.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Input for the service task to install an OCI driver. + /// + public partial class InstallOCIDriverTaskInput + { + /// + /// Initializes a new instance of the InstallOCIDriverTaskInput class. + /// + public InstallOCIDriverTaskInput() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the InstallOCIDriverTaskInput class. + /// + /// Name of the uploaded driver package + /// to install. + public InstallOCIDriverTaskInput(string driverPackageName = default(string)) + { + DriverPackageName = driverPackageName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of the uploaded driver package to install. + /// + [JsonProperty(PropertyName = "driverPackageName")] + public string DriverPackageName { get; set; } + + } +} diff --git a/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/InstallOCIDriverTaskOutput.cs b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/InstallOCIDriverTaskOutput.cs new file mode 100644 index 0000000000000..30ec64839f973 --- /dev/null +++ b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/InstallOCIDriverTaskOutput.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.DataMigration.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Output for the service task to install an OCI driver. + /// + public partial class InstallOCIDriverTaskOutput + { + /// + /// Initializes a new instance of the InstallOCIDriverTaskOutput class. + /// + public InstallOCIDriverTaskOutput() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the InstallOCIDriverTaskOutput class. + /// + /// Validation errors + public InstallOCIDriverTaskOutput(IList validationErrors = default(IList)) + { + ValidationErrors = validationErrors; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets validation errors + /// + [JsonProperty(PropertyName = "validationErrors")] + public IList ValidationErrors { get; private set; } + + } +} diff --git a/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/InstallOCIDriverTaskProperties.cs b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/InstallOCIDriverTaskProperties.cs new file mode 100644 index 0000000000000..21886aa50c8d3 --- /dev/null +++ b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/InstallOCIDriverTaskProperties.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.DataMigration.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Properties for the task that installs an OCI driver. + /// + [Newtonsoft.Json.JsonObject("Service.Install.OCI")] + public partial class InstallOCIDriverTaskProperties : ProjectTaskProperties + { + /// + /// Initializes a new instance of the InstallOCIDriverTaskProperties + /// class. + /// + public InstallOCIDriverTaskProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the InstallOCIDriverTaskProperties + /// class. + /// + /// Array of errors. This is ignored if + /// submitted. + /// The state of the task. This is ignored if + /// submitted. Possible values include: 'Unknown', 'Queued', 'Running', + /// 'Canceled', 'Succeeded', 'Failed', 'FailedInputValidation', + /// 'Faulted' + /// Array of command properties. + /// Key value pairs of client data to attach + /// meta data information to task + /// Task output. This is ignored if + /// submitted. + public InstallOCIDriverTaskProperties(IList errors = default(IList), string state = default(string), IList commands = default(IList), IDictionary clientData = default(IDictionary), InstallOCIDriverTaskInput input = default(InstallOCIDriverTaskInput), IList output = default(IList)) + : base(errors, state, commands, clientData) + { + Input = input; + Output = output; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "input")] + public InstallOCIDriverTaskInput Input { get; set; } + + /// + /// Gets task output. This is ignored if submitted. + /// + [JsonProperty(PropertyName = "output")] + public IList Output { get; private set; } + + } +} diff --git a/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/MigrateOracleAzureDbForPostgreSqlSyncTaskProperties.cs b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/MigrateOracleAzureDbForPostgreSqlSyncTaskProperties.cs new file mode 100644 index 0000000000000..81a9806f13da6 --- /dev/null +++ b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/MigrateOracleAzureDbForPostgreSqlSyncTaskProperties.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.DataMigration.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Properties for the task that migrates Oracle to Azure Database for + /// PostgreSQL for online migrations + /// + [Newtonsoft.Json.JsonObject("Migrate.Oracle.Sql.Sync")] + public partial class MigrateOracleAzureDbForPostgreSqlSyncTaskProperties : ProjectTaskProperties + { + /// + /// Initializes a new instance of the + /// MigrateOracleAzureDbForPostgreSqlSyncTaskProperties class. + /// + public MigrateOracleAzureDbForPostgreSqlSyncTaskProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// MigrateOracleAzureDbForPostgreSqlSyncTaskProperties class. + /// + /// Array of errors. This is ignored if + /// submitted. + /// The state of the task. This is ignored if + /// submitted. Possible values include: 'Unknown', 'Queued', 'Running', + /// 'Canceled', 'Succeeded', 'Failed', 'FailedInputValidation', + /// 'Faulted' + /// Array of command properties. + /// Key value pairs of client data to attach + /// meta data information to task + /// Task input + /// Task output. This is ignored if + /// submitted. + public MigrateOracleAzureDbForPostgreSqlSyncTaskProperties(IList errors = default(IList), string state = default(string), IList commands = default(IList), IDictionary clientData = default(IDictionary), MigrateOracleAzureDbPostgreSqlSyncTaskInput input = default(MigrateOracleAzureDbPostgreSqlSyncTaskInput), IList output = default(IList)) + : base(errors, state, commands, clientData) + { + Input = input; + Output = output; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets task input + /// + [JsonProperty(PropertyName = "input")] + public MigrateOracleAzureDbPostgreSqlSyncTaskInput Input { get; set; } + + /// + /// Gets task output. This is ignored if submitted. + /// + [JsonProperty(PropertyName = "output")] + public IList Output { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Input != null) + { + Input.Validate(); + } + } + } +} diff --git a/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/MigrateOracleAzureDbPostgreSqlSyncDatabaseInput.cs b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/MigrateOracleAzureDbPostgreSqlSyncDatabaseInput.cs new file mode 100644 index 0000000000000..a63a8c0fbddec --- /dev/null +++ b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/MigrateOracleAzureDbPostgreSqlSyncDatabaseInput.cs @@ -0,0 +1,112 @@ +// +// 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.DataMigration.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Database specific information for Oracle to Azure Database for + /// PostgreSQL migration task inputs + /// + public partial class MigrateOracleAzureDbPostgreSqlSyncDatabaseInput + { + /// + /// Initializes a new instance of the + /// MigrateOracleAzureDbPostgreSqlSyncDatabaseInput class. + /// + public MigrateOracleAzureDbPostgreSqlSyncDatabaseInput() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// MigrateOracleAzureDbPostgreSqlSyncDatabaseInput class. + /// + /// Name of the migration pipeline + /// Name of the source schema + /// Mapping of source to target tables + /// Name of target database. Note: + /// Target database will be truncated before starting + /// migration. + /// Migration settings which tune the + /// migration behavior + /// Source settings to tune source endpoint + /// migration behavior + /// Target settings to tune target endpoint + /// migration behavior + public MigrateOracleAzureDbPostgreSqlSyncDatabaseInput(string name = default(string), string schemaName = default(string), IDictionary tableMap = default(IDictionary), string targetDatabaseName = default(string), IDictionary migrationSetting = default(IDictionary), IDictionary sourceSetting = default(IDictionary), IDictionary targetSetting = default(IDictionary)) + { + Name = name; + SchemaName = schemaName; + TableMap = tableMap; + TargetDatabaseName = targetDatabaseName; + MigrationSetting = migrationSetting; + SourceSetting = sourceSetting; + TargetSetting = targetSetting; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of the migration pipeline + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets name of the source schema + /// + [JsonProperty(PropertyName = "schemaName")] + public string SchemaName { get; set; } + + /// + /// Gets or sets mapping of source to target tables + /// + [JsonProperty(PropertyName = "tableMap")] + public IDictionary TableMap { get; set; } + + /// + /// Gets or sets name of target database. Note: Target database will be + /// truncated before starting migration. + /// + [JsonProperty(PropertyName = "targetDatabaseName")] + public string TargetDatabaseName { get; set; } + + /// + /// Gets or sets migration settings which tune the migration behavior + /// + [JsonProperty(PropertyName = "migrationSetting")] + public IDictionary MigrationSetting { get; set; } + + /// + /// Gets or sets source settings to tune source endpoint migration + /// behavior + /// + [JsonProperty(PropertyName = "sourceSetting")] + public IDictionary SourceSetting { get; set; } + + /// + /// Gets or sets target settings to tune target endpoint migration + /// behavior + /// + [JsonProperty(PropertyName = "targetSetting")] + public IDictionary TargetSetting { get; set; } + + } +} diff --git a/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/MigrateOracleAzureDbPostgreSqlSyncTaskInput.cs b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/MigrateOracleAzureDbPostgreSqlSyncTaskInput.cs new file mode 100644 index 0000000000000..46395fc5974c5 --- /dev/null +++ b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/MigrateOracleAzureDbPostgreSqlSyncTaskInput.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.DataMigration.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Input for the task that migrates Oracle databases to Azure Database for + /// PostgreSQL for online migrations + /// + public partial class MigrateOracleAzureDbPostgreSqlSyncTaskInput + { + /// + /// Initializes a new instance of the + /// MigrateOracleAzureDbPostgreSqlSyncTaskInput class. + /// + public MigrateOracleAzureDbPostgreSqlSyncTaskInput() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// MigrateOracleAzureDbPostgreSqlSyncTaskInput class. + /// + /// Databases to migrate + /// Connection information for + /// target Azure Database for PostgreSQL + /// Connection information for + /// source Oracle + public MigrateOracleAzureDbPostgreSqlSyncTaskInput(IList selectedDatabases, PostgreSqlConnectionInfo targetConnectionInfo, OracleConnectionInfo sourceConnectionInfo) + { + SelectedDatabases = selectedDatabases; + TargetConnectionInfo = targetConnectionInfo; + SourceConnectionInfo = sourceConnectionInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets databases to migrate + /// + [JsonProperty(PropertyName = "selectedDatabases")] + public IList SelectedDatabases { get; set; } + + /// + /// Gets or sets connection information for target Azure Database for + /// PostgreSQL + /// + [JsonProperty(PropertyName = "targetConnectionInfo")] + public PostgreSqlConnectionInfo TargetConnectionInfo { get; set; } + + /// + /// Gets or sets connection information for source Oracle + /// + [JsonProperty(PropertyName = "sourceConnectionInfo")] + public OracleConnectionInfo SourceConnectionInfo { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (SelectedDatabases == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "SelectedDatabases"); + } + if (TargetConnectionInfo == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "TargetConnectionInfo"); + } + if (SourceConnectionInfo == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "SourceConnectionInfo"); + } + if (TargetConnectionInfo != null) + { + TargetConnectionInfo.Validate(); + } + if (SourceConnectionInfo != null) + { + SourceConnectionInfo.Validate(); + } + } + } +} diff --git a/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/MigrateOracleAzureDbPostgreSqlSyncTaskOutput.cs b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/MigrateOracleAzureDbPostgreSqlSyncTaskOutput.cs new file mode 100644 index 0000000000000..c39e716f694c3 --- /dev/null +++ b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/MigrateOracleAzureDbPostgreSqlSyncTaskOutput.cs @@ -0,0 +1,54 @@ +// +// 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.DataMigration.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Output for the task that migrates Oracle databases to Azure Database + /// for PostgreSQL for online migrations + /// + public partial class MigrateOracleAzureDbPostgreSqlSyncTaskOutput + { + /// + /// Initializes a new instance of the + /// MigrateOracleAzureDbPostgreSqlSyncTaskOutput class. + /// + public MigrateOracleAzureDbPostgreSqlSyncTaskOutput() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// MigrateOracleAzureDbPostgreSqlSyncTaskOutput class. + /// + /// Result identifier + public MigrateOracleAzureDbPostgreSqlSyncTaskOutput(string id = default(string)) + { + Id = id; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets result identifier + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + } +} diff --git a/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError.cs b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError.cs new file mode 100644 index 0000000000000..116cf9054ac58 --- /dev/null +++ b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError.cs @@ -0,0 +1,63 @@ +// +// 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.DataMigration.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + [Newtonsoft.Json.JsonObject("DatabaseLevelErrorOutput")] + public partial class MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError : MigrateOracleAzureDbPostgreSqlSyncTaskOutput + { + /// + /// Initializes a new instance of the + /// MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError class. + /// + public MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError class. + /// + /// Result identifier + /// Error message + /// List of error events. + public MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError(string id = default(string), string errorMessage = default(string), IList events = default(IList)) + : base(id) + { + ErrorMessage = errorMessage; + Events = events; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets error message + /// + [JsonProperty(PropertyName = "errorMessage")] + public string ErrorMessage { get; set; } + + /// + /// Gets or sets list of error events. + /// + [JsonProperty(PropertyName = "events")] + public IList Events { get; set; } + + } +} diff --git a/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.cs b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.cs new file mode 100644 index 0000000000000..584515b7209db --- /dev/null +++ b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.cs @@ -0,0 +1,177 @@ +// +// 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.DataMigration.Models +{ + using Newtonsoft.Json; + using System.Linq; + + [Newtonsoft.Json.JsonObject("DatabaseLevelOutput")] + public partial class MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel : MigrateOracleAzureDbPostgreSqlSyncTaskOutput + { + /// + /// Initializes a new instance of the + /// MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel class. + /// + public MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel class. + /// + /// Result identifier + /// Name of the database + /// Migration start time + /// Migration end time + /// Migration state that this database is + /// in. Possible values include: 'UNDEFINED', 'CONFIGURING', + /// 'INITIALIAZING', 'STARTING', 'RUNNING', 'READY_TO_COMPLETE', + /// 'COMPLETING', 'COMPLETE', 'CANCELLING', 'CANCELLED', + /// 'FAILED' + /// Number of incoming changes + /// Number of applied changes + /// Number of cdc inserts + /// Number of cdc deletes + /// Number of cdc updates + /// Number of tables completed in + /// full load + /// Number of tables loading in + /// full load + /// Number of tables queued in full + /// load + /// Number of tables errored in + /// full load + /// Indicates if initial load + /// (full load) has been completed + /// CDC apply latency + public MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel(string id = default(string), string databaseName = default(string), System.DateTimeOffset? startedOn = default(System.DateTimeOffset?), System.DateTimeOffset? endedOn = default(System.DateTimeOffset?), string migrationState = default(string), long? incomingChanges = default(long?), long? appliedChanges = default(long?), long? cdcInsertCounter = default(long?), long? cdcDeleteCounter = default(long?), long? cdcUpdateCounter = default(long?), long? fullLoadCompletedTables = default(long?), long? fullLoadLoadingTables = default(long?), long? fullLoadQueuedTables = default(long?), long? fullLoadErroredTables = default(long?), bool? initializationCompleted = default(bool?), long? latency = default(long?)) + : base(id) + { + DatabaseName = databaseName; + StartedOn = startedOn; + EndedOn = endedOn; + MigrationState = migrationState; + IncomingChanges = incomingChanges; + AppliedChanges = appliedChanges; + CdcInsertCounter = cdcInsertCounter; + CdcDeleteCounter = cdcDeleteCounter; + CdcUpdateCounter = cdcUpdateCounter; + FullLoadCompletedTables = fullLoadCompletedTables; + FullLoadLoadingTables = fullLoadLoadingTables; + FullLoadQueuedTables = fullLoadQueuedTables; + FullLoadErroredTables = fullLoadErroredTables; + InitializationCompleted = initializationCompleted; + Latency = latency; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets name of the database + /// + [JsonProperty(PropertyName = "databaseName")] + public string DatabaseName { get; private set; } + + /// + /// Gets migration start time + /// + [JsonProperty(PropertyName = "startedOn")] + public System.DateTimeOffset? StartedOn { get; private set; } + + /// + /// Gets migration end time + /// + [JsonProperty(PropertyName = "endedOn")] + public System.DateTimeOffset? EndedOn { get; private set; } + + /// + /// Gets migration state that this database is in. Possible values + /// include: 'UNDEFINED', 'CONFIGURING', 'INITIALIAZING', 'STARTING', + /// 'RUNNING', 'READY_TO_COMPLETE', 'COMPLETING', 'COMPLETE', + /// 'CANCELLING', 'CANCELLED', 'FAILED' + /// + [JsonProperty(PropertyName = "migrationState")] + public string MigrationState { get; private set; } + + /// + /// Gets number of incoming changes + /// + [JsonProperty(PropertyName = "incomingChanges")] + public long? IncomingChanges { get; private set; } + + /// + /// Gets number of applied changes + /// + [JsonProperty(PropertyName = "appliedChanges")] + public long? AppliedChanges { get; private set; } + + /// + /// Gets number of cdc inserts + /// + [JsonProperty(PropertyName = "cdcInsertCounter")] + public long? CdcInsertCounter { get; private set; } + + /// + /// Gets number of cdc deletes + /// + [JsonProperty(PropertyName = "cdcDeleteCounter")] + public long? CdcDeleteCounter { get; private set; } + + /// + /// Gets number of cdc updates + /// + [JsonProperty(PropertyName = "cdcUpdateCounter")] + public long? CdcUpdateCounter { get; private set; } + + /// + /// Gets number of tables completed in full load + /// + [JsonProperty(PropertyName = "fullLoadCompletedTables")] + public long? FullLoadCompletedTables { get; private set; } + + /// + /// Gets number of tables loading in full load + /// + [JsonProperty(PropertyName = "fullLoadLoadingTables")] + public long? FullLoadLoadingTables { get; private set; } + + /// + /// Gets number of tables queued in full load + /// + [JsonProperty(PropertyName = "fullLoadQueuedTables")] + public long? FullLoadQueuedTables { get; private set; } + + /// + /// Gets number of tables errored in full load + /// + [JsonProperty(PropertyName = "fullLoadErroredTables")] + public long? FullLoadErroredTables { get; private set; } + + /// + /// Gets indicates if initial load (full load) has been completed + /// + [JsonProperty(PropertyName = "initializationCompleted")] + public bool? InitializationCompleted { get; private set; } + + /// + /// Gets CDC apply latency + /// + [JsonProperty(PropertyName = "latency")] + public long? Latency { get; private set; } + + } +} diff --git a/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputError.cs b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputError.cs new file mode 100644 index 0000000000000..136a310058db6 --- /dev/null +++ b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputError.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.DataMigration.Models +{ + using Newtonsoft.Json; + using System.Linq; + + [Newtonsoft.Json.JsonObject("ErrorOutput")] + public partial class MigrateOracleAzureDbPostgreSqlSyncTaskOutputError : MigrateOracleAzureDbPostgreSqlSyncTaskOutput + { + /// + /// Initializes a new instance of the + /// MigrateOracleAzureDbPostgreSqlSyncTaskOutputError class. + /// + public MigrateOracleAzureDbPostgreSqlSyncTaskOutputError() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// MigrateOracleAzureDbPostgreSqlSyncTaskOutputError class. + /// + /// Result identifier + /// Migration error + public MigrateOracleAzureDbPostgreSqlSyncTaskOutputError(string id = default(string), ReportableException error = default(ReportableException)) + : base(id) + { + Error = error; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets migration error + /// + [JsonProperty(PropertyName = "error")] + public ReportableException Error { get; private set; } + + } +} diff --git a/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel.cs b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel.cs new file mode 100644 index 0000000000000..7ba7331bc11f1 --- /dev/null +++ b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel.cs @@ -0,0 +1,93 @@ +// +// 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.DataMigration.Models +{ + using Newtonsoft.Json; + using System.Linq; + + [Newtonsoft.Json.JsonObject("MigrationLevelOutput")] + public partial class MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel : MigrateOracleAzureDbPostgreSqlSyncTaskOutput + { + /// + /// Initializes a new instance of the + /// MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel class. + /// + public MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel class. + /// + /// Result identifier + /// Migration start time + /// Migration end time + /// Source server version + /// Source server name + /// Target server version + /// Target server name + public MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel(string id = default(string), System.DateTimeOffset? startedOn = default(System.DateTimeOffset?), System.DateTimeOffset? endedOn = default(System.DateTimeOffset?), string sourceServerVersion = default(string), string sourceServer = default(string), string targetServerVersion = default(string), string targetServer = default(string)) + : base(id) + { + StartedOn = startedOn; + EndedOn = endedOn; + SourceServerVersion = sourceServerVersion; + SourceServer = sourceServer; + TargetServerVersion = targetServerVersion; + TargetServer = targetServer; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets migration start time + /// + [JsonProperty(PropertyName = "startedOn")] + public System.DateTimeOffset? StartedOn { get; private set; } + + /// + /// Gets migration end time + /// + [JsonProperty(PropertyName = "endedOn")] + public System.DateTimeOffset? EndedOn { get; private set; } + + /// + /// Gets source server version + /// + [JsonProperty(PropertyName = "sourceServerVersion")] + public string SourceServerVersion { get; private set; } + + /// + /// Gets source server name + /// + [JsonProperty(PropertyName = "sourceServer")] + public string SourceServer { get; private set; } + + /// + /// Gets target server version + /// + [JsonProperty(PropertyName = "targetServerVersion")] + public string TargetServerVersion { get; private set; } + + /// + /// Gets target server name + /// + [JsonProperty(PropertyName = "targetServer")] + public string TargetServer { get; private set; } + + } +} diff --git a/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.cs b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.cs new file mode 100644 index 0000000000000..fb6c06cd1f08e --- /dev/null +++ b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.cs @@ -0,0 +1,157 @@ +// +// 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.DataMigration.Models +{ + using Newtonsoft.Json; + using System.Linq; + + [Newtonsoft.Json.JsonObject("TableLevelOutput")] + public partial class MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel : MigrateOracleAzureDbPostgreSqlSyncTaskOutput + { + /// + /// Initializes a new instance of the + /// MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel class. + /// + public MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel class. + /// + /// Result identifier + /// Name of the table + /// Name of the database + /// Number of applied inserts + /// Number of applied updates + /// Number of applied deletes + /// Estimate to finish full + /// load + /// Full load start time + /// Full load end time + /// Number of rows applied in full + /// load + /// Current state of the table migration. Possible + /// values include: 'BEFORE_LOAD', 'FULL_LOAD', 'COMPLETED', + /// 'CANCELED', 'ERROR', 'FAILED' + /// Total number of applied + /// changes + /// Number of data errors + /// occurred + /// Last modified time on target + public MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel(string id = default(string), string tableName = default(string), string databaseName = default(string), long? cdcInsertCounter = default(long?), long? cdcUpdateCounter = default(long?), long? cdcDeleteCounter = default(long?), System.DateTimeOffset? fullLoadEstFinishTime = default(System.DateTimeOffset?), System.DateTimeOffset? fullLoadStartedOn = default(System.DateTimeOffset?), System.DateTimeOffset? fullLoadEndedOn = default(System.DateTimeOffset?), long? fullLoadTotalRows = default(long?), string state = default(string), long? totalChangesApplied = default(long?), long? dataErrorsCounter = default(long?), System.DateTimeOffset? lastModifiedTime = default(System.DateTimeOffset?)) + : base(id) + { + TableName = tableName; + DatabaseName = databaseName; + CdcInsertCounter = cdcInsertCounter; + CdcUpdateCounter = cdcUpdateCounter; + CdcDeleteCounter = cdcDeleteCounter; + FullLoadEstFinishTime = fullLoadEstFinishTime; + FullLoadStartedOn = fullLoadStartedOn; + FullLoadEndedOn = fullLoadEndedOn; + FullLoadTotalRows = fullLoadTotalRows; + State = state; + TotalChangesApplied = totalChangesApplied; + DataErrorsCounter = dataErrorsCounter; + LastModifiedTime = lastModifiedTime; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets name of the table + /// + [JsonProperty(PropertyName = "tableName")] + public string TableName { get; private set; } + + /// + /// Gets name of the database + /// + [JsonProperty(PropertyName = "databaseName")] + public string DatabaseName { get; private set; } + + /// + /// Gets number of applied inserts + /// + [JsonProperty(PropertyName = "cdcInsertCounter")] + public long? CdcInsertCounter { get; private set; } + + /// + /// Gets number of applied updates + /// + [JsonProperty(PropertyName = "cdcUpdateCounter")] + public long? CdcUpdateCounter { get; private set; } + + /// + /// Gets number of applied deletes + /// + [JsonProperty(PropertyName = "cdcDeleteCounter")] + public long? CdcDeleteCounter { get; private set; } + + /// + /// Gets estimate to finish full load + /// + [JsonProperty(PropertyName = "fullLoadEstFinishTime")] + public System.DateTimeOffset? FullLoadEstFinishTime { get; private set; } + + /// + /// Gets full load start time + /// + [JsonProperty(PropertyName = "fullLoadStartedOn")] + public System.DateTimeOffset? FullLoadStartedOn { get; private set; } + + /// + /// Gets full load end time + /// + [JsonProperty(PropertyName = "fullLoadEndedOn")] + public System.DateTimeOffset? FullLoadEndedOn { get; private set; } + + /// + /// Gets number of rows applied in full load + /// + [JsonProperty(PropertyName = "fullLoadTotalRows")] + public long? FullLoadTotalRows { get; private set; } + + /// + /// Gets current state of the table migration. Possible values include: + /// 'BEFORE_LOAD', 'FULL_LOAD', 'COMPLETED', 'CANCELED', 'ERROR', + /// 'FAILED' + /// + [JsonProperty(PropertyName = "state")] + public string State { get; private set; } + + /// + /// Gets total number of applied changes + /// + [JsonProperty(PropertyName = "totalChangesApplied")] + public long? TotalChangesApplied { get; private set; } + + /// + /// Gets number of data errors occurred + /// + [JsonProperty(PropertyName = "dataErrorsCounter")] + public long? DataErrorsCounter { get; private set; } + + /// + /// Gets last modified time on target + /// + [JsonProperty(PropertyName = "lastModifiedTime")] + public System.DateTimeOffset? LastModifiedTime { get; private set; } + + } +} diff --git a/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/OracleConnectionInfo.cs b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/OracleConnectionInfo.cs new file mode 100644 index 0000000000000..1a3ed8a116976 --- /dev/null +++ b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/OracleConnectionInfo.cs @@ -0,0 +1,69 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataMigration.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Information for connecting to Oracle server + /// + public partial class OracleConnectionInfo : ConnectionInfo + { + /// + /// Initializes a new instance of the OracleConnectionInfo class. + /// + public OracleConnectionInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OracleConnectionInfo class. + /// + /// EZConnect or TNSName connection + /// string. + /// User name + /// Password credential. + public OracleConnectionInfo(string dataSource, string userName = default(string), string password = default(string)) + : base(userName, password) + { + DataSource = dataSource; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets eZConnect or TNSName connection string. + /// + [JsonProperty(PropertyName = "dataSource")] + public string DataSource { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (DataSource == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "DataSource"); + } + } + } +} diff --git a/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/OracleOCIDriverInfo.cs b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/OracleOCIDriverInfo.cs new file mode 100644 index 0000000000000..70b4b5cd545fb --- /dev/null +++ b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/OracleOCIDriverInfo.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.DataMigration.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Information about an Oracle OCI driver. + /// + public partial class OracleOCIDriverInfo + { + /// + /// Initializes a new instance of the OracleOCIDriverInfo class. + /// + public OracleOCIDriverInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OracleOCIDriverInfo class. + /// + /// The name of the driver package + /// The size in bytes of the driver + /// package + /// The MD5 Base64 encoded checksum for + /// the driver package. + /// The checksum for the driver package + /// provided by Oracle. + /// Version listed in the OCI assembly + /// 'oci.dll' + /// List of Oracle database + /// versions supported by this driver. Only major minor of the version + /// is listed. + public OracleOCIDriverInfo(string driverName = default(string), string driverSize = default(string), string archiveChecksum = default(string), string oracleChecksum = default(string), string assemblyVersion = default(string), IList supportedOracleVersions = default(IList)) + { + DriverName = driverName; + DriverSize = driverSize; + ArchiveChecksum = archiveChecksum; + OracleChecksum = oracleChecksum; + AssemblyVersion = assemblyVersion; + SupportedOracleVersions = supportedOracleVersions; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the name of the driver package + /// + [JsonProperty(PropertyName = "driverName")] + public string DriverName { get; set; } + + /// + /// Gets or sets the size in bytes of the driver package + /// + [JsonProperty(PropertyName = "driverSize")] + public string DriverSize { get; set; } + + /// + /// Gets or sets the MD5 Base64 encoded checksum for the driver + /// package. + /// + [JsonProperty(PropertyName = "archiveChecksum")] + public string ArchiveChecksum { get; set; } + + /// + /// Gets or sets the checksum for the driver package provided by + /// Oracle. + /// + [JsonProperty(PropertyName = "oracleChecksum")] + public string OracleChecksum { get; set; } + + /// + /// Gets or sets version listed in the OCI assembly 'oci.dll' + /// + [JsonProperty(PropertyName = "assemblyVersion")] + public string AssemblyVersion { get; set; } + + /// + /// Gets or sets list of Oracle database versions supported by this + /// driver. Only major minor of the version is listed. + /// + [JsonProperty(PropertyName = "supportedOracleVersions")] + public IList SupportedOracleVersions { get; set; } + + } +} diff --git a/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/ServerProperties.cs b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/ServerProperties.cs index 8240b351128d0..b992e89839748 100644 --- a/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/ServerProperties.cs +++ b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/ServerProperties.cs @@ -14,7 +14,7 @@ namespace Microsoft.Azure.Management.DataMigration.Models using System.Linq; /// - /// Server properties for Oracle, MySQL type source + /// Server properties for MySQL type source /// public partial class ServerProperties { diff --git a/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/UploadOCIDriverTaskInput.cs b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/UploadOCIDriverTaskInput.cs new file mode 100644 index 0000000000000..4c4964faff320 --- /dev/null +++ b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/UploadOCIDriverTaskInput.cs @@ -0,0 +1,65 @@ +// +// 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.DataMigration.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Input for the service task to upload an OCI driver. + /// + public partial class UploadOCIDriverTaskInput + { + /// + /// Initializes a new instance of the UploadOCIDriverTaskInput class. + /// + public UploadOCIDriverTaskInput() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the UploadOCIDriverTaskInput class. + /// + /// File share information for the OCI driver + /// archive. + public UploadOCIDriverTaskInput(FileShare driverShare = default(FileShare)) + { + DriverShare = driverShare; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets file share information for the OCI driver archive. + /// + [JsonProperty(PropertyName = "driverShare")] + public FileShare DriverShare { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (DriverShare != null) + { + DriverShare.Validate(); + } + } + } +} diff --git a/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/UploadOCIDriverTaskOutput.cs b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/UploadOCIDriverTaskOutput.cs new file mode 100644 index 0000000000000..1c9142fa5f3a9 --- /dev/null +++ b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/UploadOCIDriverTaskOutput.cs @@ -0,0 +1,63 @@ +// +// 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.DataMigration.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Output for the service task to upload an OCI driver. + /// + public partial class UploadOCIDriverTaskOutput + { + /// + /// Initializes a new instance of the UploadOCIDriverTaskOutput class. + /// + public UploadOCIDriverTaskOutput() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the UploadOCIDriverTaskOutput class. + /// + /// The name of the driver package that + /// was validated and uploaded. + /// Validation errors + public UploadOCIDriverTaskOutput(string driverPackageName = default(string), IList validationErrors = default(IList)) + { + DriverPackageName = driverPackageName; + ValidationErrors = validationErrors; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the name of the driver package that was validated and + /// uploaded. + /// + [JsonProperty(PropertyName = "driverPackageName")] + public string DriverPackageName { get; private set; } + + /// + /// Gets validation errors + /// + [JsonProperty(PropertyName = "validationErrors")] + public IList ValidationErrors { get; private set; } + + } +} diff --git a/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/UploadOCIDriverTaskProperties.cs b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/UploadOCIDriverTaskProperties.cs new file mode 100644 index 0000000000000..f00556a4f1577 --- /dev/null +++ b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/UploadOCIDriverTaskProperties.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.DataMigration.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Properties for the task that uploads an OCI driver. + /// + [Newtonsoft.Json.JsonObject("Service.Upload.OCI")] + public partial class UploadOCIDriverTaskProperties : ProjectTaskProperties + { + /// + /// Initializes a new instance of the UploadOCIDriverTaskProperties + /// class. + /// + public UploadOCIDriverTaskProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the UploadOCIDriverTaskProperties + /// class. + /// + /// Array of errors. This is ignored if + /// submitted. + /// The state of the task. This is ignored if + /// submitted. Possible values include: 'Unknown', 'Queued', 'Running', + /// 'Canceled', 'Succeeded', 'Failed', 'FailedInputValidation', + /// 'Faulted' + /// Array of command properties. + /// Key value pairs of client data to attach + /// meta data information to task + /// Task output. This is ignored if + /// submitted. + public UploadOCIDriverTaskProperties(IList errors = default(IList), string state = default(string), IList commands = default(IList), IDictionary clientData = default(IDictionary), UploadOCIDriverTaskInput input = default(UploadOCIDriverTaskInput), IList output = default(IList)) + : base(errors, state, commands, clientData) + { + Input = input; + Output = output; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "input")] + public UploadOCIDriverTaskInput Input { get; set; } + + /// + /// Gets task output. This is ignored if submitted. + /// + [JsonProperty(PropertyName = "output")] + public IList Output { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Input != null) + { + Input.Validate(); + } + } + } +} diff --git a/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/ValidateOracleAzureDbForPostgreSqlSyncTaskProperties.cs b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/ValidateOracleAzureDbForPostgreSqlSyncTaskProperties.cs new file mode 100644 index 0000000000000..30b7a1589f94e --- /dev/null +++ b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/ValidateOracleAzureDbForPostgreSqlSyncTaskProperties.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.DataMigration.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Properties for the task that validates a migration for Oracle to Azure + /// Database for PostgreSQL for online migrations + /// + [Newtonsoft.Json.JsonObject("Validate.Oracle.AzureDbPostgreSql.Sync")] + public partial class ValidateOracleAzureDbForPostgreSqlSyncTaskProperties : ProjectTaskProperties + { + /// + /// Initializes a new instance of the + /// ValidateOracleAzureDbForPostgreSqlSyncTaskProperties class. + /// + public ValidateOracleAzureDbForPostgreSqlSyncTaskProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ValidateOracleAzureDbForPostgreSqlSyncTaskProperties class. + /// + /// Array of errors. This is ignored if + /// submitted. + /// The state of the task. This is ignored if + /// submitted. Possible values include: 'Unknown', 'Queued', 'Running', + /// 'Canceled', 'Succeeded', 'Failed', 'FailedInputValidation', + /// 'Faulted' + /// Array of command properties. + /// Key value pairs of client data to attach + /// meta data information to task + /// An array containing a single validation error + /// response object + public ValidateOracleAzureDbForPostgreSqlSyncTaskProperties(IList errors = default(IList), string state = default(string), IList commands = default(IList), IDictionary clientData = default(IDictionary), MigrateOracleAzureDbPostgreSqlSyncTaskInput input = default(MigrateOracleAzureDbPostgreSqlSyncTaskInput), IList output = default(IList)) + : base(errors, state, commands, clientData) + { + Input = input; + Output = output; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "input")] + public MigrateOracleAzureDbPostgreSqlSyncTaskInput Input { get; set; } + + /// + /// Gets an array containing a single validation error response object + /// + [JsonProperty(PropertyName = "output")] + public IList Output { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Input != null) + { + Input.Validate(); + } + } + } +} diff --git a/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/ValidateOracleAzureDbPostgreSqlSyncTaskOutput.cs b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/ValidateOracleAzureDbPostgreSqlSyncTaskOutput.cs new file mode 100644 index 0000000000000..162af7d8a9288 --- /dev/null +++ b/src/SDKs/DataMigration/Management.DataMigration/Generated/Models/ValidateOracleAzureDbPostgreSqlSyncTaskOutput.cs @@ -0,0 +1,57 @@ +// +// 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.DataMigration.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Output for task that validates migration input for Oracle to Azure + /// Database for PostgreSQL for online migrations + /// + public partial class ValidateOracleAzureDbPostgreSqlSyncTaskOutput + { + /// + /// Initializes a new instance of the + /// ValidateOracleAzureDbPostgreSqlSyncTaskOutput class. + /// + public ValidateOracleAzureDbPostgreSqlSyncTaskOutput() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ValidateOracleAzureDbPostgreSqlSyncTaskOutput class. + /// + /// Errors associated with a selected + /// database object + public ValidateOracleAzureDbPostgreSqlSyncTaskOutput(IList validationErrors = default(IList)) + { + ValidationErrors = validationErrors; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets errors associated with a selected database object + /// + [JsonProperty(PropertyName = "validationErrors")] + public IList ValidationErrors { get; private set; } + + } +} diff --git a/src/SDKs/DataMigration/Management.DataMigration/Generated/SdkInfo_DataMigrationManagementClient.cs b/src/SDKs/DataMigration/Management.DataMigration/Generated/SdkInfo_DataMigrationManagementClient.cs index 53f4512ed8954..137ba383fd2cb 100644 --- a/src/SDKs/DataMigration/Management.DataMigration/Generated/SdkInfo_DataMigrationManagementClient.cs +++ b/src/SDKs/DataMigration/Management.DataMigration/Generated/SdkInfo_DataMigrationManagementClient.cs @@ -23,22 +23,12 @@ public static IEnumerable> ApiInfo_DataMigrationMa new Tuple("DataMigration", "Operations", "2018-07-15-preview"), new Tuple("DataMigration", "Projects", "2018-07-15-preview"), new Tuple("DataMigration", "ResourceSkus", "2018-07-15-preview"), + new Tuple("DataMigration", "ServiceTasks", "2018-07-15-preview"), new Tuple("DataMigration", "Services", "2018-07-15-preview"), new Tuple("DataMigration", "Tasks", "2018-07-15-preview"), new Tuple("DataMigration", "Usages", "2018-07-15-preview"), }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "latest"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4283"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/datamigration/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=E:\\git-azure-restapi\\azure-sdk-for-net\\src\\SDKs"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "0b39f4aa008a0cbd9005c363b84e0e3898898186"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - diff --git a/src/SDKs/DataMigration/Management.DataMigration/Generated/ServiceTasksOperations.cs b/src/SDKs/DataMigration/Management.DataMigration/Generated/ServiceTasksOperations.cs new file mode 100644 index 0000000000000..4c2a9f529c20a --- /dev/null +++ b/src/SDKs/DataMigration/Management.DataMigration/Generated/ServiceTasksOperations.cs @@ -0,0 +1,1503 @@ +// +// 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.DataMigration +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ServiceTasksOperations operations. + /// + internal partial class ServiceTasksOperations : IServiceOperations, IServiceTasksOperations + { + /// + /// Initializes a new instance of the ServiceTasksOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ServiceTasksOperations(DataMigrationServiceClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the DataMigrationServiceClient + /// + public DataMigrationServiceClient Client { get; private set; } + + /// + /// Get service level tasks for a service + /// + /// + /// The services resource is the top-level resource that represents the + /// Database Migration Service. This method returns a list of service level + /// tasks owned by a service resource. Some tasks may have a status of Unknown, + /// which indicates that an error occurred while querying the status of that + /// task. + /// + /// + /// Name of the resource group + /// + /// + /// Name of the service + /// + /// + /// Filter tasks by task type + /// + /// + /// 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 Task>> ListWithHttpMessagesAsync(string groupName, string serviceName, string taskType = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (groupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "groupName"); + } + if (serviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serviceName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("groupName", groupName); + tracingParameters.Add("serviceName", serviceName); + tracingParameters.Add("taskType", taskType); + 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/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/serviceTasks").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{groupName}", System.Uri.EscapeDataString(groupName)); + _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (taskType != null) + { + _queryParameters.Add(string.Format("taskType={0}", System.Uri.EscapeDataString(taskType))); + } + 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 ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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; + } + + /// + /// Create or update service task + /// + /// + /// The service tasks resource is a nested, proxy-only resource representing + /// work performed by a DMS instance. The PUT method creates a new service task + /// or updates an existing one, although since service tasks have no mutable + /// custom properties, there is little reason to update an existing one. + /// + /// + /// Information about the task + /// + /// + /// Name of the resource group + /// + /// + /// Name of the service + /// + /// + /// Name of the Task + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(ProjectTask parameters, string groupName, string serviceName, string taskName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (groupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "groupName"); + } + if (serviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serviceName"); + } + if (taskName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "taskName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("groupName", groupName); + tracingParameters.Add("serviceName", serviceName); + tracingParameters.Add("taskName", taskName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/serviceTasks/{taskName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{groupName}", System.Uri.EscapeDataString(groupName)); + _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); + _url = _url.Replace("{taskName}", System.Uri.EscapeDataString(taskName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get service task information + /// + /// + /// The service tasks resource is a nested, proxy-only resource representing + /// work performed by a DMS instance. The GET method retrieves information + /// about a service task. + /// + /// + /// Name of the resource group + /// + /// + /// Name of the service + /// + /// + /// Name of the Task + /// + /// + /// Expand the response + /// + /// + /// 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 Task> GetWithHttpMessagesAsync(string groupName, string serviceName, string taskName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (groupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "groupName"); + } + if (serviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serviceName"); + } + if (taskName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "taskName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("expand", expand); + tracingParameters.Add("groupName", groupName); + tracingParameters.Add("serviceName", serviceName); + 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/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/serviceTasks/{taskName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{groupName}", System.Uri.EscapeDataString(groupName)); + _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); + _url = _url.Replace("{taskName}", System.Uri.EscapeDataString(taskName)); + List _queryParameters = new List(); + if (expand != null) + { + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); + } + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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 ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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; + } + + /// + /// Delete service task + /// + /// + /// The service tasks resource is a nested, proxy-only resource representing + /// work performed by a DMS instance. The DELETE method deletes a service task, + /// canceling it first if it's running. + /// + /// + /// Name of the resource group + /// + /// + /// Name of the service + /// + /// + /// Name of the Task + /// + /// + /// Delete the resource even if it contains running tasks + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task DeleteWithHttpMessagesAsync(string groupName, string serviceName, string taskName, bool? deleteRunningTasks = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (groupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "groupName"); + } + if (serviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serviceName"); + } + if (taskName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "taskName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deleteRunningTasks", deleteRunningTasks); + tracingParameters.Add("groupName", groupName); + tracingParameters.Add("serviceName", serviceName); + tracingParameters.Add("taskName", taskName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/serviceTasks/{taskName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{groupName}", System.Uri.EscapeDataString(groupName)); + _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); + _url = _url.Replace("{taskName}", System.Uri.EscapeDataString(taskName)); + List _queryParameters = new List(); + if (deleteRunningTasks != null) + { + _queryParameters.Add(string.Format("deleteRunningTasks={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(deleteRunningTasks, Client.SerializationSettings).Trim('"')))); + } + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 204) + { + var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Create or update service task + /// + /// + /// The service tasks resource is a nested, proxy-only resource representing + /// work performed by a DMS instance. The PATCH method updates an existing + /// service task, but since service tasks have no mutable custom properties, + /// there is little reason to do so. + /// + /// + /// Information about the task + /// + /// + /// Name of the resource group + /// + /// + /// Name of the service + /// + /// + /// Name of the Task + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> UpdateWithHttpMessagesAsync(ProjectTask parameters, string groupName, string serviceName, string taskName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (groupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "groupName"); + } + if (serviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serviceName"); + } + if (taskName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "taskName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("groupName", groupName); + tracingParameters.Add("serviceName", serviceName); + tracingParameters.Add("taskName", taskName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/serviceTasks/{taskName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{groupName}", System.Uri.EscapeDataString(groupName)); + _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); + _url = _url.Replace("{taskName}", System.Uri.EscapeDataString(taskName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, 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) + { + var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Cancel a service task + /// + /// + /// The service tasks resource is a nested, proxy-only resource representing + /// work performed by a DMS instance. This method cancels a service task if + /// it's currently queued or running. + /// + /// + /// Name of the resource group + /// + /// + /// Name of the service + /// + /// + /// Name of the Task + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> CancelWithHttpMessagesAsync(string groupName, string serviceName, string taskName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (groupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "groupName"); + } + if (serviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "serviceName"); + } + if (taskName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "taskName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("groupName", groupName); + tracingParameters.Add("serviceName", serviceName); + tracingParameters.Add("taskName", taskName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Cancel", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/serviceTasks/{taskName}/cancel").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{groupName}", System.Uri.EscapeDataString(groupName)); + _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); + _url = _url.Replace("{taskName}", System.Uri.EscapeDataString(taskName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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 service level tasks for a service + /// + /// + /// The services resource is the top-level resource that represents the + /// Database Migration Service. This method returns a list of service level + /// tasks owned by a service resource. Some tasks may have a status of Unknown, + /// which indicates that an error occurred while querying the status of that + /// task. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ApiErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ApiError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/SDKs/DataMigration/Management.DataMigration/Generated/ServiceTasksOperationsExtensions.cs b/src/SDKs/DataMigration/Management.DataMigration/Generated/ServiceTasksOperationsExtensions.cs new file mode 100644 index 0000000000000..eea9268809e4e --- /dev/null +++ b/src/SDKs/DataMigration/Management.DataMigration/Generated/ServiceTasksOperationsExtensions.cs @@ -0,0 +1,438 @@ +// +// 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.DataMigration +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ServiceTasksOperations. + /// + public static partial class ServiceTasksOperationsExtensions + { + /// + /// Get service level tasks for a service + /// + /// + /// The services resource is the top-level resource that represents the + /// Database Migration Service. This method returns a list of service level + /// tasks owned by a service resource. Some tasks may have a status of Unknown, + /// which indicates that an error occurred while querying the status of that + /// task. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group + /// + /// + /// Name of the service + /// + /// + /// Filter tasks by task type + /// + public static IPage List(this IServiceTasksOperations operations, string groupName, string serviceName, string taskType = default(string)) + { + return operations.ListAsync(groupName, serviceName, taskType).GetAwaiter().GetResult(); + } + + /// + /// Get service level tasks for a service + /// + /// + /// The services resource is the top-level resource that represents the + /// Database Migration Service. This method returns a list of service level + /// tasks owned by a service resource. Some tasks may have a status of Unknown, + /// which indicates that an error occurred while querying the status of that + /// task. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group + /// + /// + /// Name of the service + /// + /// + /// Filter tasks by task type + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IServiceTasksOperations operations, string groupName, string serviceName, string taskType = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(groupName, serviceName, taskType, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Create or update service task + /// + /// + /// The service tasks resource is a nested, proxy-only resource representing + /// work performed by a DMS instance. The PUT method creates a new service task + /// or updates an existing one, although since service tasks have no mutable + /// custom properties, there is little reason to update an existing one. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Information about the task + /// + /// + /// Name of the resource group + /// + /// + /// Name of the service + /// + /// + /// Name of the Task + /// + public static ProjectTask CreateOrUpdate(this IServiceTasksOperations operations, ProjectTask parameters, string groupName, string serviceName, string taskName) + { + return operations.CreateOrUpdateAsync(parameters, groupName, serviceName, taskName).GetAwaiter().GetResult(); + } + + /// + /// Create or update service task + /// + /// + /// The service tasks resource is a nested, proxy-only resource representing + /// work performed by a DMS instance. The PUT method creates a new service task + /// or updates an existing one, although since service tasks have no mutable + /// custom properties, there is little reason to update an existing one. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Information about the task + /// + /// + /// Name of the resource group + /// + /// + /// Name of the service + /// + /// + /// Name of the Task + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IServiceTasksOperations operations, ProjectTask parameters, string groupName, string serviceName, string taskName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(parameters, groupName, serviceName, taskName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get service task information + /// + /// + /// The service tasks resource is a nested, proxy-only resource representing + /// work performed by a DMS instance. The GET method retrieves information + /// about a service task. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group + /// + /// + /// Name of the service + /// + /// + /// Name of the Task + /// + /// + /// Expand the response + /// + public static ProjectTask Get(this IServiceTasksOperations operations, string groupName, string serviceName, string taskName, string expand = default(string)) + { + return operations.GetAsync(groupName, serviceName, taskName, expand).GetAwaiter().GetResult(); + } + + /// + /// Get service task information + /// + /// + /// The service tasks resource is a nested, proxy-only resource representing + /// work performed by a DMS instance. The GET method retrieves information + /// about a service task. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group + /// + /// + /// Name of the service + /// + /// + /// Name of the Task + /// + /// + /// Expand the response + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IServiceTasksOperations operations, string groupName, string serviceName, string taskName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(groupName, serviceName, taskName, expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete service task + /// + /// + /// The service tasks resource is a nested, proxy-only resource representing + /// work performed by a DMS instance. The DELETE method deletes a service task, + /// canceling it first if it's running. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group + /// + /// + /// Name of the service + /// + /// + /// Name of the Task + /// + /// + /// Delete the resource even if it contains running tasks + /// + public static void Delete(this IServiceTasksOperations operations, string groupName, string serviceName, string taskName, bool? deleteRunningTasks = default(bool?)) + { + operations.DeleteAsync(groupName, serviceName, taskName, deleteRunningTasks).GetAwaiter().GetResult(); + } + + /// + /// Delete service task + /// + /// + /// The service tasks resource is a nested, proxy-only resource representing + /// work performed by a DMS instance. The DELETE method deletes a service task, + /// canceling it first if it's running. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group + /// + /// + /// Name of the service + /// + /// + /// Name of the Task + /// + /// + /// Delete the resource even if it contains running tasks + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IServiceTasksOperations operations, string groupName, string serviceName, string taskName, bool? deleteRunningTasks = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(groupName, serviceName, taskName, deleteRunningTasks, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Create or update service task + /// + /// + /// The service tasks resource is a nested, proxy-only resource representing + /// work performed by a DMS instance. The PATCH method updates an existing + /// service task, but since service tasks have no mutable custom properties, + /// there is little reason to do so. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Information about the task + /// + /// + /// Name of the resource group + /// + /// + /// Name of the service + /// + /// + /// Name of the Task + /// + public static ProjectTask Update(this IServiceTasksOperations operations, ProjectTask parameters, string groupName, string serviceName, string taskName) + { + return operations.UpdateAsync(parameters, groupName, serviceName, taskName).GetAwaiter().GetResult(); + } + + /// + /// Create or update service task + /// + /// + /// The service tasks resource is a nested, proxy-only resource representing + /// work performed by a DMS instance. The PATCH method updates an existing + /// service task, but since service tasks have no mutable custom properties, + /// there is little reason to do so. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Information about the task + /// + /// + /// Name of the resource group + /// + /// + /// Name of the service + /// + /// + /// Name of the Task + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IServiceTasksOperations operations, ProjectTask parameters, string groupName, string serviceName, string taskName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(parameters, groupName, serviceName, taskName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Cancel a service task + /// + /// + /// The service tasks resource is a nested, proxy-only resource representing + /// work performed by a DMS instance. This method cancels a service task if + /// it's currently queued or running. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group + /// + /// + /// Name of the service + /// + /// + /// Name of the Task + /// + public static ProjectTask Cancel(this IServiceTasksOperations operations, string groupName, string serviceName, string taskName) + { + return operations.CancelAsync(groupName, serviceName, taskName).GetAwaiter().GetResult(); + } + + /// + /// Cancel a service task + /// + /// + /// The service tasks resource is a nested, proxy-only resource representing + /// work performed by a DMS instance. This method cancels a service task if + /// it's currently queued or running. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the resource group + /// + /// + /// Name of the service + /// + /// + /// Name of the Task + /// + /// + /// The cancellation token. + /// + public static async Task CancelAsync(this IServiceTasksOperations operations, string groupName, string serviceName, string taskName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CancelWithHttpMessagesAsync(groupName, serviceName, taskName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get service level tasks for a service + /// + /// + /// The services resource is the top-level resource that represents the + /// Database Migration Service. This method returns a list of service level + /// tasks owned by a service resource. Some tasks may have a status of Unknown, + /// which indicates that an error occurred while querying the status of that + /// task. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IServiceTasksOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Get service level tasks for a service + /// + /// + /// The services resource is the top-level resource that represents the + /// Database Migration Service. This method returns a list of service level + /// tasks owned by a service resource. Some tasks may have a status of Unknown, + /// which indicates that an error occurred while querying the status of that + /// task. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IServiceTasksOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +}