azure_mgmt_sql 0.17.3 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. checksums.yaml +5 -5
  2. data/lib/2014-04-01/generated/azure_mgmt_sql/backup_long_term_retention_policies.rb +6 -0
  3. data/lib/2014-04-01/generated/azure_mgmt_sql/backup_long_term_retention_vaults.rb +6 -0
  4. data/lib/2014-04-01/generated/azure_mgmt_sql/capabilities.rb +2 -0
  5. data/lib/2014-04-01/generated/azure_mgmt_sql/data_masking_policies.rb +4 -0
  6. data/lib/2014-04-01/generated/azure_mgmt_sql/data_masking_rules.rb +4 -0
  7. data/lib/2014-04-01/generated/azure_mgmt_sql/database_advisors.rb +6 -0
  8. data/lib/2014-04-01/generated/azure_mgmt_sql/database_connection_policies.rb +4 -0
  9. data/lib/2014-04-01/generated/azure_mgmt_sql/database_table_auditing_policies.rb +6 -0
  10. data/lib/2014-04-01/generated/azure_mgmt_sql/database_threat_detection_policies.rb +4 -0
  11. data/lib/2014-04-01/generated/azure_mgmt_sql/database_usages.rb +2 -0
  12. data/lib/2014-04-01/generated/azure_mgmt_sql/databases.rb +32 -0
  13. data/lib/2014-04-01/generated/azure_mgmt_sql/disaster_recovery_configurations.rb +12 -0
  14. data/lib/2014-04-01/generated/azure_mgmt_sql/elastic_pool_activities.rb +2 -0
  15. data/lib/2014-04-01/generated/azure_mgmt_sql/elastic_pool_database_activities.rb +2 -0
  16. data/lib/2014-04-01/generated/azure_mgmt_sql/elastic_pools.rb +14 -0
  17. data/lib/2014-04-01/generated/azure_mgmt_sql/extensions.rb +2 -0
  18. data/lib/2014-04-01/generated/azure_mgmt_sql/firewall_rules.rb +8 -0
  19. data/lib/2014-04-01/generated/azure_mgmt_sql/geo_backup_policies.rb +6 -0
  20. data/lib/2014-04-01/generated/azure_mgmt_sql/operations.rb +2 -0
  21. data/lib/2014-04-01/generated/azure_mgmt_sql/queries.rb +2 -0
  22. data/lib/2014-04-01/generated/azure_mgmt_sql/query_statistics.rb +2 -0
  23. data/lib/2014-04-01/generated/azure_mgmt_sql/query_texts.rb +2 -0
  24. data/lib/2014-04-01/generated/azure_mgmt_sql/recommended_elastic_pools.rb +6 -0
  25. data/lib/2014-04-01/generated/azure_mgmt_sql/recoverable_databases.rb +4 -0
  26. data/lib/2014-04-01/generated/azure_mgmt_sql/replication_links.rb +10 -0
  27. data/lib/2014-04-01/generated/azure_mgmt_sql/restorable_dropped_databases.rb +4 -0
  28. data/lib/2014-04-01/generated/azure_mgmt_sql/restore_points.rb +2 -0
  29. data/lib/2014-04-01/generated/azure_mgmt_sql/server_advisors.rb +8 -0
  30. data/lib/2014-04-01/generated/azure_mgmt_sql/server_azure_adadministrators.rb +8 -0
  31. data/lib/2014-04-01/generated/azure_mgmt_sql/server_communication_links.rb +8 -0
  32. data/lib/2014-04-01/generated/azure_mgmt_sql/server_connection_policies.rb +4 -0
  33. data/lib/2014-04-01/generated/azure_mgmt_sql/server_table_auditing_policies.rb +6 -0
  34. data/lib/2014-04-01/generated/azure_mgmt_sql/server_usages.rb +2 -0
  35. data/lib/2014-04-01/generated/azure_mgmt_sql/servers.rb +14 -0
  36. data/lib/2014-04-01/generated/azure_mgmt_sql/service_objectives.rb +4 -0
  37. data/lib/2014-04-01/generated/azure_mgmt_sql/service_tier_advisors.rb +4 -0
  38. data/lib/2014-04-01/generated/azure_mgmt_sql/sql_management_client.rb +1 -1
  39. data/lib/2014-04-01/generated/azure_mgmt_sql/transparent_data_encryption_activities.rb +2 -0
  40. data/lib/2014-04-01/generated/azure_mgmt_sql/transparent_data_encryption_configurations.rb +2 -0
  41. data/lib/2014-04-01/generated/azure_mgmt_sql/transparent_data_encryptions.rb +4 -0
  42. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/database_advisors.rb +6 -0
  43. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/database_automatic_tuning_operations.rb +4 -0
  44. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/database_blob_auditing_policies.rb +4 -0
  45. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/database_recommended_actions.rb +6 -0
  46. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/encryption_protectors.rb +140 -0
  47. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/failover_groups.rb +16 -0
  48. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/firewall_rules.rb +12 -0
  49. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/managed_instances.rb +16 -210
  50. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/models/database_blob_auditing_policy.rb +2 -2
  51. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/models/encryption_protector.rb +1 -0
  52. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/models/sku.rb +7 -11
  53. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/operations.rb +4 -0
  54. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/server_advisors.rb +6 -0
  55. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/server_keys.rb +10 -0
  56. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/servers.rb +16 -0
  57. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb +1 -1
  58. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/subscription_usages.rb +6 -0
  59. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_agents.rb +16 -0
  60. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb +30 -0
  61. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_members.rb +18 -0
  62. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/virtual_clusters.rb +14 -0
  63. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/virtual_network_rules.rb +10 -0
  64. data/lib/2017-03-01-preview/generated/azure_mgmt_sql.rb +26 -23
  65. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/backup_long_term_retention_policies.rb +6 -0
  66. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/data_warehouse_user_activities_operations.rb +2 -0
  67. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/database_blob_auditing_policies.rb +4 -0
  68. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/database_operations.rb +6 -0
  69. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/database_vulnerability_assessment_rule_baselines.rb +6 -0
  70. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/database_vulnerability_assessments.rb +10 -0
  71. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/databases.rb +24 -0
  72. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/extended_database_blob_auditing_policies.rb +4 -0
  73. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/extended_server_blob_auditing_policies.rb +4 -0
  74. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/job_agents.rb +12 -0
  75. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/job_credentials.rb +10 -0
  76. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/job_executions.rb +16 -0
  77. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/job_step_executions.rb +6 -0
  78. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/job_steps.rb +16 -0
  79. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/job_target_executions.rb +10 -0
  80. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/job_target_groups.rb +10 -0
  81. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/job_versions.rb +6 -0
  82. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/jobs.rb +10 -0
  83. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/long_term_retention_backups.rb +1086 -92
  84. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/managed_backup_short_term_retention_policies.rb +10 -0
  85. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/managed_database_security_alert_policies.rb +8 -0
  86. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/managed_databases.rb +14 -0
  87. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/managed_instance_administrators.rb +663 -0
  88. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/managed_restorable_dropped_database_backup_short_term_retention_policies.rb +10 -0
  89. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/managed_server_security_alert_policies.rb +8 -0
  90. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/database_blob_auditing_policy.rb +2 -2
  91. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/extended_database_blob_auditing_policy.rb +2 -2
  92. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/extended_server_blob_auditing_policy.rb +2 -2
  93. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/managed_instance_administrator.rb +109 -0
  94. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/managed_instance_administrator_list_result.rb +101 -0
  95. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/server_blob_auditing_policy.rb +2 -2
  96. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/sku.rb +7 -11
  97. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/restorable_dropped_managed_databases.rb +6 -0
  98. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/restore_points.rb +8 -0
  99. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/sensitivity_labels.rb +18 -0
  100. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/server_automatic_tuning_operations.rb +4 -0
  101. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/server_blob_auditing_policies.rb +4 -0
  102. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/server_dns_aliases.rb +12 -0
  103. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/server_security_alert_policies.rb +8 -0
  104. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/sql_management_client.rb +5 -1
  105. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/backup_short_term_retention_policies.rb +10 -0
  106. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/capabilities.rb +2 -0
  107. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/database_operations.rb +6 -0
  108. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/database_vulnerability_assessment_scans.rb +10 -0
  109. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/databases.rb +158 -134
  110. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/elastic_pool_operations.rb +6 -0
  111. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/elastic_pools.rb +12 -0
  112. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/instance_failover_groups.rb +14 -0
  113. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/managed_database_vulnerability_assessment_rule_baselines.rb +6 -0
  114. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/managed_database_vulnerability_assessment_scans.rb +10 -0
  115. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/managed_database_vulnerability_assessments.rb +10 -0
  116. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/managed_instance_encryption_protectors.rb +140 -0
  117. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/managed_instance_keys.rb +10 -0
  118. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/managed_instance_tde_certificates.rb +2 -0
  119. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/database.rb +48 -5
  120. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/database_status.rb +1 -0
  121. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/database_update.rb +48 -5
  122. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/models/sku.rb +7 -11
  123. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/recoverable_managed_databases.rb +6 -0
  124. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/sql_management_client.rb +1 -1
  125. data/lib/2017-10-01-preview/generated/azure_mgmt_sql/tde_certificates.rb +2 -0
  126. data/lib/2018-06-01-preview/generated/azure_mgmt_sql/database_columns.rb +6 -0
  127. data/lib/2018-06-01-preview/generated/azure_mgmt_sql/database_schemas.rb +6 -0
  128. data/lib/2018-06-01-preview/generated/azure_mgmt_sql/database_security_alert_policies.rb +8 -0
  129. data/lib/2018-06-01-preview/generated/azure_mgmt_sql/database_tables.rb +6 -0
  130. data/lib/2018-06-01-preview/generated/azure_mgmt_sql/instance_pools.rb +16 -0
  131. data/lib/2018-06-01-preview/generated/azure_mgmt_sql/managed_database_columns.rb +6 -0
  132. data/lib/2018-06-01-preview/generated/azure_mgmt_sql/managed_database_schemas.rb +6 -0
  133. data/lib/2018-06-01-preview/generated/azure_mgmt_sql/managed_database_sensitivity_labels.rb +18 -0
  134. data/lib/2018-06-01-preview/generated/azure_mgmt_sql/managed_database_tables.rb +6 -0
  135. data/lib/2018-06-01-preview/generated/azure_mgmt_sql/managed_instance_vulnerability_assessments.rb +10 -0
  136. data/lib/2018-06-01-preview/generated/azure_mgmt_sql/models/sku.rb +7 -11
  137. data/lib/2018-06-01-preview/generated/azure_mgmt_sql/server_vulnerability_assessments.rb +10 -0
  138. data/lib/2018-06-01-preview/generated/azure_mgmt_sql/sql_management_client.rb +1 -1
  139. data/lib/azure_mgmt_sql.rb +1 -1
  140. data/lib/profiles/latest/modules/sql_profile_module.rb +67 -57
  141. data/lib/version.rb +1 -1
  142. metadata +8 -5
