azure_mgmt_data_migration 0.17.1 → 0.17.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (144) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2017-11-15-preview/generated/azure_mgmt_data_migration/data_migration_service_client.rb +1 -1
  3. data/lib/2017-11-15-preview/generated/azure_mgmt_data_migration/operations.rb +4 -0
  4. data/lib/2017-11-15-preview/generated/azure_mgmt_data_migration/projects.rb +12 -0
  5. data/lib/2017-11-15-preview/generated/azure_mgmt_data_migration/resource_skus.rb +4 -0
  6. data/lib/2017-11-15-preview/generated/azure_mgmt_data_migration/services.rb +30 -0
  7. data/lib/2017-11-15-preview/generated/azure_mgmt_data_migration/tasks.rb +14 -0
  8. data/lib/2017-11-15-preview/generated/azure_mgmt_data_migration/usages.rb +4 -0
  9. data/lib/2018-03-15-preview/generated/azure_mgmt_data_migration/data_migration_service_client.rb +1 -1
  10. data/lib/2018-03-15-preview/generated/azure_mgmt_data_migration/operations.rb +4 -0
  11. data/lib/2018-03-15-preview/generated/azure_mgmt_data_migration/projects.rb +12 -0
  12. data/lib/2018-03-15-preview/generated/azure_mgmt_data_migration/resource_skus.rb +4 -0
  13. data/lib/2018-03-15-preview/generated/azure_mgmt_data_migration/services.rb +30 -0
  14. data/lib/2018-03-15-preview/generated/azure_mgmt_data_migration/tasks.rb +14 -0
  15. data/lib/2018-03-15-preview/generated/azure_mgmt_data_migration/usages.rb +4 -0
  16. data/lib/2018-03-31-preview/generated/azure_mgmt_data_migration/data_migration_service_client.rb +1 -1
  17. data/lib/2018-03-31-preview/generated/azure_mgmt_data_migration/operations.rb +4 -0
  18. data/lib/2018-03-31-preview/generated/azure_mgmt_data_migration/projects.rb +12 -0
  19. data/lib/2018-03-31-preview/generated/azure_mgmt_data_migration/resource_skus.rb +4 -0
  20. data/lib/2018-03-31-preview/generated/azure_mgmt_data_migration/services.rb +30 -0
  21. data/lib/2018-03-31-preview/generated/azure_mgmt_data_migration/tasks.rb +14 -0
  22. data/lib/2018-03-31-preview/generated/azure_mgmt_data_migration/usages.rb +4 -0
  23. data/lib/2018-04-19/generated/azure_mgmt_data_migration/data_migration_service_client.rb +1 -1
  24. data/lib/2018-04-19/generated/azure_mgmt_data_migration/operations.rb +4 -0
  25. data/lib/2018-04-19/generated/azure_mgmt_data_migration/projects.rb +12 -0
  26. data/lib/2018-04-19/generated/azure_mgmt_data_migration/resource_skus.rb +4 -0
  27. data/lib/2018-04-19/generated/azure_mgmt_data_migration/services.rb +30 -0
  28. data/lib/2018-04-19/generated/azure_mgmt_data_migration/tasks.rb +14 -0
  29. data/lib/2018-04-19/generated/azure_mgmt_data_migration/usages.rb +4 -0
  30. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration.rb +151 -86
  31. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/data_migration_service_client.rb +5 -1
  32. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/files.rb +16 -0
  33. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/azure_active_directory_app.rb +70 -0
  34. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/backup_file_info.rb +70 -0
  35. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/backup_file_status.rb +21 -0
  36. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/backup_set_info.rb +158 -0
  37. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/check_ocidriver_task_input.rb +47 -0
  38. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/check_ocidriver_task_output.rb +86 -0
  39. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/check_ocidriver_task_properties.rb +147 -0
  40. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/command_properties.rb +1 -0
  41. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/connect_to_mongo_db_task_properties.rb +16 -0
  42. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/connect_to_source_my_sql_task_input.rb +3 -2
  43. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/connect_to_source_my_sql_task_properties.rb +16 -0
  44. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/connect_to_source_non_sql_task_output.rb +1 -1
  45. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/connect_to_source_oracle_sync_task_input.rb +48 -0
  46. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/connect_to_source_oracle_sync_task_output.rb +101 -0
  47. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/connect_to_source_oracle_sync_task_properties.rb +147 -0
  48. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/connect_to_source_postgre_sql_sync_task_input.rb +49 -0
  49. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/connect_to_source_postgre_sql_sync_task_output.rb +114 -0
  50. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/connect_to_source_postgre_sql_sync_task_properties.rb +149 -0
  51. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/connect_to_source_sql_server_sync_task_properties.rb +16 -0
  52. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/connect_to_source_sql_server_task_input.rb +2 -1
  53. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/connect_to_source_sql_server_task_output_agent_job_level.rb +1 -1
  54. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/connect_to_source_sql_server_task_output_login_level.rb +1 -1
  55. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/connect_to_source_sql_server_task_properties.rb +16 -0
  56. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/connect_to_target_azure_db_for_my_sql_task_properties.rb +16 -0
  57. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/connect_to_target_azure_db_for_postgre_sql_sync_task_input.rb +63 -0
  58. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/connect_to_target_azure_db_for_postgre_sql_sync_task_output.rb +115 -0
  59. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/connect_to_target_azure_db_for_postgre_sql_sync_task_properties.rb +149 -0
  60. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/connect_to_target_oracle_azure_db_for_postgre_sql_sync_task_input.rb +50 -0
  61. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/connect_to_target_oracle_azure_db_for_postgre_sql_sync_task_output.rb +125 -0
  62. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/connect_to_target_oracle_azure_db_for_postgre_sql_sync_task_output_database_schema_map_item.rb +68 -0
  63. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/connect_to_target_oracle_azure_db_for_postgre_sql_sync_task_properties.rb +152 -0
  64. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/connect_to_target_sql_db_task_properties.rb +16 -0
  65. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/connect_to_target_sql_misync_task_input.rb +63 -0
  66. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/connect_to_target_sql_misync_task_output.rb +81 -0
  67. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/connect_to_target_sql_misync_task_properties.rb +148 -0
  68. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/connect_to_target_sql_mitask_properties.rb +16 -0
  69. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/connect_to_target_sql_sql_db_sync_task_properties.rb +16 -0
  70. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/connection_info.rb +2 -0
  71. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/database_migration_state.rb +24 -0
  72. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/get_tde_certificates_sql_task_properties.rb +16 -0
  73. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/get_user_tables_oracle_task_input.rb +69 -0
  74. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/get_user_tables_oracle_task_output.rb +92 -0
  75. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/get_user_tables_oracle_task_properties.rb +148 -0
  76. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/get_user_tables_postgre_sql_task_input.rb +69 -0
  77. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/get_user_tables_postgre_sql_task_output.rb +92 -0
  78. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/get_user_tables_postgre_sql_task_properties.rb +148 -0
  79. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/get_user_tables_sql_sync_task_properties.rb +16 -0
  80. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/get_user_tables_sql_task_properties.rb +16 -0
  81. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/install_ocidriver_task_input.rb +46 -0
  82. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/install_ocidriver_task_output.rb +56 -0
  83. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/install_ocidriver_task_properties.rb +147 -0
  84. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/mi_sql_connection_info.rb +78 -0
  85. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/migrate_misync_complete_command_input.rb +47 -0
  86. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/migrate_misync_complete_command_output.rb +57 -0
  87. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/migrate_misync_complete_command_properties.rb +104 -0
  88. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/migrate_mongo_db_task_properties.rb +16 -0
  89. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/migrate_my_sql_azure_db_for_my_sql_sync_database_input.rb +60 -0
  90. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/migrate_my_sql_azure_db_for_my_sql_sync_task_properties.rb +16 -0
  91. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/migrate_oracle_azure_db_for_postgre_sql_sync_task_properties.rb +151 -0
  92. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/migrate_oracle_azure_db_postgre_sql_sync_database_input.rb +150 -0
  93. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/migrate_oracle_azure_db_postgre_sql_sync_task_input.rb +83 -0
  94. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/migrate_oracle_azure_db_postgre_sql_sync_task_output.rb +64 -0
  95. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/migrate_oracle_azure_db_postgre_sql_sync_task_output_database_error.rb +92 -0
  96. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/migrate_oracle_azure_db_postgre_sql_sync_task_output_database_level.rb +245 -0
  97. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/migrate_oracle_azure_db_postgre_sql_sync_task_output_error.rb +74 -0
  98. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/migrate_oracle_azure_db_postgre_sql_sync_task_output_migration_level.rb +133 -0
  99. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/migrate_oracle_azure_db_postgre_sql_sync_task_output_table_level.rb +219 -0
  100. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/migrate_postgre_sql_azure_db_for_postgre_sql_sync_database_input.rb +60 -0
  101. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/migrate_postgre_sql_azure_db_for_postgre_sql_sync_task_properties.rb +16 -0
  102. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/migrate_schema_sql_server_sql_db_task_properties.rb +16 -0
  103. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/migrate_sql_server_sql_db_sync_task_properties.rb +16 -0
  104. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/migrate_sql_server_sql_db_task_properties.rb +16 -0
  105. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/migrate_sql_server_sql_misync_task_input.rb +97 -0
  106. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/migrate_sql_server_sql_misync_task_output.rb +61 -0
  107. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/migrate_sql_server_sql_misync_task_output_database_level.rb +220 -0
  108. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/migrate_sql_server_sql_misync_task_output_error.rb +73 -0
  109. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/migrate_sql_server_sql_misync_task_output_migration_level.rb +195 -0
  110. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/migrate_sql_server_sql_misync_task_properties.rb +150 -0
  111. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/migrate_sql_server_sql_mitask_output_migration_level.rb +9 -9
  112. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/migrate_sql_server_sql_mitask_properties.rb +16 -0
  113. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/migrate_sync_complete_command_output.rb +13 -0
  114. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/my_sql_target_platform_type.rb +1 -0
  115. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/oracle_connection_info.rb +77 -0
  116. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/oracle_ocidriver_info.rb +118 -0
  117. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/orphaned_user_info.rb +57 -0
  118. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/project_file_properties.rb +1 -1
  119. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/project_task_properties.rb +34 -0
  120. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/resource_sku_capabilities.rb +1 -1
  121. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/selected_certificate_input.rb +1 -1
  122. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/server_properties.rb +1 -1
  123. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/sql_server_sql_misync_task_input.rb +121 -0
  124. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/upload_ocidriver_task_input.rb +47 -0
  125. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/upload_ocidriver_task_output.rb +69 -0
  126. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/upload_ocidriver_task_properties.rb +147 -0
  127. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/validate_migration_input_sql_server_sql_db_sync_task_properties.rb +16 -0
  128. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/validate_migration_input_sql_server_sql_misync_task_input.rb +98 -0
  129. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/validate_migration_input_sql_server_sql_misync_task_output.rb +83 -0
  130. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/validate_migration_input_sql_server_sql_misync_task_properties.rb +149 -0
  131. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/validate_migration_input_sql_server_sql_mitask_properties.rb +16 -0
  132. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/validate_mongo_db_task_properties.rb +16 -0
  133. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/validate_oracle_azure_db_for_postgre_sql_sync_task_properties.rb +149 -0
  134. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/validate_oracle_azure_db_postgre_sql_sync_task_output.rb +59 -0
  135. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/operations.rb +4 -0
  136. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/projects.rb +12 -0
  137. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/resource_skus.rb +4 -0
  138. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/service_tasks.rb +855 -0
  139. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/services.rb +30 -0
  140. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/tasks.rb +19 -3
  141. data/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/usages.rb +4 -0
  142. data/lib/profiles/latest/modules/datamigration_profile_module.rb +534 -276
  143. data/lib/version.rb +1 -1
  144. metadata +69 -4