@@ -110,6 +110,8 @@ module Azure::SQL::Mgmt::V2017_03_01_preview
110
110
  end
111
111
 
112
112
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
113
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
114
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
113
115
  # Deserialize Response
114
116
  if status_code == 200
115
117
  begin
@@ -316,6 +318,8 @@ module Azure::SQL::Mgmt::V2017_03_01_preview
316
318
  end
317
319
 
318
320
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
321
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
322
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
319
323
  # Deserialize Response
320
324
  if status_code == 200
321
325
  begin
@@ -433,6 +437,8 @@ module Azure::SQL::Mgmt::V2017_03_01_preview
433
437
  end
434
438
 
435
439
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
440
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
441
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
436
442
  # Deserialize Response
437
443
  if status_code == 200
438
444
  begin
@@ -550,6 +556,8 @@ module Azure::SQL::Mgmt::V2017_03_01_preview
550
556
  end
551
557
 
552
558
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
559
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
560
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
553
561
  # Deserialize Response
554
562
  if status_code == 200
555
563
  begin
@@ -638,6 +646,8 @@ module Azure::SQL::Mgmt::V2017_03_01_preview
638
646
  end
639
647
 
640
648
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
649
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
650
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
641
651
  # Deserialize Response
642
652
  if status_code == 200