@@ -94,6 +94,8 @@ module Azure::DataMigration::Mgmt::V2018_07_15_preview
94
94
  end
95
95
 
96
96
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
97
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
98
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
97
99
  # Deserialize Response
98
100
  if status_code == 200
99
101
  begin
@@ -188,6 +190,8 @@ module Azure::DataMigration::Mgmt::V2018_07_15_preview
188
190
  end
189
191
 
190
192
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
193
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
194
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
191
195
  # Deserialize Response
192
196
  if status_code == 200
193
197
  begin
@@ -0,0 +1,855 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::DataMigration::Mgmt::V2018_07_15_preview
7
+ #
8
+ # Data Migration Client
9
+ #
10
+ class ServiceTasks
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the ServiceTasks class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [DataMigrationServiceClient] reference to the DataMigrationServiceClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Get service level tasks for a service
26
+ #
27
+ # The services resource is the top-level resource that represents the Database
28
+ # Migration Service. This method returns a list of service level tasks owned by
29
+ # a service resource. Some tasks may have a status of Unknown, which indicates
30
+ # that an error occurred while querying the status of that task.
31
+ #
32
+ # @param group_name [String] Name of the resource group
33
+ # @param service_name [String] Name of the service
34
+ # @param task_type [String] Filter tasks by task type
35
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
36
+ # will be added to the HTTP request.
37
+ #
38
+ # @return [Array<ProjectTask>] operation results.
39
+ #
40
+ def list(group_name, service_name, task_type:nil, custom_headers:nil)
41
+ first_page = list_as_lazy(group_name, service_name, task_type:task_type, custom_headers:custom_headers)
42
+ first_page.get_all_items
43
+ end
44
+
45
+ #
46
+ # Get service level tasks for a service
47
+ #
48
+ # The services resource is the top-level resource that represents the Database
49
+ # Migration Service. This method returns a list of service level tasks owned by
50
+ # a service resource. Some tasks may have a status of Unknown, which indicates
51
+ # that an error occurred while querying the status of that task.
52
+ #
53
+ # @param group_name [String] Name of the resource group
54
+ # @param service_name [String] Name of the service
55
+ # @param task_type [String] Filter tasks by task type
56
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
57
+ # will be added to the HTTP request.
58
+ #
59
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
60
+ #
61
+ def list_with_http_info(group_name, service_name, task_type:nil, custom_headers:nil)
62
+ list_async(group_name, service_name, task_type:task_type, custom_headers:custom_headers).value!
63
+ end
64
+
65
+ #
66
+ # Get service level tasks for a service
67
+ #
68
+ # The services resource is the top-level resource that represents the Database
69
+ # Migration Service. This method returns a list of service level tasks owned by
70
+ # a service resource. Some tasks may have a status of Unknown, which indicates
71
+ # that an error occurred while querying the status of that task.
72
+ #
73
+ # @param group_name [String] Name of the resource group
74
+ # @param service_name [String] Name of the service
75
+ # @param task_type [String] Filter tasks by task type
76
+ # @param [Hash{String => String}] A hash of custom headers that will be added
77
+ # to the HTTP request.
78
+ #
79
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
80
+ #
81
+ def list_async(group_name, service_name, task_type:nil, custom_headers:nil)
82
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
83
+ fail ArgumentError, 'group_name is nil' if group_name.nil?
84
+ fail ArgumentError, 'service_name is nil' if service_name.nil?
85
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
86
+
87
+
88
+ request_headers = {}
89
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
90
+
91
+ # Set Headers
92
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
93
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
94
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/serviceTasks'
95
+
96
+ request_url = @base_url || @client.base_url
97
+
98
+ options = {
99
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
100
+ path_params: {'subscriptionId' => @client.subscription_id,'groupName' => group_name,'serviceName' => service_name},
101
+ query_params: {'api-version' => @client.api_version,'taskType' => task_type},
102
+ headers: request_headers.merge(custom_headers || {}),
103
+ base_url: request_url
104
+ }
105
+ promise = @client.make_request_async(:get, path_template, options)
106
+
107
+ promise = promise.then do |result|
108
+ http_response = result.response
109
+ status_code = http_response.status
110
+ response_content = http_response.body
111
+ unless status_code == 200
112
+ error_model = JSON.load(response_content)
113
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
114
+ end
115
+
116
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
117
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
118
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
119
+ # Deserialize Response
120
+ if status_code == 200
121
+ begin
122
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
123
+ result_mapper = Azure::DataMigration::Mgmt::V2018_07_15_preview::Models::TaskList.mapper()
124
+ result.body = @client.deserialize(result_mapper, parsed_response)
125
+ rescue Exception => e
126
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
127
+ end
128
+ end
129
+
130
+ result
131
+ end
132
+
133
+ promise.execute
134
+ end
135
+
136
+ #
137
+ # Create or update service task
138
+ #
139
+ # The service tasks resource is a nested, proxy-only resource representing work
140
+ # performed by a DMS instance. The PUT method creates a new service task or
141
+ # updates an existing one, although since service tasks have no mutable custom
142
+ # properties, there is little reason to update an existing one.
143
+ #
144
+ # @param parameters [ProjectTask] Information about the task
145
+ # @param group_name [String] Name of the resource group
146
+ # @param service_name [String] Name of the service
147
+ # @param task_name [String] Name of the Task
148
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
149
+ # will be added to the HTTP request.
150
+ #
151
+ # @return [ProjectTask] operation results.
152
+ #
153
+ def create_or_update(parameters, group_name, service_name, task_name, custom_headers:nil)
154
+ response = create_or_update_async(parameters, group_name, service_name, task_name, custom_headers:custom_headers).value!
155
+ response.body unless response.nil?
156
+ end
157
+
158
+ #
159
+ # Create or update service task
160
+ #
161
+ # The service tasks resource is a nested, proxy-only resource representing work
162
+ # performed by a DMS instance. The PUT method creates a new service task or
163
+ # updates an existing one, although since service tasks have no mutable custom
164
+ # properties, there is little reason to update an existing one.
165
+ #
166
+ # @param parameters [ProjectTask] Information about the task
167
+ # @param group_name [String] Name of the resource group
168
+ # @param service_name [String] Name of the service
169
+ # @param task_name [String] Name of the Task
170
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
171
+ # will be added to the HTTP request.
172
+ #
173
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
174
+ #
175
+ def create_or_update_with_http_info(parameters, group_name, service_name, task_name, custom_headers:nil)
176
+ create_or_update_async(parameters, group_name, service_name, task_name, custom_headers:custom_headers).value!
177
+ end
178
+
179
+ #
180
+ # Create or update service task
181
+ #
182
+ # The service tasks resource is a nested, proxy-only resource representing work
183
+ # performed by a DMS instance. The PUT method creates a new service task or
184
+ # updates an existing one, although since service tasks have no mutable custom
185
+ # properties, there is little reason to update an existing one.
186
+ #
187
+ # @param parameters [ProjectTask] Information about the task
188
+ # @param group_name [String] Name of the resource group
189
+ # @param service_name [String] Name of the service
190
+ # @param task_name [String] Name of the Task
191
+ # @param [Hash{String => String}] A hash of custom headers that will be added
192
+ # to the HTTP request.
193
+ #
194
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
195
+ #
196
+ def create_or_update_async(parameters, group_name, service_name, task_name, custom_headers:nil)
197
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
198
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
199
+ fail ArgumentError, 'group_name is nil' if group_name.nil?
200
+ fail ArgumentError, 'service_name is nil' if service_name.nil?
201
+ fail ArgumentError, 'task_name is nil' if task_name.nil?
202
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
203
+
204
+
205
+ request_headers = {}
206
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
207
+
208
+ # Set Headers
209
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
210
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
211
+
212
+ # Serialize Request
213
+ request_mapper = Azure::DataMigration::Mgmt::V2018_07_15_preview::Models::ProjectTask.mapper()
214
+ request_content = @client.serialize(request_mapper, parameters)
215
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
216
+
217
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/serviceTasks/{taskName}'
218
+
219
+ request_url = @base_url || @client.base_url
220
+
221
+ options = {
222
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
223
+ path_params: {'subscriptionId' => @client.subscription_id,'groupName' => group_name,'serviceName' => service_name,'taskName' => task_name},
224
+ query_params: {'api-version' => @client.api_version},
225
+ body: request_content,
226
+ headers: request_headers.merge(custom_headers || {}),
227
+ base_url: request_url
228
+ }
229
+ promise = @client.make_request_async(:put, path_template, options)
230
+
231
+ promise = promise.then do |result|
232
+ http_response = result.response
233
+ status_code = http_response.status
234
+ response_content = http_response.body
235
+ unless status_code == 200 || status_code == 201
236
+ error_model = JSON.load(response_content)
237
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
238
+ end
239
+
240
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
241
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
242
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
243
+ # Deserialize Response
244
+ if status_code == 200
245
+ begin
246
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
247
+ result_mapper = Azure::DataMigration::Mgmt::V2018_07_15_preview::Models::ProjectTask.mapper()
248
+ result.body = @client.deserialize(result_mapper, parsed_response)
249
+ rescue Exception => e
250
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
251
+ end
252
+ end
253
+ # Deserialize Response
254
+ if status_code == 201
255
+ begin
256
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
257
+ result_mapper = Azure::DataMigration::Mgmt::V2018_07_15_preview::Models::ProjectTask.mapper()
258
+ result.body = @client.deserialize(result_mapper, parsed_response)
259
+ rescue Exception => e
260
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
261
+ end
262
+ end
263
+
264
+ result
265
+ end
266
+
267
+ promise.execute
268
+ end
269
+
270
+ #
271
+ # Get service task information
272
+ #
273
+ # The service tasks resource is a nested, proxy-only resource representing work
274
+ # performed by a DMS instance. The GET method retrieves information about a
275
+ # service task.
276
+ #
277
+ # @param group_name [String] Name of the resource group
278
+ # @param service_name [String] Name of the service
279
+ # @param task_name [String] Name of the Task
280
+ # @param expand [String] Expand the response
281
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
282
+ # will be added to the HTTP request.
283
+ #
284
+ # @return [ProjectTask] operation results.
285
+ #
286
+ def get(group_name, service_name, task_name, expand:nil, custom_headers:nil)
287
+ response = get_async(group_name, service_name, task_name, expand:expand, custom_headers:custom_headers).value!
288
+ response.body unless response.nil?
289
+ end
290
+
291
+ #
292
+ # Get service task information
293
+ #
294
+ # The service tasks resource is a nested, proxy-only resource representing work
295
+ # performed by a DMS instance. The GET method retrieves information about a
296
+ # service task.
297
+ #
298
+ # @param group_name [String] Name of the resource group
299
+ # @param service_name [String] Name of the service
300
+ # @param task_name [String] Name of the Task
301
+ # @param expand [String] Expand the response
302
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
303
+ # will be added to the HTTP request.
304
+ #
305
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
306
+ #
307
+ def get_with_http_info(group_name, service_name, task_name, expand:nil, custom_headers:nil)
308
+ get_async(group_name, service_name, task_name, expand:expand, custom_headers:custom_headers).value!
309
+ end
310
+
311
+ #
312
+ # Get service task information
313
+ #
314
+ # The service tasks resource is a nested, proxy-only resource representing work
315
+ # performed by a DMS instance. The GET method retrieves information about a
316
+ # service task.
317
+ #
318
+ # @param group_name [String] Name of the resource group
319
+ # @param service_name [String] Name of the service
320
+ # @param task_name [String] Name of the Task
321
+ # @param expand [String] Expand the response
322
+ # @param [Hash{String => String}] A hash of custom headers that will be added
323
+ # to the HTTP request.
324
+ #
325
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
326
+ #
327
+ def get_async(group_name, service_name, task_name, expand:nil, custom_headers:nil)
328
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
329
+ fail ArgumentError, 'group_name is nil' if group_name.nil?
330
+ fail ArgumentError, 'service_name is nil' if service_name.nil?
331
+ fail ArgumentError, 'task_name is nil' if task_name.nil?
332
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
333
+
334
+
335
+ request_headers = {}
336
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
337
+
338
+ # Set Headers
339
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
340
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
341
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/serviceTasks/{taskName}'
342
+
343
+ request_url = @base_url || @client.base_url
344
+
345
+ options = {
346
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
347
+ path_params: {'subscriptionId' => @client.subscription_id,'groupName' => group_name,'serviceName' => service_name,'taskName' => task_name},
348
+ query_params: {'$expand' => expand,'api-version' => @client.api_version},
349
+ headers: request_headers.merge(custom_headers || {}),
350
+ base_url: request_url
351
+ }
352
+ promise = @client.make_request_async(:get, path_template, options)
353
+
354
+ promise = promise.then do |result|
355
+ http_response = result.response
356
+ status_code = http_response.status
357
+ response_content = http_response.body
358
+ unless status_code == 200
359
+ error_model = JSON.load(response_content)
360
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
361
+ end
362
+
363
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
364
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
365
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
366
+ # Deserialize Response
367
+ if status_code == 200
368
+ begin
369
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
370
+ result_mapper = Azure::DataMigration::Mgmt::V2018_07_15_preview::Models::ProjectTask.mapper()
371
+ result.body = @client.deserialize(result_mapper, parsed_response)
372
+ rescue Exception => e
373
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
374
+ end
375
+ end
376
+
377
+ result
378
+ end
379
+
380
+ promise.execute
381
+ end
382
+
383
+ #
384
+ # Delete service task
385
+ #
386
+ # The service tasks resource is a nested, proxy-only resource representing work
387
+ # performed by a DMS instance. The DELETE method deletes a service task,
388
+ # canceling it first if it's running.
389
+ #
390
+ # @param group_name [String] Name of the resource group
391
+ # @param service_name [String] Name of the service
392
+ # @param task_name [String] Name of the Task
393
+ # @param delete_running_tasks [Boolean] Delete the resource even if it contains
394
+ # running tasks
395
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
396
+ # will be added to the HTTP request.
397
+ #
398
+ #
399
+ def delete(group_name, service_name, task_name, delete_running_tasks:nil, custom_headers:nil)
400
+ response = delete_async(group_name, service_name, task_name, delete_running_tasks:delete_running_tasks, custom_headers:custom_headers).value!
401
+ nil
402
+ end
403
+
404
+ #
405
+ # Delete service task
406
+ #
407
+ # The service tasks resource is a nested, proxy-only resource representing work
408
+ # performed by a DMS instance. The DELETE method deletes a service task,
409
+ # canceling it first if it's running.
410
+ #
411
+ # @param group_name [String] Name of the resource group
412
+ # @param service_name [String] Name of the service
413
+ # @param task_name [String] Name of the Task
414
+ # @param delete_running_tasks [Boolean] Delete the resource even if it contains
415
+ # running tasks
416
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
417
+ # will be added to the HTTP request.
418
+ #
419
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
420
+ #
421
+ def delete_with_http_info(group_name, service_name, task_name, delete_running_tasks:nil, custom_headers:nil)
422
+ delete_async(group_name, service_name, task_name, delete_running_tasks:delete_running_tasks, custom_headers:custom_headers).value!
423
+ end
424
+
425
+ #
426
+ # Delete service task
427
+ #
428
+ # The service tasks resource is a nested, proxy-only resource representing work
429
+ # performed by a DMS instance. The DELETE method deletes a service task,
430
+ # canceling it first if it's running.
431
+ #
432
+ # @param group_name [String] Name of the resource group
433
+ # @param service_name [String] Name of the service
434
+ # @param task_name [String] Name of the Task
435
+ # @param delete_running_tasks [Boolean] Delete the resource even if it contains
436
+ # running tasks
437
+ # @param [Hash{String => String}] A hash of custom headers that will be added
438
+ # to the HTTP request.
439
+ #
440
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
441
+ #
442
+ def delete_async(group_name, service_name, task_name, delete_running_tasks:nil, custom_headers:nil)
443
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
444
+ fail ArgumentError, 'group_name is nil' if group_name.nil?
445
+ fail ArgumentError, 'service_name is nil' if service_name.nil?
446
+ fail ArgumentError, 'task_name is nil' if task_name.nil?
447
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
448
+
449
+
450
+ request_headers = {}
451
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
452
+
453
+ # Set Headers
454
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
455
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
456
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/serviceTasks/{taskName}'
457
+
458
+ request_url = @base_url || @client.base_url
459
+
460
+ options = {
461
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
462
+ path_params: {'subscriptionId' => @client.subscription_id,'groupName' => group_name,'serviceName' => service_name,'taskName' => task_name},
463
+ query_params: {'deleteRunningTasks' => delete_running_tasks,'api-version' => @client.api_version},
464
+ headers: request_headers.merge(custom_headers || {}),
465
+ base_url: request_url
466
+ }
467
+ promise = @client.make_request_async(:delete, path_template, options)
468
+
469
+ promise = promise.then do |result|
470
+ http_response = result.response
471
+ status_code = http_response.status
472
+ response_content = http_response.body
473
+ unless status_code == 200 || status_code == 204
474
+ error_model = JSON.load(response_content)
475
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
476
+ end
477
+
478
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
479
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
480
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
481
+
482
+ result
483
+ end
484
+
485
+ promise.execute
486
+ end
487
+
488
+ #
489
+ # Create or update service task
490
+ #
491
+ # The service tasks resource is a nested, proxy-only resource representing work
492
+ # performed by a DMS instance. The PATCH method updates an existing service
493
+ # task, but since service tasks have no mutable custom properties, there is
494
+ # little reason to do so.
495
+ #
496
+ # @param parameters [ProjectTask] Information about the task
497
+ # @param group_name [String] Name of the resource group
498
+ # @param service_name [String] Name of the service
499
+ # @param task_name [String] Name of the Task
500
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
501
+ # will be added to the HTTP request.
502
+ #
503
+ # @return [ProjectTask] operation results.
504
+ #
505
+ def update(parameters, group_name, service_name, task_name, custom_headers:nil)
506
+ response = update_async(parameters, group_name, service_name, task_name, custom_headers:custom_headers).value!
507
+ response.body unless response.nil?
508
+ end
509
+
510
+ #
511
+ # Create or update service task
512
+ #
513
+ # The service tasks resource is a nested, proxy-only resource representing work
514
+ # performed by a DMS instance. The PATCH method updates an existing service
515
+ # task, but since service tasks have no mutable custom properties, there is
516
+ # little reason to do so.
517
+ #
518
+ # @param parameters [ProjectTask] Information about the task
519
+ # @param group_name [String] Name of the resource group
520
+ # @param service_name [String] Name of the service
521
+ # @param task_name [String] Name of the Task
522
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
523
+ # will be added to the HTTP request.
524
+ #
525
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
526
+ #
527
+ def update_with_http_info(parameters, group_name, service_name, task_name, custom_headers:nil)
528
+ update_async(parameters, group_name, service_name, task_name, custom_headers:custom_headers).value!
529
+ end
530
+
531
+ #
532
+ # Create or update service task
533
+ #
534
+ # The service tasks resource is a nested, proxy-only resource representing work
535
+ # performed by a DMS instance. The PATCH method updates an existing service
536
+ # task, but since service tasks have no mutable custom properties, there is
537
+ # little reason to do so.
538
+ #
539
+ # @param parameters [ProjectTask] Information about the task
540
+ # @param group_name [String] Name of the resource group
541
+ # @param service_name [String] Name of the service
542
+ # @param task_name [String] Name of the Task
543
+ # @param [Hash{String => String}] A hash of custom headers that will be added
544
+ # to the HTTP request.
545
+ #
546
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
547
+ #
548
+ def update_async(parameters, group_name, service_name, task_name, custom_headers:nil)
549
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
550
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
551
+ fail ArgumentError, 'group_name is nil' if group_name.nil?
552
+ fail ArgumentError, 'service_name is nil' if service_name.nil?
553
+ fail ArgumentError, 'task_name is nil' if task_name.nil?
554
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
555
+
556
+
557
+ request_headers = {}
558
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
559
+
560
+ # Set Headers
561
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
562
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
563
+
564
+ # Serialize Request
565
+ request_mapper = Azure::DataMigration::Mgmt::V2018_07_15_preview::Models::ProjectTask.mapper()
566
+ request_content = @client.serialize(request_mapper, parameters)
567
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
568
+
569
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/serviceTasks/{taskName}'
570
+
571
+ request_url = @base_url || @client.base_url
572
+
573
+ options = {
574
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
575
+ path_params: {'subscriptionId' => @client.subscription_id,'groupName' => group_name,'serviceName' => service_name,'taskName' => task_name},
576
+ query_params: {'api-version' => @client.api_version},
577
+ body: request_content,
578
+ headers: request_headers.merge(custom_headers || {}),
579
+ base_url: request_url
580
+ }
581
+ promise = @client.make_request_async(:patch, path_template, options)
582
+
583
+ promise = promise.then do |result|
584
+ http_response = result.response
585
+ status_code = http_response.status
586
+ response_content = http_response.body
587
+ unless status_code == 200
588
+ error_model = JSON.load(response_content)
589
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
590
+ end
591
+
592
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
593
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
594
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
595
+ # Deserialize Response
596
+ if status_code == 200
597
+ begin
598
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
599
+ result_mapper = Azure::DataMigration::Mgmt::V2018_07_15_preview::Models::ProjectTask.mapper()
600
+ result.body = @client.deserialize(result_mapper, parsed_response)
601
+ rescue Exception => e
602
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
603
+ end
604
+ end
605
+
606
+ result
607
+ end
608
+
609
+ promise.execute
610
+ end
611
+
612
+ #
613
+ # Cancel a service task
614
+ #
615
+ # The service tasks resource is a nested, proxy-only resource representing work
616
+ # performed by a DMS instance. This method cancels a service task if it's
617
+ # currently queued or running.
618
+ #
619
+ # @param group_name [String] Name of the resource group
620
+ # @param service_name [String] Name of the service
621
+ # @param task_name [String] Name of the Task
622
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
623
+ # will be added to the HTTP request.
624
+ #
625
+ # @return [ProjectTask] operation results.
626
+ #
627
+ def cancel(group_name, service_name, task_name, custom_headers:nil)
628
+ response = cancel_async(group_name, service_name, task_name, custom_headers:custom_headers).value!
629
+ response.body unless response.nil?
630
+ end
631
+
632
+ #
633
+ # Cancel a service task
634
+ #
635
+ # The service tasks resource is a nested, proxy-only resource representing work
636
+ # performed by a DMS instance. This method cancels a service task if it's
637
+ # currently queued or running.
638
+ #
639
+ # @param group_name [String] Name of the resource group
640
+ # @param service_name [String] Name of the service
641
+ # @param task_name [String] Name of the Task
642
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
643
+ # will be added to the HTTP request.
644
+ #
645
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
646
+ #
647
+ def cancel_with_http_info(group_name, service_name, task_name, custom_headers:nil)
648
+ cancel_async(group_name, service_name, task_name, custom_headers:custom_headers).value!
649
+ end
650
+
651
+ #
652
+ # Cancel a service task
653
+ #
654
+ # The service tasks resource is a nested, proxy-only resource representing work
655
+ # performed by a DMS instance. This method cancels a service task if it's
656
+ # currently queued or running.
657
+ #
658
+ # @param group_name [String] Name of the resource group
659
+ # @param service_name [String] Name of the service
660
+ # @param task_name [String] Name of the Task
661
+ # @param [Hash{String => String}] A hash of custom headers that will be added
662
+ # to the HTTP request.
663
+ #
664
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
665
+ #
666
+ def cancel_async(group_name, service_name, task_name, custom_headers:nil)
667
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
668
+ fail ArgumentError, 'group_name is nil' if group_name.nil?
669
+ fail ArgumentError, 'service_name is nil' if service_name.nil?
670
+ fail ArgumentError, 'task_name is nil' if task_name.nil?
671
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
672
+
673
+
674
+ request_headers = {}
675
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
676
+
677
+ # Set Headers
678
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
679
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
680
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}/serviceTasks/{taskName}/cancel'
681
+
682
+ request_url = @base_url || @client.base_url
683
+
684
+ options = {
685
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
686
+ path_params: {'subscriptionId' => @client.subscription_id,'groupName' => group_name,'serviceName' => service_name,'taskName' => task_name},
687
+ query_params: {'api-version' => @client.api_version},
688
+ headers: request_headers.merge(custom_headers || {}),
689
+ base_url: request_url
690
+ }
691
+ promise = @client.make_request_async(:post, path_template, options)
692
+
693
+ promise = promise.then do |result|
694
+ http_response = result.response
695
+ status_code = http_response.status
696
+ response_content = http_response.body
697
+ unless status_code == 200
698
+ error_model = JSON.load(response_content)
699
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
700
+ end
701
+
702
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
703
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
704
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
705
+ # Deserialize Response
706
+ if status_code == 200
707
+ begin
708
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
709
+ result_mapper = Azure::DataMigration::Mgmt::V2018_07_15_preview::Models::ProjectTask.mapper()
710
+ result.body = @client.deserialize(result_mapper, parsed_response)
711
+ rescue Exception => e
712
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
713
+ end
714
+ end
715
+
716
+ result
717
+ end
718
+
719
+ promise.execute
720
+ end
721
+
722
+ #
723
+ # Get service level tasks for a service
724
+ #
725
+ # The services resource is the top-level resource that represents the Database
726
+ # Migration Service. This method returns a list of service level tasks owned by
727
+ # a service resource. Some tasks may have a status of Unknown, which indicates
728
+ # that an error occurred while querying the status of that task.
729
+ #
730
+ # @param next_page_link [String] The NextLink from the previous successful call
731
+ # to List operation.
732
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
733
+ # will be added to the HTTP request.
734
+ #
735
+ # @return [TaskList] operation results.
736
+ #
737
+ def list_next(next_page_link, custom_headers:nil)
738
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
739
+ response.body unless response.nil?
740
+ end
741
+
742
+ #
743
+ # Get service level tasks for a service
744
+ #
745
+ # The services resource is the top-level resource that represents the Database
746
+ # Migration Service. This method returns a list of service level tasks owned by
747
+ # a service resource. Some tasks may have a status of Unknown, which indicates
748
+ # that an error occurred while querying the status of that task.
749
+ #
750
+ # @param next_page_link [String] The NextLink from the previous successful call
751
+ # to List operation.
752
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
753
+ # will be added to the HTTP request.
754
+ #
755
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
756
+ #
757
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
758
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
759
+ end
760
+
761
+ #
762
+ # Get service level tasks for a service
763
+ #
764
+ # The services resource is the top-level resource that represents the Database
765
+ # Migration Service. This method returns a list of service level tasks owned by
766
+ # a service resource. Some tasks may have a status of Unknown, which indicates
767
+ # that an error occurred while querying the status of that task.
768
+ #
769
+ # @param next_page_link [String] The NextLink from the previous successful call
770
+ # to List operation.
771
+ # @param [Hash{String => String}] A hash of custom headers that will be added
772
+ # to the HTTP request.
773
+ #
774
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
775
+ #
776
+ def list_next_async(next_page_link, custom_headers:nil)
777
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
778
+
779
+
780
+ request_headers = {}
781
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
782
+
783
+ # Set Headers
784
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
785
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
786
+ path_template = '{nextLink}'
787
+
788
+ request_url = @base_url || @client.base_url
789
+
790
+ options = {
791
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
792
+ skip_encoding_path_params: {'nextLink' => next_page_link},
793
+ headers: request_headers.merge(custom_headers || {}),
794
+ base_url: request_url
795
+ }
796
+ promise = @client.make_request_async(:get, path_template, options)
797
+
798
+ promise = promise.then do |result|
799
+ http_response = result.response
800
+ status_code = http_response.status
801
+ response_content = http_response.body
802
+ unless status_code == 200
803
+ error_model = JSON.load(response_content)
804
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
805
+ end
806
+
807
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
808
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
809
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
810
+ # Deserialize Response
811
+ if status_code == 200
812
+ begin
813
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
814
+ result_mapper = Azure::DataMigration::Mgmt::V2018_07_15_preview::Models::TaskList.mapper()
815
+ result.body = @client.deserialize(result_mapper, parsed_response)
816
+ rescue Exception => e
817
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
818
+ end
819
+ end
820
+
821
+ result
822
+ end
823
+
824
+ promise.execute
825
+ end
826
+
827
+ #
828
+ # Get service level tasks for a service
829
+ #
830
+ # The services resource is the top-level resource that represents the Database
831
+ # Migration Service. This method returns a list of service level tasks owned by
832
+ # a service resource. Some tasks may have a status of Unknown, which indicates
833
+ # that an error occurred while querying the status of that task.
834
+ #
835
+ # @param group_name [String] Name of the resource group
836
+ # @param service_name [String] Name of the service
837
+ # @param task_type [String] Filter tasks by task type
838
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
839
+ # will be added to the HTTP request.
840
+ #
841
+ # @return [TaskList] which provide lazy access to pages of the response.
842
+ #
843
+ def list_as_lazy(group_name, service_name, task_type:nil, custom_headers:nil)
844
+ response = list_async(group_name, service_name, task_type:task_type, custom_headers:custom_headers).value!
845
+ unless response.nil?
846
+ page = response.body
847
+ page.next_method = Proc.new do |next_page_link|
848
+ list_next_async(next_page_link, custom_headers:custom_headers)
849
+ end
850
+ page
851
+ end
852
+ end
853
+
854
+ end
855
+ end