643
653
  begin
@@ -113,6 +113,8 @@ module Azure::SQL::Mgmt::V2017_03_01_preview
113
113
  end
114
114
 
115
115
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
116
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
117
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
116
118
  # Deserialize Response
117
119
  if status_code == 200
118
120
  begin
@@ -233,6 +235,8 @@ module Azure::SQL::Mgmt::V2017_03_01_preview
233
235
  end
234
236
 
235
237
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
238
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
239
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
236
240
  # Deserialize Response
237
241
  if status_code == 200
238
242
  begin
@@ -348,6 +352,8 @@ module Azure::SQL::Mgmt::V2017_03_01_preview
348
352
  end
349
353
 
350
354
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
355
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
356
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
351
357
  # Deserialize Response
352
358
  if status_code == 200
353
359
  begin
@@ -436,6 +442,8 @@ module Azure::SQL::Mgmt::V2017_03_01_preview
436
442
  end
437
443
 
438
444
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
445
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
446
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
439
447
  # Deserialize Response
440
448
  if status_code == 200
441
449
  begin
@@ -151,6 +151,8 @@ module Azure::SQL::Mgmt::V2017_03_01_preview
151
151
  end
152
152
 
153
153
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
154
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
155
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
154
156
  # Deserialize Response
155
157
  if status_code == 200
156
158
  begin
@@ -253,6 +255,8 @@ module Azure::SQL::Mgmt::V2017_03_01_preview
253
255
  end
254
256
 
255
257
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
258
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
259
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
256
260
  # Deserialize Response
257
261
  if status_code == 200
258
262
  begin
@@ -510,6 +514,8 @@ module Azure::SQL::Mgmt::V2017_03_01_preview
510
514
  end
511
515
 
512
516
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
517
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
518
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
513
519
 
514
520
  result
515
521
  end
@@ -613,6 +619,8 @@ module Azure::SQL::Mgmt::V2017_03_01_preview
613
619
  end
614
620
 
615
621
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
622
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
623
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
616
624
  # Deserialize Response
617
625
  if status_code == 200
618
626
  begin
@@ -724,6 +732,8 @@ module Azure::SQL::Mgmt::V2017_03_01_preview
724
732
  end
725
733
 
726
734
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
735
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
736
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
727
737
 
728
738
  result
729
739
  end
@@ -830,6 +840,8 @@ module Azure::SQL::Mgmt::V2017_03_01_preview
830
840
  end
831
841
 
832
842
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
843
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
844
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
833
845
  # Deserialize Response
834
846
  if status_code == 200
835
847
  begin
@@ -918,6 +930,8 @@ module Azure::SQL::Mgmt::V2017_03_01_preview
918
930
  end
919
931
 
920
932
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
933
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
934
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
921
935
  # Deserialize Response
922
936
  if status_code == 200
923
937
  begin
@@ -0,0 +1,663 @@
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::SQL::Mgmt::V2017_03_01_preview
7
+ #
8
+ # The Azure SQL Database management API provides a RESTful set of web
9
+ # services that interact with Azure SQL Database services to manage your
10
+ # databases. The API enables you to create, retrieve, update, and delete
11
+ # databases.
12
+ #
13
+ class ManagedInstanceAdministrators
14
+ include MsRestAzure
15
+
16
+ #
17
+ # Creates and initializes a new instance of the ManagedInstanceAdministrators class.
18
+ # @param client service class for accessing basic functionality.
19
+ #
20
+ def initialize(client)
21
+ @client = client
22
+ end
23
+
24
+ # @return [SqlManagementClient] reference to the SqlManagementClient
25
+ attr_reader :client
26
+
27
+ #
28
+ # Gets a list of managed instance administrators.
29
+ #
30
+ # @param resource_group_name [String] The name of the resource group that
31
+ # contains the resource. You can obtain this value from the Azure Resource
32
+ # Manager API or the portal.
33
+ # @param managed_instance_name [String] The name of the managed instance.
34
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
35
+ # will be added to the HTTP request.
36
+ #
37
+ # @return [Array<ManagedInstanceAdministrator>] operation results.
38
+ #
39
+ def list_by_instance(resource_group_name, managed_instance_name, custom_headers:nil)
40
+ first_page = list_by_instance_as_lazy(resource_group_name, managed_instance_name, custom_headers:custom_headers)
41
+ first_page.get_all_items
42
+ end
43
+
44
+ #
45
+ # Gets a list of managed instance administrators.
46
+ #
47
+ # @param resource_group_name [String] The name of the resource group that
48
+ # contains the resource. You can obtain this value from the Azure Resource
49
+ # Manager API or the portal.
50
+ # @param managed_instance_name [String] The name of the managed instance.
51
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
52
+ # will be added to the HTTP request.
53
+ #
54
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
55
+ #
56
+ def list_by_instance_with_http_info(resource_group_name, managed_instance_name, custom_headers:nil)
57
+ list_by_instance_async(resource_group_name, managed_instance_name, custom_headers:custom_headers).value!
58
+ end
59
+
60
+ #
61
+ # Gets a list of managed instance administrators.
62
+ #
63
+ # @param resource_group_name [String] The name of the resource group that
64
+ # contains the resource. You can obtain this value from the Azure Resource
65
+ # Manager API or the portal.
66
+ # @param managed_instance_name [String] The name of the managed instance.
67
+ # @param [Hash{String => String}] A hash of custom headers that will be added
68
+ # to the HTTP request.
69
+ #
70
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
71
+ #
72
+ def list_by_instance_async(resource_group_name, managed_instance_name, custom_headers:nil)
73
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
74
+ fail ArgumentError, 'managed_instance_name is nil' if managed_instance_name.nil?
75
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
76
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
77
+
78
+
79
+ request_headers = {}
80
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
81
+
82
+ # Set Headers
83
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
84
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
85
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators'
86
+
87
+ request_url = @base_url || @client.base_url
88
+
89
+ options = {
90
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
91
+ path_params: {'resourceGroupName' => resource_group_name,'managedInstanceName' => managed_instance_name,'subscriptionId' => @client.subscription_id},
92
+ query_params: {'api-version' => @client.api_version},
93
+ headers: request_headers.merge(custom_headers || {}),
94
+ base_url: request_url
95
+ }
96
+ promise = @client.make_request_async(:get, path_template, options)
97
+
98
+ promise = promise.then do |result|
99
+ http_response = result.response
100
+ status_code = http_response.status
101
+ response_content = http_response.body
102
+ unless status_code == 200
103
+ error_model = JSON.load(response_content)
104
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
105
+ end
106
+
107
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
108
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
109
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
110
+ # Deserialize Response
111
+ if status_code == 200
112
+ begin
113
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
114
+ result_mapper = Azure::SQL::Mgmt::V2017_03_01_preview::Models::ManagedInstanceAdministratorListResult.mapper()
115
+ result.body = @client.deserialize(result_mapper, parsed_response)
116
+ rescue Exception => e
117
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
118
+ end
119
+ end
120
+
121
+ result
122
+ end
123
+
124
+ promise.execute
125
+ end
126
+
127
+ #
128
+ # Gets a managed instance administrator.
129
+ #
130
+ # @param resource_group_name [String] The name of the resource group that
131
+ # contains the resource. You can obtain this value from the Azure Resource
132
+ # Manager API or the portal.
133
+ # @param managed_instance_name [String] The name of the managed instance.
134
+ # @param administrator_name [String] The administrator name.
135
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
136
+ # will be added to the HTTP request.
137
+ #
138
+ # @return [ManagedInstanceAdministrator] operation results.
139
+ #
140
+ def get(resource_group_name, managed_instance_name, administrator_name, custom_headers:nil)
141
+ response = get_async(resource_group_name, managed_instance_name, administrator_name, custom_headers:custom_headers).value!
142
+ response.body unless response.nil?
143
+ end
144
+
145
+ #
146
+ # Gets a managed instance administrator.
147
+ #
148
+ # @param resource_group_name [String] The name of the resource group that
149
+ # contains the resource. You can obtain this value from the Azure Resource
150
+ # Manager API or the portal.
151
+ # @param managed_instance_name [String] The name of the managed instance.
152
+ # @param administrator_name [String] The administrator name.
153
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
154
+ # will be added to the HTTP request.
155
+ #
156
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
157
+ #
158
+ def get_with_http_info(resource_group_name, managed_instance_name, administrator_name, custom_headers:nil)
159
+ get_async(resource_group_name, managed_instance_name, administrator_name, custom_headers:custom_headers).value!
160
+ end
161
+
162
+ #
163
+ # Gets a managed instance administrator.
164
+ #
165
+ # @param resource_group_name [String] The name of the resource group that
166
+ # contains the resource. You can obtain this value from the Azure Resource
167
+ # Manager API or the portal.
168
+ # @param managed_instance_name [String] The name of the managed instance.
169
+ # @param administrator_name [String] The administrator name.
170
+ # @param [Hash{String => String}] A hash of custom headers that will be added
171
+ # to the HTTP request.
172
+ #
173
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
174
+ #
175
+ def get_async(resource_group_name, managed_instance_name, administrator_name, custom_headers:nil)
176
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
177
+ fail ArgumentError, 'managed_instance_name is nil' if managed_instance_name.nil?
178
+ fail ArgumentError, 'administrator_name is nil' if administrator_name.nil?
179
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
180
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
181
+
182
+
183
+ request_headers = {}
184
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
185
+
186
+ # Set Headers
187
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
188
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
189
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}'
190
+
191
+ request_url = @base_url || @client.base_url
192
+
193
+ options = {
194
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
195
+ path_params: {'resourceGroupName' => resource_group_name,'managedInstanceName' => managed_instance_name,'administratorName' => administrator_name,'subscriptionId' => @client.subscription_id},
196
+ query_params: {'api-version' => @client.api_version},
197
+ headers: request_headers.merge(custom_headers || {}),
198
+ base_url: request_url
199
+ }
200
+ promise = @client.make_request_async(:get, path_template, options)
201
+
202
+ promise = promise.then do |result|
203
+ http_response = result.response
204
+ status_code = http_response.status
205
+ response_content = http_response.body
206
+ unless status_code == 200
207
+ error_model = JSON.load(response_content)
208
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
209
+ end
210
+
211
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
212
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
213
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
214
+ # Deserialize Response
215
+ if status_code == 200
216
+ begin
217
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
218
+ result_mapper = Azure::SQL::Mgmt::V2017_03_01_preview::Models::ManagedInstanceAdministrator.mapper()
219
+ result.body = @client.deserialize(result_mapper, parsed_response)
220
+ rescue Exception => e
221
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
222
+ end
223
+ end
224
+
225
+ result
226
+ end
227
+
228
+ promise.execute
229
+ end
230
+
231
+ #
232
+ # Creates or updates a managed instance administrator.
233
+ #
234
+ # @param resource_group_name [String] The name of the resource group that
235
+ # contains the resource. You can obtain this value from the Azure Resource
236
+ # Manager API or the portal.
237
+ # @param managed_instance_name [String] The name of the managed instance.
238
+ # @param administrator_name [String] The requested administrator name.
239
+ # @param parameters [ManagedInstanceAdministrator] The requested administrator
240
+ # parameters.
241
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
242
+ # will be added to the HTTP request.
243
+ #
244
+ # @return [ManagedInstanceAdministrator] operation results.
245
+ #
246
+ def create_or_update(resource_group_name, managed_instance_name, administrator_name, parameters, custom_headers:nil)
247
+ response = create_or_update_async(resource_group_name, managed_instance_name, administrator_name, parameters, custom_headers:custom_headers).value!
248
+ response.body unless response.nil?
249
+ end
250
+
251
+ #
252
+ # @param resource_group_name [String] The name of the resource group that
253
+ # contains the resource. You can obtain this value from the Azure Resource
254
+ # Manager API or the portal.
255
+ # @param managed_instance_name [String] The name of the managed instance.
256
+ # @param administrator_name [String] The requested administrator name.
257
+ # @param parameters [ManagedInstanceAdministrator] The requested administrator
258
+ # parameters.
259
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
260
+ # will be added to the HTTP request.
261
+ #
262
+ # @return [Concurrent::Promise] promise which provides async access to http
263
+ # response.
264
+ #
265
+ def create_or_update_async(resource_group_name, managed_instance_name, administrator_name, parameters, custom_headers:nil)
266
+ # Send request
267
+ promise = begin_create_or_update_async(resource_group_name, managed_instance_name, administrator_name, parameters, custom_headers:custom_headers)
268
+
269
+ promise = promise.then do |response|
270
+ # Defining deserialization method.
271
+ deserialize_method = lambda do |parsed_response|
272
+ result_mapper = Azure::SQL::Mgmt::V2017_03_01_preview::Models::ManagedInstanceAdministrator.mapper()
273
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
274
+ end
275
+
276
+ # Waiting for response.
277
+ @client.get_long_running_operation_result(response, deserialize_method)
278
+ end
279
+
280
+ promise
281
+ end
282
+
283
+ #
284
+ # Deletes a managed instance administrator.
285
+ #
286
+ # @param resource_group_name [String] The name of the resource group that
287
+ # contains the resource. You can obtain this value from the Azure Resource
288
+ # Manager API or the portal.
289
+ # @param managed_instance_name [String] The name of the managed instance.
290
+ # @param administrator_name [String] The administrator name.
291
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
292
+ # will be added to the HTTP request.
293
+ #
294
+ def delete(resource_group_name, managed_instance_name, administrator_name, custom_headers:nil)
295
+ response = delete_async(resource_group_name, managed_instance_name, administrator_name, custom_headers:custom_headers).value!
296
+ nil
297
+ end
298
+
299
+ #
300
+ # @param resource_group_name [String] The name of the resource group that
301
+ # contains the resource. You can obtain this value from the Azure Resource
302
+ # Manager API or the portal.
303
+ # @param managed_instance_name [String] The name of the managed instance.
304
+ # @param administrator_name [String] The administrator name.
305
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
306
+ # will be added to the HTTP request.
307
+ #
308
+ # @return [Concurrent::Promise] promise which provides async access to http
309
+ # response.
310
+ #
311
+ def delete_async(resource_group_name, managed_instance_name, administrator_name, custom_headers:nil)
312
+ # Send request
313
+ promise = begin_delete_async(resource_group_name, managed_instance_name, administrator_name, custom_headers:custom_headers)
314
+
315
+ promise = promise.then do |response|
316
+ # Defining deserialization method.
317
+ deserialize_method = lambda do |parsed_response|
318
+ end
319
+
320
+ # Waiting for response.
321
+ @client.get_long_running_operation_result(response, deserialize_method)
322
+ end
323
+
324
+ promise
325
+ end
326
+
327
+ #
328
+ # Creates or updates a managed instance administrator.
329
+ #
330
+ # @param resource_group_name [String] The name of the resource group that
331
+ # contains the resource. You can obtain this value from the Azure Resource
332
+ # Manager API or the portal.
333
+ # @param managed_instance_name [String] The name of the managed instance.
334
+ # @param administrator_name [String] The requested administrator name.
335
+ # @param parameters [ManagedInstanceAdministrator] The requested administrator
336
+ # parameters.
337
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
338
+ # will be added to the HTTP request.
339
+ #
340
+ # @return [ManagedInstanceAdministrator] operation results.
341
+ #
342
+ def begin_create_or_update(resource_group_name, managed_instance_name, administrator_name, parameters, custom_headers:nil)
343
+ response = begin_create_or_update_async(resource_group_name, managed_instance_name, administrator_name, parameters, custom_headers:custom_headers).value!
344
+ response.body unless response.nil?
345
+ end
346
+
347
+ #
348
+ # Creates or updates a managed instance administrator.
349
+ #
350
+ # @param resource_group_name [String] The name of the resource group that
351
+ # contains the resource. You can obtain this value from the Azure Resource
352
+ # Manager API or the portal.
353
+ # @param managed_instance_name [String] The name of the managed instance.
354
+ # @param administrator_name [String] The requested administrator name.
355
+ # @param parameters [ManagedInstanceAdministrator] The requested administrator
356
+ # parameters.
357
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
358
+ # will be added to the HTTP request.
359
+ #
360
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
361
+ #
362
+ def begin_create_or_update_with_http_info(resource_group_name, managed_instance_name, administrator_name, parameters, custom_headers:nil)
363
+ begin_create_or_update_async(resource_group_name, managed_instance_name, administrator_name, parameters, custom_headers:custom_headers).value!
364
+ end
365
+
366
+ #
367
+ # Creates or updates a managed instance administrator.
368
+ #
369
+ # @param resource_group_name [String] The name of the resource group that
370
+ # contains the resource. You can obtain this value from the Azure Resource
371
+ # Manager API or the portal.
372
+ # @param managed_instance_name [String] The name of the managed instance.
373
+ # @param administrator_name [String] The requested administrator name.
374
+ # @param parameters [ManagedInstanceAdministrator] The requested administrator
375
+ # parameters.
376
+ # @param [Hash{String => String}] A hash of custom headers that will be added
377
+ # to the HTTP request.
378
+ #
379
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
380
+ #
381
+ def begin_create_or_update_async(resource_group_name, managed_instance_name, administrator_name, parameters, custom_headers:nil)
382
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
383
+ fail ArgumentError, 'managed_instance_name is nil' if managed_instance_name.nil?
384
+ fail ArgumentError, 'administrator_name is nil' if administrator_name.nil?
385
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
386
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
387
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
388
+
389
+
390
+ request_headers = {}
391
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
392
+
393
+ # Set Headers
394
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
395
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
396
+
397
+ # Serialize Request
398
+ request_mapper = Azure::SQL::Mgmt::V2017_03_01_preview::Models::ManagedInstanceAdministrator.mapper()
399
+ request_content = @client.serialize(request_mapper, parameters)
400
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
401
+
402
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}'
403
+
404
+ request_url = @base_url || @client.base_url
405
+
406
+ options = {
407
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
408
+ path_params: {'resourceGroupName' => resource_group_name,'managedInstanceName' => managed_instance_name,'administratorName' => administrator_name,'subscriptionId' => @client.subscription_id},
409
+ query_params: {'api-version' => @client.api_version},
410
+ body: request_content,
411
+ headers: request_headers.merge(custom_headers || {}),
412
+ base_url: request_url
413
+ }
414
+ promise = @client.make_request_async(:put, path_template, options)
415
+
416
+ promise = promise.then do |result|
417
+ http_response = result.response
418
+ status_code = http_response.status
419
+ response_content = http_response.body
420
+ unless status_code == 200 || status_code == 202 || status_code == 201
421
+ error_model = JSON.load(response_content)
422
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
423
+ end
424
+
425
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
426
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
427
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
428
+ # Deserialize Response
429
+ if status_code == 200
430
+ begin
431
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
432
+ result_mapper = Azure::SQL::Mgmt::V2017_03_01_preview::Models::ManagedInstanceAdministrator.mapper()
433
+ result.body = @client.deserialize(result_mapper, parsed_response)
434
+ rescue Exception => e
435
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
436
+ end
437
+ end
438
+ # Deserialize Response
439
+ if status_code == 201
440
+ begin
441
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
442
+ result_mapper = Azure::SQL::Mgmt::V2017_03_01_preview::Models::ManagedInstanceAdministrator.mapper()
443
+ result.body = @client.deserialize(result_mapper, parsed_response)
444
+ rescue Exception => e
445
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
446
+ end
447
+ end
448
+
449
+ result
450
+ end
451
+
452
+ promise.execute
453
+ end
454
+
455
+ #
456
+ # Deletes a managed instance administrator.
457
+ #
458
+ # @param resource_group_name [String] The name of the resource group that
459
+ # contains the resource. You can obtain this value from the Azure Resource
460
+ # Manager API or the portal.
461
+ # @param managed_instance_name [String] The name of the managed instance.
462
+ # @param administrator_name [String] The administrator name.
463
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
464
+ # will be added to the HTTP request.
465
+ #
466
+ #
467
+ def begin_delete(resource_group_name, managed_instance_name, administrator_name, custom_headers:nil)
468
+ response = begin_delete_async(resource_group_name, managed_instance_name, administrator_name, custom_headers:custom_headers).value!
469
+ nil
470
+ end
471
+
472
+ #
473
+ # Deletes a managed instance administrator.
474
+ #
475
+ # @param resource_group_name [String] The name of the resource group that
476
+ # contains the resource. You can obtain this value from the Azure Resource
477
+ # Manager API or the portal.
478
+ # @param managed_instance_name [String] The name of the managed instance.
479
+ # @param administrator_name [String] The administrator name.
480
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
481
+ # will be added to the HTTP request.
482
+ #
483
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
484
+ #
485
+ def begin_delete_with_http_info(resource_group_name, managed_instance_name, administrator_name, custom_headers:nil)
486
+ begin_delete_async(resource_group_name, managed_instance_name, administrator_name, custom_headers:custom_headers).value!
487
+ end
488
+
489
+ #
490
+ # Deletes a managed instance administrator.
491
+ #
492
+ # @param resource_group_name [String] The name of the resource group that
493
+ # contains the resource. You can obtain this value from the Azure Resource
494
+ # Manager API or the portal.
495
+ # @param managed_instance_name [String] The name of the managed instance.
496
+ # @param administrator_name [String] The administrator name.
497
+ # @param [Hash{String => String}] A hash of custom headers that will be added
498
+ # to the HTTP request.
499
+ #
500
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
501
+ #
502
+ def begin_delete_async(resource_group_name, managed_instance_name, administrator_name, custom_headers:nil)
503
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
504
+ fail ArgumentError, 'managed_instance_name is nil' if managed_instance_name.nil?
505
+ fail ArgumentError, 'administrator_name is nil' if administrator_name.nil?
506
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
507
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
508
+
509
+
510
+ request_headers = {}
511
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
512
+
513
+ # Set Headers
514
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
515
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
516
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}'
517
+
518
+ request_url = @base_url || @client.base_url
519
+
520
+ options = {
521
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
522
+ path_params: {'resourceGroupName' => resource_group_name,'managedInstanceName' => managed_instance_name,'administratorName' => administrator_name,'subscriptionId' => @client.subscription_id},
523
+ query_params: {'api-version' => @client.api_version},
524
+ headers: request_headers.merge(custom_headers || {}),
525
+ base_url: request_url
526
+ }
527
+ promise = @client.make_request_async(:delete, path_template, options)
528
+
529
+ promise = promise.then do |result|
530
+ http_response = result.response
531
+ status_code = http_response.status
532
+ response_content = http_response.body
533
+ unless status_code == 200 || status_code == 202
534
+ error_model = JSON.load(response_content)
535
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
536
+ end
537
+
538
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
539
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
540
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
541
+
542
+ result
543
+ end
544
+
545
+ promise.execute
546
+ end
547
+
548
+ #
549
+ # Gets a list of managed instance administrators.
550
+ #
551
+ # @param next_page_link [String] The NextLink from the previous successful call
552
+ # to List operation.
553
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
554
+ # will be added to the HTTP request.
555
+ #
556
+ # @return [ManagedInstanceAdministratorListResult] operation results.
557
+ #
558
+ def list_by_instance_next(next_page_link, custom_headers:nil)
559
+ response = list_by_instance_next_async(next_page_link, custom_headers:custom_headers).value!
560
+ response.body unless response.nil?
561
+ end
562
+
563
+ #
564
+ # Gets a list of managed instance administrators.
565
+ #
566
+ # @param next_page_link [String] The NextLink from the previous successful call
567
+ # to List operation.
568
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
569
+ # will be added to the HTTP request.
570
+ #
571
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
572
+ #
573
+ def list_by_instance_next_with_http_info(next_page_link, custom_headers:nil)
574
+ list_by_instance_next_async(next_page_link, custom_headers:custom_headers).value!
575
+ end
576
+
577
+ #
578
+ # Gets a list of managed instance administrators.
579
+ #
580
+ # @param next_page_link [String] The NextLink from the previous successful call
581
+ # to List operation.
582
+ # @param [Hash{String => String}] A hash of custom headers that will be added
583
+ # to the HTTP request.
584
+ #
585
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
586
+ #
587
+ def list_by_instance_next_async(next_page_link, custom_headers:nil)
588
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
589
+
590
+
591
+ request_headers = {}
592
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
593
+
594
+ # Set Headers
595
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
596
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
597
+ path_template = '{nextLink}'
598
+
599
+ request_url = @base_url || @client.base_url
600
+
601
+ options = {
602
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
603
+ skip_encoding_path_params: {'nextLink' => next_page_link},
604
+ headers: request_headers.merge(custom_headers || {}),
605
+ base_url: request_url
606
+ }
607
+ promise = @client.make_request_async(:get, path_template, options)
608
+
609
+ promise = promise.then do |result|
610
+ http_response = result.response
611
+ status_code = http_response.status
612
+ response_content = http_response.body
613
+ unless status_code == 200
614
+ error_model = JSON.load(response_content)
615
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
616
+ end
617
+
618
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
619
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
620
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
621
+ # Deserialize Response
622
+ if status_code == 200
623
+ begin
624
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
625
+ result_mapper = Azure::SQL::Mgmt::V2017_03_01_preview::Models::ManagedInstanceAdministratorListResult.mapper()
626
+ result.body = @client.deserialize(result_mapper, parsed_response)
627
+ rescue Exception => e
628
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
629
+ end
630
+ end
631
+
632
+ result
633
+ end
634
+
635
+ promise.execute
636
+ end
637
+
638
+ #
639
+ # Gets a list of managed instance administrators.
640
+ #
641
+ # @param resource_group_name [String] The name of the resource group that
642
+ # contains the resource. You can obtain this value from the Azure Resource
643
+ # Manager API or the portal.
644
+ # @param managed_instance_name [String] The name of the managed instance.
645
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
646
+ # will be added to the HTTP request.
647
+ #
648
+ # @return [ManagedInstanceAdministratorListResult] which provide lazy access to
649
+ # pages of the response.
650
+ #
651
+ def list_by_instance_as_lazy(resource_group_name, managed_instance_name, custom_headers:nil)
652
+ response = list_by_instance_async(resource_group_name, managed_instance_name, custom_headers:custom_headers).value!
653
+ unless response.nil?
654
+ page = response.body
655
+ page.next_method = Proc.new do |next_page_link|
656
+ list_by_instance_next_async(next_page_link, custom_headers:custom_headers)
657
+ end
658
+ page
659
+ end
660
+ end
661
+
662
+ end
663
+ end