azure_mgmt_resources 0.17.5 → 0.17.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (227) hide show
  1. checksums.yaml +5 -5
  2. data/lib/2016-02-01/generated/azure_mgmt_resources/models/deployment_properties_extended.rb +1 -1
  3. data/lib/2016-02-01/generated/azure_mgmt_resources/models/export_template_request.rb +6 -6
  4. data/lib/2016-02-01/generated/azure_mgmt_resources/models/parameters_link.rb +1 -1
  5. data/lib/2016-02-01/generated/azure_mgmt_resources/resource_management_client.rb +1 -1
  6. data/lib/2016-07-01/generated/azure_mgmt_resources/models/deployment_properties_extended.rb +1 -1
  7. data/lib/2016-07-01/generated/azure_mgmt_resources/models/export_template_request.rb +6 -6
  8. data/lib/2016-07-01/generated/azure_mgmt_resources/models/parameters_link.rb +1 -1
  9. data/lib/2016-07-01/generated/azure_mgmt_resources/resource_management_client.rb +1 -1
  10. data/lib/2016-09-01/generated/azure_mgmt_resources/models/deployment_properties_extended.rb +1 -1
  11. data/lib/2016-09-01/generated/azure_mgmt_resources/models/export_template_request.rb +6 -6
  12. data/lib/2016-09-01/generated/azure_mgmt_resources/models/parameters_link.rb +1 -1
  13. data/lib/2016-09-01/generated/azure_mgmt_resources/models/resource_group.rb +1 -1
  14. data/lib/2016-09-01/generated/azure_mgmt_resources/resource_management_client.rb +1 -1
  15. data/lib/2016-09-01/generated/azure_mgmt_resources/resources.rb +5 -5
  16. data/lib/2017-05-10/generated/azure_mgmt_resources/models/deployment_properties_extended.rb +1 -1
  17. data/lib/2017-05-10/generated/azure_mgmt_resources/models/export_template_request.rb +6 -6
  18. data/lib/2017-05-10/generated/azure_mgmt_resources/models/parameters_link.rb +1 -1
  19. data/lib/2017-05-10/generated/azure_mgmt_resources/resource_management_client.rb +1 -1
  20. data/lib/2018-02-01/generated/azure_mgmt_resources/models/deployment_properties_extended.rb +1 -1
  21. data/lib/2018-02-01/generated/azure_mgmt_resources/models/export_template_request.rb +6 -6
  22. data/lib/2018-02-01/generated/azure_mgmt_resources/models/parameters_link.rb +1 -1
  23. data/lib/2018-02-01/generated/azure_mgmt_resources/resource_management_client.rb +1 -1
  24. data/lib/2018-05-01/generated/azure_mgmt_resources/models/deployment_extended.rb +12 -0
  25. data/lib/2018-05-01/generated/azure_mgmt_resources/models/deployment_properties_extended.rb +1 -1
  26. data/lib/2018-05-01/generated/azure_mgmt_resources/models/export_template_request.rb +6 -6
  27. data/lib/2018-05-01/generated/azure_mgmt_resources/models/parameters_link.rb +1 -1
  28. data/lib/2018-05-01/generated/azure_mgmt_resources/models/resource_group.rb +12 -0
  29. data/lib/2018-05-01/generated/azure_mgmt_resources/resource_groups.rb +18 -7
  30. data/lib/2018-05-01/generated/azure_mgmt_resources/resource_management_client.rb +1 -1
  31. data/lib/2018-05-01/generated/azure_mgmt_resources/resources.rb +144 -16
  32. data/lib/2019-03-01/generated/azure_mgmt_resources.rb +88 -0
  33. data/lib/2019-03-01/generated/azure_mgmt_resources/deployment_operations.rb +665 -0
  34. data/lib/2019-03-01/generated/azure_mgmt_resources/deployments.rb +2184 -0
  35. data/lib/2019-03-01/generated/azure_mgmt_resources/models/alias_path_type.rb +65 -0
  36. data/lib/2019-03-01/generated/azure_mgmt_resources/models/alias_type.rb +66 -0
  37. data/lib/2019-03-01/generated/azure_mgmt_resources/models/basic_dependency.rb +68 -0
  38. data/lib/2019-03-01/generated/azure_mgmt_resources/models/debug_setting.rb +54 -0
  39. data/lib/2019-03-01/generated/azure_mgmt_resources/models/dependency.rb +88 -0
  40. data/lib/2019-03-01/generated/azure_mgmt_resources/models/deployment.rb +58 -0
  41. data/lib/2019-03-01/generated/azure_mgmt_resources/models/deployment_export_result.rb +46 -0
  42. data/lib/2019-03-01/generated/azure_mgmt_resources/models/deployment_extended.rb +94 -0
  43. data/lib/2019-03-01/generated/azure_mgmt_resources/models/deployment_extended_filter.rb +46 -0
  44. data/lib/2019-03-01/generated/azure_mgmt_resources/models/deployment_list_result.rb +99 -0
  45. data/lib/2019-03-01/generated/azure_mgmt_resources/models/deployment_mode.rb +16 -0
  46. data/lib/2019-03-01/generated/azure_mgmt_resources/models/deployment_operation.rb +71 -0
  47. data/lib/2019-03-01/generated/azure_mgmt_resources/models/deployment_operation_properties.rb +134 -0
  48. data/lib/2019-03-01/generated/azure_mgmt_resources/models/deployment_operations_list_result.rb +99 -0
  49. data/lib/2019-03-01/generated/azure_mgmt_resources/models/deployment_properties.rb +136 -0
  50. data/lib/2019-03-01/generated/azure_mgmt_resources/models/deployment_properties_extended.rb +210 -0
  51. data/lib/2019-03-01/generated/azure_mgmt_resources/models/deployment_validate_result.rb +60 -0
  52. data/lib/2019-03-01/generated/azure_mgmt_resources/models/export_template_request.rb +69 -0
  53. data/lib/2019-03-01/generated/azure_mgmt_resources/models/generic_resource.rb +158 -0
  54. data/lib/2019-03-01/generated/azure_mgmt_resources/models/generic_resource_filter.rb +68 -0
  55. data/lib/2019-03-01/generated/azure_mgmt_resources/models/http_message.rb +46 -0
  56. data/lib/2019-03-01/generated/azure_mgmt_resources/models/identity.rb +96 -0
  57. data/lib/2019-03-01/generated/azure_mgmt_resources/models/identity_user_assigned_identities_value.rb +60 -0
  58. data/lib/2019-03-01/generated/azure_mgmt_resources/models/on_error_deployment.rb +60 -0
  59. data/lib/2019-03-01/generated/azure_mgmt_resources/models/on_error_deployment_extended.rb +73 -0
  60. data/lib/2019-03-01/generated/azure_mgmt_resources/models/on_error_deployment_type.rb +16 -0
  61. data/lib/2019-03-01/generated/azure_mgmt_resources/models/operation.rb +58 -0
  62. data/lib/2019-03-01/generated/azure_mgmt_resources/models/operation_display.rb +80 -0
  63. data/lib/2019-03-01/generated/azure_mgmt_resources/models/operation_list_result.rb +100 -0
  64. data/lib/2019-03-01/generated/azure_mgmt_resources/models/parameters_link.rb +58 -0
  65. data/lib/2019-03-01/generated/azure_mgmt_resources/models/plan.rb +90 -0
  66. data/lib/2019-03-01/generated/azure_mgmt_resources/models/provider.rb +104 -0
  67. data/lib/2019-03-01/generated/azure_mgmt_resources/models/provider_list_result.rb +99 -0
  68. data/lib/2019-03-01/generated/azure_mgmt_resources/models/provider_resource_type.rb +137 -0
  69. data/lib/2019-03-01/generated/azure_mgmt_resources/models/resource.rb +110 -0
  70. data/lib/2019-03-01/generated/azure_mgmt_resources/models/resource_group.rb +128 -0
  71. data/lib/2019-03-01/generated/azure_mgmt_resources/models/resource_group_export_result.rb +58 -0
  72. data/lib/2019-03-01/generated/azure_mgmt_resources/models/resource_group_filter.rb +57 -0
  73. data/lib/2019-03-01/generated/azure_mgmt_resources/models/resource_group_list_result.rb +99 -0
  74. data/lib/2019-03-01/generated/azure_mgmt_resources/models/resource_group_patchable.rb +90 -0
  75. data/lib/2019-03-01/generated/azure_mgmt_resources/models/resource_group_properties.rb +47 -0
  76. data/lib/2019-03-01/generated/azure_mgmt_resources/models/resource_identity_type.rb +18 -0
  77. data/lib/2019-03-01/generated/azure_mgmt_resources/models/resource_list_result.rb +99 -0
  78. data/lib/2019-03-01/generated/azure_mgmt_resources/models/resource_management_error_with_details.rb +92 -0
  79. data/lib/2019-03-01/generated/azure_mgmt_resources/models/resource_provider_operation_display_properties.rb +91 -0
  80. data/lib/2019-03-01/generated/azure_mgmt_resources/models/resources_move_info.rb +65 -0
  81. data/lib/2019-03-01/generated/azure_mgmt_resources/models/sku.rb +101 -0
  82. data/lib/2019-03-01/generated/azure_mgmt_resources/models/sub_resource.rb +46 -0
  83. data/lib/2019-03-01/generated/azure_mgmt_resources/models/tag_count.rb +57 -0
  84. data/lib/2019-03-01/generated/azure_mgmt_resources/models/tag_details.rb +92 -0
  85. data/lib/2019-03-01/generated/azure_mgmt_resources/models/tag_value.rb +70 -0
  86. data/lib/2019-03-01/generated/azure_mgmt_resources/models/tags_list_result.rb +99 -0
  87. data/lib/2019-03-01/generated/azure_mgmt_resources/models/target_resource.rb +68 -0
  88. data/lib/2019-03-01/generated/azure_mgmt_resources/models/template_link.rb +58 -0
  89. data/lib/2019-03-01/generated/azure_mgmt_resources/module_definition.rb +9 -0
  90. data/lib/2019-03-01/generated/azure_mgmt_resources/operations.rb +219 -0
  91. data/lib/2019-03-01/generated/azure_mgmt_resources/providers.rb +530 -0
  92. data/lib/2019-03-01/generated/azure_mgmt_resources/resource_groups.rb +918 -0
  93. data/lib/2019-03-01/generated/azure_mgmt_resources/resource_management_client.rb +155 -0
  94. data/lib/2019-03-01/generated/azure_mgmt_resources/resources.rb +2338 -0
  95. data/lib/2019-03-01/generated/azure_mgmt_resources/tags.rb +611 -0
  96. data/lib/2019-05-01/generated/azure_mgmt_resources.rb +88 -0
  97. data/lib/2019-05-01/generated/azure_mgmt_resources/deployment_operations.rb +973 -0
  98. data/lib/2019-05-01/generated/azure_mgmt_resources/deployments.rb +3250 -0
  99. data/lib/2019-05-01/generated/azure_mgmt_resources/models/alias_path_type.rb +65 -0
  100. data/lib/2019-05-01/generated/azure_mgmt_resources/models/alias_type.rb +66 -0
  101. data/lib/2019-05-01/generated/azure_mgmt_resources/models/basic_dependency.rb +68 -0
  102. data/lib/2019-05-01/generated/azure_mgmt_resources/models/debug_setting.rb +53 -0
  103. data/lib/2019-05-01/generated/azure_mgmt_resources/models/dependency.rb +88 -0
  104. data/lib/2019-05-01/generated/azure_mgmt_resources/models/deployment.rb +58 -0
  105. data/lib/2019-05-01/generated/azure_mgmt_resources/models/deployment_export_result.rb +46 -0
  106. data/lib/2019-05-01/generated/azure_mgmt_resources/models/deployment_extended.rb +94 -0
  107. data/lib/2019-05-01/generated/azure_mgmt_resources/models/deployment_extended_filter.rb +46 -0
  108. data/lib/2019-05-01/generated/azure_mgmt_resources/models/deployment_list_result.rb +99 -0
  109. data/lib/2019-05-01/generated/azure_mgmt_resources/models/deployment_mode.rb +16 -0
  110. data/lib/2019-05-01/generated/azure_mgmt_resources/models/deployment_operation.rb +71 -0
  111. data/lib/2019-05-01/generated/azure_mgmt_resources/models/deployment_operation_properties.rb +146 -0
  112. data/lib/2019-05-01/generated/azure_mgmt_resources/models/deployment_operations_list_result.rb +99 -0
  113. data/lib/2019-05-01/generated/azure_mgmt_resources/models/deployment_properties.rb +136 -0
  114. data/lib/2019-05-01/generated/azure_mgmt_resources/models/deployment_properties_extended.rb +222 -0
  115. data/lib/2019-05-01/generated/azure_mgmt_resources/models/deployment_validate_result.rb +60 -0
  116. data/lib/2019-05-01/generated/azure_mgmt_resources/models/export_template_request.rb +69 -0
  117. data/lib/2019-05-01/generated/azure_mgmt_resources/models/generic_resource.rb +158 -0
  118. data/lib/2019-05-01/generated/azure_mgmt_resources/models/generic_resource_filter.rb +68 -0
  119. data/lib/2019-05-01/generated/azure_mgmt_resources/models/http_message.rb +46 -0
  120. data/lib/2019-05-01/generated/azure_mgmt_resources/models/identity.rb +96 -0
  121. data/lib/2019-05-01/generated/azure_mgmt_resources/models/identity_user_assigned_identities_value.rb +60 -0
  122. data/lib/2019-05-01/generated/azure_mgmt_resources/models/on_error_deployment.rb +60 -0
  123. data/lib/2019-05-01/generated/azure_mgmt_resources/models/on_error_deployment_extended.rb +73 -0
  124. data/lib/2019-05-01/generated/azure_mgmt_resources/models/on_error_deployment_type.rb +16 -0
  125. data/lib/2019-05-01/generated/azure_mgmt_resources/models/operation.rb +58 -0
  126. data/lib/2019-05-01/generated/azure_mgmt_resources/models/operation_display.rb +80 -0
  127. data/lib/2019-05-01/generated/azure_mgmt_resources/models/operation_list_result.rb +100 -0
  128. data/lib/2019-05-01/generated/azure_mgmt_resources/models/parameters_link.rb +58 -0
  129. data/lib/2019-05-01/generated/azure_mgmt_resources/models/plan.rb +90 -0
  130. data/lib/2019-05-01/generated/azure_mgmt_resources/models/provider.rb +104 -0
  131. data/lib/2019-05-01/generated/azure_mgmt_resources/models/provider_list_result.rb +99 -0
  132. data/lib/2019-05-01/generated/azure_mgmt_resources/models/provider_resource_type.rb +137 -0
  133. data/lib/2019-05-01/generated/azure_mgmt_resources/models/resource.rb +110 -0
  134. data/lib/2019-05-01/generated/azure_mgmt_resources/models/resource_group.rb +128 -0
  135. data/lib/2019-05-01/generated/azure_mgmt_resources/models/resource_group_export_result.rb +58 -0
  136. data/lib/2019-05-01/generated/azure_mgmt_resources/models/resource_group_filter.rb +57 -0
  137. data/lib/2019-05-01/generated/azure_mgmt_resources/models/resource_group_list_result.rb +99 -0
  138. data/lib/2019-05-01/generated/azure_mgmt_resources/models/resource_group_patchable.rb +90 -0
  139. data/lib/2019-05-01/generated/azure_mgmt_resources/models/resource_group_properties.rb +47 -0
  140. data/lib/2019-05-01/generated/azure_mgmt_resources/models/resource_identity_type.rb +18 -0
  141. data/lib/2019-05-01/generated/azure_mgmt_resources/models/resource_list_result.rb +99 -0
  142. data/lib/2019-05-01/generated/azure_mgmt_resources/models/resource_management_error_with_details.rb +92 -0
  143. data/lib/2019-05-01/generated/azure_mgmt_resources/models/resource_provider_operation_display_properties.rb +91 -0
  144. data/lib/2019-05-01/generated/azure_mgmt_resources/models/resources_move_info.rb +65 -0
  145. data/lib/2019-05-01/generated/azure_mgmt_resources/models/sku.rb +101 -0
  146. data/lib/2019-05-01/generated/azure_mgmt_resources/models/sub_resource.rb +46 -0
  147. data/lib/2019-05-01/generated/azure_mgmt_resources/models/tag_count.rb +57 -0
  148. data/lib/2019-05-01/generated/azure_mgmt_resources/models/tag_details.rb +92 -0
  149. data/lib/2019-05-01/generated/azure_mgmt_resources/models/tag_value.rb +70 -0
  150. data/lib/2019-05-01/generated/azure_mgmt_resources/models/tags_list_result.rb +99 -0
  151. data/lib/2019-05-01/generated/azure_mgmt_resources/models/target_resource.rb +68 -0
  152. data/lib/2019-05-01/generated/azure_mgmt_resources/models/template_link.rb +58 -0
  153. data/lib/2019-05-01/generated/azure_mgmt_resources/module_definition.rb +9 -0
  154. data/lib/2019-05-01/generated/azure_mgmt_resources/operations.rb +219 -0
  155. data/lib/2019-05-01/generated/azure_mgmt_resources/providers.rb +530 -0
  156. data/lib/2019-05-01/generated/azure_mgmt_resources/resource_groups.rb +918 -0
  157. data/lib/2019-05-01/generated/azure_mgmt_resources/resource_management_client.rb +155 -0
  158. data/lib/2019-05-01/generated/azure_mgmt_resources/resources.rb +2338 -0
  159. data/lib/2019-05-01/generated/azure_mgmt_resources/tags.rb +611 -0
  160. data/lib/2019-05-10/generated/azure_mgmt_resources.rb +88 -0
  161. data/lib/2019-05-10/generated/azure_mgmt_resources/deployment_operations.rb +973 -0
  162. data/lib/2019-05-10/generated/azure_mgmt_resources/deployments.rb +3250 -0
  163. data/lib/2019-05-10/generated/azure_mgmt_resources/models/alias_path_type.rb +65 -0
  164. data/lib/2019-05-10/generated/azure_mgmt_resources/models/alias_type.rb +66 -0
  165. data/lib/2019-05-10/generated/azure_mgmt_resources/models/basic_dependency.rb +68 -0
  166. data/lib/2019-05-10/generated/azure_mgmt_resources/models/debug_setting.rb +53 -0
  167. data/lib/2019-05-10/generated/azure_mgmt_resources/models/dependency.rb +88 -0
  168. data/lib/2019-05-10/generated/azure_mgmt_resources/models/deployment.rb +58 -0
  169. data/lib/2019-05-10/generated/azure_mgmt_resources/models/deployment_export_result.rb +46 -0
  170. data/lib/2019-05-10/generated/azure_mgmt_resources/models/deployment_extended.rb +94 -0
  171. data/lib/2019-05-10/generated/azure_mgmt_resources/models/deployment_extended_filter.rb +46 -0
  172. data/lib/2019-05-10/generated/azure_mgmt_resources/models/deployment_list_result.rb +99 -0
  173. data/lib/2019-05-10/generated/azure_mgmt_resources/models/deployment_mode.rb +16 -0
  174. data/lib/2019-05-10/generated/azure_mgmt_resources/models/deployment_operation.rb +71 -0
  175. data/lib/2019-05-10/generated/azure_mgmt_resources/models/deployment_operation_properties.rb +146 -0
  176. data/lib/2019-05-10/generated/azure_mgmt_resources/models/deployment_operations_list_result.rb +99 -0
  177. data/lib/2019-05-10/generated/azure_mgmt_resources/models/deployment_properties.rb +136 -0
  178. data/lib/2019-05-10/generated/azure_mgmt_resources/models/deployment_properties_extended.rb +222 -0
  179. data/lib/2019-05-10/generated/azure_mgmt_resources/models/deployment_validate_result.rb +60 -0
  180. data/lib/2019-05-10/generated/azure_mgmt_resources/models/export_template_request.rb +69 -0
  181. data/lib/2019-05-10/generated/azure_mgmt_resources/models/generic_resource.rb +158 -0
  182. data/lib/2019-05-10/generated/azure_mgmt_resources/models/generic_resource_filter.rb +68 -0
  183. data/lib/2019-05-10/generated/azure_mgmt_resources/models/http_message.rb +46 -0
  184. data/lib/2019-05-10/generated/azure_mgmt_resources/models/identity.rb +96 -0
  185. data/lib/2019-05-10/generated/azure_mgmt_resources/models/identity_user_assigned_identities_value.rb +60 -0
  186. data/lib/2019-05-10/generated/azure_mgmt_resources/models/on_error_deployment.rb +60 -0
  187. data/lib/2019-05-10/generated/azure_mgmt_resources/models/on_error_deployment_extended.rb +73 -0
  188. data/lib/2019-05-10/generated/azure_mgmt_resources/models/on_error_deployment_type.rb +16 -0
  189. data/lib/2019-05-10/generated/azure_mgmt_resources/models/operation.rb +58 -0
  190. data/lib/2019-05-10/generated/azure_mgmt_resources/models/operation_display.rb +80 -0
  191. data/lib/2019-05-10/generated/azure_mgmt_resources/models/operation_list_result.rb +100 -0
  192. data/lib/2019-05-10/generated/azure_mgmt_resources/models/parameters_link.rb +58 -0
  193. data/lib/2019-05-10/generated/azure_mgmt_resources/models/plan.rb +90 -0
  194. data/lib/2019-05-10/generated/azure_mgmt_resources/models/provider.rb +104 -0
  195. data/lib/2019-05-10/generated/azure_mgmt_resources/models/provider_list_result.rb +99 -0
  196. data/lib/2019-05-10/generated/azure_mgmt_resources/models/provider_resource_type.rb +137 -0
  197. data/lib/2019-05-10/generated/azure_mgmt_resources/models/resource.rb +110 -0
  198. data/lib/2019-05-10/generated/azure_mgmt_resources/models/resource_group.rb +128 -0
  199. data/lib/2019-05-10/generated/azure_mgmt_resources/models/resource_group_export_result.rb +58 -0
  200. data/lib/2019-05-10/generated/azure_mgmt_resources/models/resource_group_filter.rb +57 -0
  201. data/lib/2019-05-10/generated/azure_mgmt_resources/models/resource_group_list_result.rb +99 -0
  202. data/lib/2019-05-10/generated/azure_mgmt_resources/models/resource_group_patchable.rb +90 -0
  203. data/lib/2019-05-10/generated/azure_mgmt_resources/models/resource_group_properties.rb +47 -0
  204. data/lib/2019-05-10/generated/azure_mgmt_resources/models/resource_identity_type.rb +18 -0
  205. data/lib/2019-05-10/generated/azure_mgmt_resources/models/resource_list_result.rb +99 -0
  206. data/lib/2019-05-10/generated/azure_mgmt_resources/models/resource_management_error_with_details.rb +92 -0
  207. data/lib/2019-05-10/generated/azure_mgmt_resources/models/resource_provider_operation_display_properties.rb +91 -0
  208. data/lib/2019-05-10/generated/azure_mgmt_resources/models/resources_move_info.rb +65 -0
  209. data/lib/2019-05-10/generated/azure_mgmt_resources/models/sku.rb +101 -0
  210. data/lib/2019-05-10/generated/azure_mgmt_resources/models/sub_resource.rb +46 -0
  211. data/lib/2019-05-10/generated/azure_mgmt_resources/models/tag_count.rb +57 -0
  212. data/lib/2019-05-10/generated/azure_mgmt_resources/models/tag_details.rb +92 -0
  213. data/lib/2019-05-10/generated/azure_mgmt_resources/models/tag_value.rb +70 -0
  214. data/lib/2019-05-10/generated/azure_mgmt_resources/models/tags_list_result.rb +99 -0
  215. data/lib/2019-05-10/generated/azure_mgmt_resources/models/target_resource.rb +68 -0
  216. data/lib/2019-05-10/generated/azure_mgmt_resources/models/template_link.rb +58 -0
  217. data/lib/2019-05-10/generated/azure_mgmt_resources/module_definition.rb +9 -0
  218. data/lib/2019-05-10/generated/azure_mgmt_resources/operations.rb +219 -0
  219. data/lib/2019-05-10/generated/azure_mgmt_resources/providers.rb +530 -0
  220. data/lib/2019-05-10/generated/azure_mgmt_resources/resource_groups.rb +918 -0
  221. data/lib/2019-05-10/generated/azure_mgmt_resources/resource_management_client.rb +155 -0
  222. data/lib/2019-05-10/generated/azure_mgmt_resources/resources.rb +2338 -0
  223. data/lib/2019-05-10/generated/azure_mgmt_resources/tags.rb +611 -0
  224. data/lib/azure_mgmt_resources.rb +3 -0
  225. data/lib/profiles/latest/modules/resources_profile_module.rb +116 -116
  226. data/lib/version.rb +1 -1
  227. metadata +195 -3
@@ -0,0 +1,155 @@
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::Resources::Mgmt::V2019_03_01
7
+ #
8
+ # A service client - single point of access to the REST API.
9
+ #
10
+ class ResourceManagementClient < MsRestAzure::AzureServiceClient
11
+ include MsRestAzure
12
+ include MsRestAzure::Serialization
13
+
14
+ # @return [String] the base URI of the service.
15
+ attr_accessor :base_url
16
+
17
+ # @return Credentials needed for the client to connect to Azure.
18
+ attr_reader :credentials
19
+
20
+ # @return [String] The ID of the target subscription.
21
+ attr_accessor :subscription_id
22
+
23
+ # @return [String] The API version to use for this operation.
24
+ attr_reader :api_version
25
+
26
+ # @return [String] The preferred language for the response.
27
+ attr_accessor :accept_language
28
+
29
+ # @return [Integer] The retry timeout in seconds for Long Running
30
+ # Operations. Default value is 30.
31
+ attr_accessor :long_running_operation_retry_timeout
32
+
33
+ # @return [Boolean] Whether a unique x-ms-client-request-id should be
34
+ # generated. When set to true a unique x-ms-client-request-id value is
35
+ # generated and included in each request. Default is true.
36
+ attr_accessor :generate_client_request_id
37
+
38
+ # @return [Operations] operations
39
+ attr_reader :operations
40
+
41
+ # @return [Deployments] deployments
42
+ attr_reader :deployments
43
+
44
+ # @return [Providers] providers
45
+ attr_reader :providers
46
+
47
+ # @return [Resources] resources
48
+ attr_reader :resources
49
+
50
+ # @return [ResourceGroups] resource_groups
51
+ attr_reader :resource_groups
52
+
53
+ # @return [Tags] tags
54
+ attr_reader :tags
55
+
56
+ # @return [DeploymentOperations] deployment_operations
57
+ attr_reader :deployment_operations
58
+
59
+ #
60
+ # Creates initializes a new instance of the ResourceManagementClient class.
61
+ # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
62
+ # @param base_url [String] the base URI of the service.
63
+ # @param options [Array] filters to be applied to the HTTP requests.
64
+ #
65
+ def initialize(credentials = nil, base_url = nil, options = nil)
66
+ super(credentials, options)
67
+ @base_url = base_url || 'https://management.azure.com'
68
+
69
+ fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
70
+ @credentials = credentials
71
+
72
+ @operations = Operations.new(self)
73
+ @deployments = Deployments.new(self)
74
+ @providers = Providers.new(self)
75
+ @resources = Resources.new(self)
76
+ @resource_groups = ResourceGroups.new(self)
77
+ @tags = Tags.new(self)
78
+ @deployment_operations = DeploymentOperations.new(self)
79
+ @api_version = '2019-03-01'
80
+ @accept_language = 'en-US'
81
+ @long_running_operation_retry_timeout = 30
82
+ @generate_client_request_id = true
83
+ add_telemetry
84
+ end
85
+
86
+ #
87
+ # Makes a request and returns the body of the response.
88
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
89
+ # @param path [String] the path, relative to {base_url}.
90
+ # @param options [Hash{String=>String}] specifying any request options like :body.
91
+ # @return [Hash{String=>String}] containing the body of the response.
92
+ # Example:
93
+ #
94
+ # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
95
+ # path = "/path"
96
+ # options = {
97
+ # body: request_content,
98
+ # query_params: {'api-version' => '2016-02-01'}
99
+ # }
100
+ # result = @client.make_request(:put, path, options)
101
+ #
102
+ def make_request(method, path, options = {})
103
+ result = make_request_with_http_info(method, path, options)
104
+ result.body unless result.nil?
105
+ end
106
+
107
+ #
108
+ # Makes a request and returns the operation response.
109
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
110
+ # @param path [String] the path, relative to {base_url}.
111
+ # @param options [Hash{String=>String}] specifying any request options like :body.
112
+ # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
113
+ #
114
+ def make_request_with_http_info(method, path, options = {})
115
+ result = make_request_async(method, path, options).value!
116
+ result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
117
+ result
118
+ end
119
+
120
+ #
121
+ # Makes a request asynchronously.
122
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
123
+ # @param path [String] the path, relative to {base_url}.
124
+ # @param options [Hash{String=>String}] specifying any request options like :body.
125
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
126
+ #
127
+ def make_request_async(method, path, options = {})
128
+ fail ArgumentError, 'method is nil' if method.nil?
129
+ fail ArgumentError, 'path is nil' if path.nil?
130
+
131
+ request_url = options[:base_url] || @base_url
132
+ if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
133
+ @request_headers['Content-Type'] = options[:headers]['Content-Type']
134
+ end
135
+
136
+ request_headers = @request_headers
137
+ request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
138
+ options.merge!({headers: request_headers.merge(options[:headers] || {})})
139
+ options.merge!({credentials: @credentials}) unless @credentials.nil?
140
+
141
+ super(request_url, method, path, options)
142
+ end
143
+
144
+
145
+ private
146
+ #
147
+ # Adds telemetry information.
148
+ #
149
+ def add_telemetry
150
+ sdk_information = 'azure_mgmt_resources'
151
+ sdk_information = "#{sdk_information}/0.17.6"
152
+ add_user_agent_information(sdk_information)
153
+ end
154
+ end
155
+ end
@@ -0,0 +1,2338 @@
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::Resources::Mgmt::V2019_03_01
7
+ #
8
+ # Provides operations for working with resources and resource groups.
9
+ #
10
+ class Resources
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Resources class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [ResourceManagementClient] reference to the ResourceManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Get all the resources for a resource group.
26
+ #
27
+ # @param resource_group_name [String] The resource group with the resources to
28
+ # get.
29
+ # @param filter [String] The filter to apply on the operation.<br><br>The
30
+ # properties you can use for eq (equals) or ne (not equals) are: location,
31
+ # resourceType, name, resourceGroup, identity, identity/principalId, plan,
32
+ # plan/publisher, plan/product, plan/name, plan/version, and
33
+ # plan/promotionCode.<br><br>For example, to filter by a resource type, use:
34
+ # $filter=resourceType eq 'Microsoft.Network/virtualNetworks'<br><br>You can
35
+ # use substringof(value, property) in the filter. The properties you can use
36
+ # for substring are: name and resourceGroup.<br><br>For example, to get all
37
+ # resources with 'demo' anywhere in the name, use: $filter=substringof('demo',
38
+ # name)<br><br>You can link more than one substringof together by adding and/or
39
+ # operators.<br><br>You can filter by tag names and values. For example, to
40
+ # filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue
41
+ # eq 'Value1'<br><br>You can use some properties together when filtering. The
42
+ # combinations you can use are: substringof and/or resourceType, plan and
43
+ # plan/publisher and plan/name, identity and identity/principalId.
44
+ # @param expand [String] The $expand query parameter. You can expand
45
+ # createdTime and changedTime. For example, to expand both properties, use
46
+ # $expand=changedTime,createdTime
47
+ # @param top [Integer] The number of results to return. If null is passed,
48
+ # returns all resources.
49
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
50
+ # will be added to the HTTP request.
51
+ #
52
+ # @return [Array<GenericResource>] operation results.
53
+ #
54
+ def list_by_resource_group(resource_group_name, filter:nil, expand:nil, top:nil, custom_headers:nil)
55
+ first_page = list_by_resource_group_as_lazy(resource_group_name, filter:filter, expand:expand, top:top, custom_headers:custom_headers)
56
+ first_page.get_all_items
57
+ end
58
+
59
+ #
60
+ # Get all the resources for a resource group.
61
+ #
62
+ # @param resource_group_name [String] The resource group with the resources to
63
+ # get.
64
+ # @param filter [String] The filter to apply on the operation.<br><br>The
65
+ # properties you can use for eq (equals) or ne (not equals) are: location,
66
+ # resourceType, name, resourceGroup, identity, identity/principalId, plan,
67
+ # plan/publisher, plan/product, plan/name, plan/version, and
68
+ # plan/promotionCode.<br><br>For example, to filter by a resource type, use:
69
+ # $filter=resourceType eq 'Microsoft.Network/virtualNetworks'<br><br>You can
70
+ # use substringof(value, property) in the filter. The properties you can use
71
+ # for substring are: name and resourceGroup.<br><br>For example, to get all
72
+ # resources with 'demo' anywhere in the name, use: $filter=substringof('demo',
73
+ # name)<br><br>You can link more than one substringof together by adding and/or
74
+ # operators.<br><br>You can filter by tag names and values. For example, to
75
+ # filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue
76
+ # eq 'Value1'<br><br>You can use some properties together when filtering. The
77
+ # combinations you can use are: substringof and/or resourceType, plan and
78
+ # plan/publisher and plan/name, identity and identity/principalId.
79
+ # @param expand [String] The $expand query parameter. You can expand
80
+ # createdTime and changedTime. For example, to expand both properties, use
81
+ # $expand=changedTime,createdTime
82
+ # @param top [Integer] The number of results to return. If null is passed,
83
+ # returns all resources.
84
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
85
+ # will be added to the HTTP request.
86
+ #
87
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
88
+ #
89
+ def list_by_resource_group_with_http_info(resource_group_name, filter:nil, expand:nil, top:nil, custom_headers:nil)
90
+ list_by_resource_group_async(resource_group_name, filter:filter, expand:expand, top:top, custom_headers:custom_headers).value!
91
+ end
92
+
93
+ #
94
+ # Get all the resources for a resource group.
95
+ #
96
+ # @param resource_group_name [String] The resource group with the resources to
97
+ # get.
98
+ # @param filter [String] The filter to apply on the operation.<br><br>The
99
+ # properties you can use for eq (equals) or ne (not equals) are: location,
100
+ # resourceType, name, resourceGroup, identity, identity/principalId, plan,
101
+ # plan/publisher, plan/product, plan/name, plan/version, and
102
+ # plan/promotionCode.<br><br>For example, to filter by a resource type, use:
103
+ # $filter=resourceType eq 'Microsoft.Network/virtualNetworks'<br><br>You can
104
+ # use substringof(value, property) in the filter. The properties you can use
105
+ # for substring are: name and resourceGroup.<br><br>For example, to get all
106
+ # resources with 'demo' anywhere in the name, use: $filter=substringof('demo',
107
+ # name)<br><br>You can link more than one substringof together by adding and/or
108
+ # operators.<br><br>You can filter by tag names and values. For example, to
109
+ # filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue
110
+ # eq 'Value1'<br><br>You can use some properties together when filtering. The
111
+ # combinations you can use are: substringof and/or resourceType, plan and
112
+ # plan/publisher and plan/name, identity and identity/principalId.
113
+ # @param expand [String] The $expand query parameter. You can expand
114
+ # createdTime and changedTime. For example, to expand both properties, use
115
+ # $expand=changedTime,createdTime
116
+ # @param top [Integer] The number of results to return. If null is passed,
117
+ # returns all resources.
118
+ # @param [Hash{String => String}] A hash of custom headers that will be added
119
+ # to the HTTP request.
120
+ #
121
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
122
+ #
123
+ def list_by_resource_group_async(resource_group_name, filter:nil, expand:nil, top:nil, custom_headers:nil)
124
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
125
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
126
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
127
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
128
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
129
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
130
+
131
+
132
+ request_headers = {}
133
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
134
+
135
+ # Set Headers
136
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
137
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
138
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/resources'
139
+
140
+ request_url = @base_url || @client.base_url
141
+
142
+ options = {
143
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
144
+ path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
145
+ query_params: {'$filter' => filter,'$expand' => expand,'$top' => top,'api-version' => @client.api_version},
146
+ headers: request_headers.merge(custom_headers || {}),
147
+ base_url: request_url
148
+ }
149
+ promise = @client.make_request_async(:get, path_template, options)
150
+
151
+ promise = promise.then do |result|
152
+ http_response = result.response
153
+ status_code = http_response.status
154
+ response_content = http_response.body
155
+ unless status_code == 200
156
+ error_model = JSON.load(response_content)
157
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
158
+ end
159
+
160
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
161
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
162
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
163
+ # Deserialize Response
164
+ if status_code == 200
165
+ begin
166
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
167
+ result_mapper = Azure::Resources::Mgmt::V2019_03_01::Models::ResourceListResult.mapper()
168
+ result.body = @client.deserialize(result_mapper, parsed_response)
169
+ rescue Exception => e
170
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
171
+ end
172
+ end
173
+
174
+ result
175
+ end
176
+
177
+ promise.execute
178
+ end
179
+
180
+ #
181
+ # Moves resources from one resource group to another resource group.
182
+ #
183
+ # The resources to move must be in the same source resource group. The target
184
+ # resource group may be in a different subscription. When moving resources,
185
+ # both the source group and the target group are locked for the duration of the
186
+ # operation. Write and delete operations are blocked on the groups until the
187
+ # move completes.
188
+ #
189
+ # @param source_resource_group_name [String] The name of the resource group
190
+ # containing the resources to move.
191
+ # @param parameters [ResourcesMoveInfo] Parameters for moving resources.
192
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
193
+ # will be added to the HTTP request.
194
+ #
195
+ def move_resources(source_resource_group_name, parameters, custom_headers:nil)
196
+ response = move_resources_async(source_resource_group_name, parameters, custom_headers:custom_headers).value!
197
+ nil
198
+ end
199
+
200
+ #
201
+ # @param source_resource_group_name [String] The name of the resource group
202
+ # containing the resources to move.
203
+ # @param parameters [ResourcesMoveInfo] Parameters for moving resources.
204
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
205
+ # will be added to the HTTP request.
206
+ #
207
+ # @return [Concurrent::Promise] promise which provides async access to http
208
+ # response.
209
+ #
210
+ def move_resources_async(source_resource_group_name, parameters, custom_headers:nil)
211
+ # Send request
212
+ promise = begin_move_resources_async(source_resource_group_name, parameters, custom_headers:custom_headers)
213
+
214
+ promise = promise.then do |response|
215
+ # Defining deserialization method.
216
+ deserialize_method = lambda do |parsed_response|
217
+ end
218
+
219
+ # Waiting for response.
220
+ @client.get_long_running_operation_result(response, deserialize_method)
221
+ end
222
+
223
+ promise
224
+ end
225
+
226
+ #
227
+ # Validates whether resources can be moved from one resource group to another
228
+ # resource group.
229
+ #
230
+ # This operation checks whether the specified resources can be moved to the
231
+ # target. The resources to move must be in the same source resource group. The
232
+ # target resource group may be in a different subscription. If validation
233
+ # succeeds, it returns HTTP response code 204 (no content). If validation
234
+ # fails, it returns HTTP response code 409 (Conflict) with an error message.
235
+ # Retrieve the URL in the Location header value to check the result of the
236
+ # long-running operation.
237
+ #
238
+ # @param source_resource_group_name [String] The name of the resource group
239
+ # containing the resources to validate for move.
240
+ # @param parameters [ResourcesMoveInfo] Parameters for moving resources.
241
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
242
+ # will be added to the HTTP request.
243
+ #
244
+ def validate_move_resources(source_resource_group_name, parameters, custom_headers:nil)
245
+ response = validate_move_resources_async(source_resource_group_name, parameters, custom_headers:custom_headers).value!
246
+ nil
247
+ end
248
+
249
+ #
250
+ # @param source_resource_group_name [String] The name of the resource group
251
+ # containing the resources to validate for move.
252
+ # @param parameters [ResourcesMoveInfo] Parameters for moving resources.
253
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
254
+ # will be added to the HTTP request.
255
+ #
256
+ # @return [Concurrent::Promise] promise which provides async access to http
257
+ # response.
258
+ #
259
+ def validate_move_resources_async(source_resource_group_name, parameters, custom_headers:nil)
260
+ # Send request
261
+ promise = begin_validate_move_resources_async(source_resource_group_name, parameters, custom_headers:custom_headers)
262
+
263
+ promise = promise.then do |response|
264
+ # Defining deserialization method.
265
+ deserialize_method = lambda do |parsed_response|
266
+ end
267
+
268
+ # Waiting for response.
269
+ @client.get_long_running_operation_result(response, deserialize_method)
270
+ end
271
+
272
+ promise
273
+ end
274
+
275
+ #
276
+ # Get all the resources in a subscription.
277
+ #
278
+ # @param filter [String] The filter to apply on the operation.<br><br>The
279
+ # properties you can use for eq (equals) or ne (not equals) are: location,
280
+ # resourceType, name, resourceGroup, identity, identity/principalId, plan,
281
+ # plan/publisher, plan/product, plan/name, plan/version, and
282
+ # plan/promotionCode.<br><br>For example, to filter by a resource type, use:
283
+ # $filter=resourceType eq 'Microsoft.Network/virtualNetworks'<br><br>You can
284
+ # use substringof(value, property) in the filter. The properties you can use
285
+ # for substring are: name and resourceGroup.<br><br>For example, to get all
286
+ # resources with 'demo' anywhere in the name, use: $filter=substringof('demo',
287
+ # name)<br><br>You can link more than one substringof together by adding and/or
288
+ # operators.<br><br>You can filter by tag names and values. For example, to
289
+ # filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue
290
+ # eq 'Value1'<br><br>You can use some properties together when filtering. The
291
+ # combinations you can use are: substringof and/or resourceType, plan and
292
+ # plan/publisher and plan/name, identity and identity/principalId.
293
+ # @param expand [String] The $expand query parameter. You can expand
294
+ # createdTime and changedTime. For example, to expand both properties, use
295
+ # $expand=changedTime,createdTime
296
+ # @param top [Integer] The number of results to return. If null is passed,
297
+ # returns all resource groups.
298
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
299
+ # will be added to the HTTP request.
300
+ #
301
+ # @return [Array<GenericResource>] operation results.
302
+ #
303
+ def list(filter:nil, expand:nil, top:nil, custom_headers:nil)
304
+ first_page = list_as_lazy(filter:filter, expand:expand, top:top, custom_headers:custom_headers)
305
+ first_page.get_all_items
306
+ end
307
+
308
+ #
309
+ # Get all the resources in a subscription.
310
+ #
311
+ # @param filter [String] The filter to apply on the operation.<br><br>The
312
+ # properties you can use for eq (equals) or ne (not equals) are: location,
313
+ # resourceType, name, resourceGroup, identity, identity/principalId, plan,
314
+ # plan/publisher, plan/product, plan/name, plan/version, and
315
+ # plan/promotionCode.<br><br>For example, to filter by a resource type, use:
316
+ # $filter=resourceType eq 'Microsoft.Network/virtualNetworks'<br><br>You can
317
+ # use substringof(value, property) in the filter. The properties you can use
318
+ # for substring are: name and resourceGroup.<br><br>For example, to get all
319
+ # resources with 'demo' anywhere in the name, use: $filter=substringof('demo',
320
+ # name)<br><br>You can link more than one substringof together by adding and/or
321
+ # operators.<br><br>You can filter by tag names and values. For example, to
322
+ # filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue
323
+ # eq 'Value1'<br><br>You can use some properties together when filtering. The
324
+ # combinations you can use are: substringof and/or resourceType, plan and
325
+ # plan/publisher and plan/name, identity and identity/principalId.
326
+ # @param expand [String] The $expand query parameter. You can expand
327
+ # createdTime and changedTime. For example, to expand both properties, use
328
+ # $expand=changedTime,createdTime
329
+ # @param top [Integer] The number of results to return. If null is passed,
330
+ # returns all resource groups.
331
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
332
+ # will be added to the HTTP request.
333
+ #
334
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
335
+ #
336
+ def list_with_http_info(filter:nil, expand:nil, top:nil, custom_headers:nil)
337
+ list_async(filter:filter, expand:expand, top:top, custom_headers:custom_headers).value!
338
+ end
339
+
340
+ #
341
+ # Get all the resources in a subscription.
342
+ #
343
+ # @param filter [String] The filter to apply on the operation.<br><br>The
344
+ # properties you can use for eq (equals) or ne (not equals) are: location,
345
+ # resourceType, name, resourceGroup, identity, identity/principalId, plan,
346
+ # plan/publisher, plan/product, plan/name, plan/version, and
347
+ # plan/promotionCode.<br><br>For example, to filter by a resource type, use:
348
+ # $filter=resourceType eq 'Microsoft.Network/virtualNetworks'<br><br>You can
349
+ # use substringof(value, property) in the filter. The properties you can use
350
+ # for substring are: name and resourceGroup.<br><br>For example, to get all
351
+ # resources with 'demo' anywhere in the name, use: $filter=substringof('demo',
352
+ # name)<br><br>You can link more than one substringof together by adding and/or
353
+ # operators.<br><br>You can filter by tag names and values. For example, to
354
+ # filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue
355
+ # eq 'Value1'<br><br>You can use some properties together when filtering. The
356
+ # combinations you can use are: substringof and/or resourceType, plan and
357
+ # plan/publisher and plan/name, identity and identity/principalId.
358
+ # @param expand [String] The $expand query parameter. You can expand
359
+ # createdTime and changedTime. For example, to expand both properties, use
360
+ # $expand=changedTime,createdTime
361
+ # @param top [Integer] The number of results to return. If null is passed,
362
+ # returns all resource groups.
363
+ # @param [Hash{String => String}] A hash of custom headers that will be added
364
+ # to the HTTP request.
365
+ #
366
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
367
+ #
368
+ def list_async(filter:nil, expand:nil, top:nil, custom_headers:nil)
369
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
370
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
371
+
372
+
373
+ request_headers = {}
374
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
375
+
376
+ # Set Headers
377
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
378
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
379
+ path_template = 'subscriptions/{subscriptionId}/resources'
380
+
381
+ request_url = @base_url || @client.base_url
382
+
383
+ options = {
384
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
385
+ path_params: {'subscriptionId' => @client.subscription_id},
386
+ query_params: {'$filter' => filter,'$expand' => expand,'$top' => top,'api-version' => @client.api_version},
387
+ headers: request_headers.merge(custom_headers || {}),
388
+ base_url: request_url
389
+ }
390
+ promise = @client.make_request_async(:get, path_template, options)
391
+
392
+ promise = promise.then do |result|
393
+ http_response = result.response
394
+ status_code = http_response.status
395
+ response_content = http_response.body
396
+ unless status_code == 200
397
+ error_model = JSON.load(response_content)
398
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
399
+ end
400
+
401
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
402
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
403
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
404
+ # Deserialize Response
405
+ if status_code == 200
406
+ begin
407
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
408
+ result_mapper = Azure::Resources::Mgmt::V2019_03_01::Models::ResourceListResult.mapper()
409
+ result.body = @client.deserialize(result_mapper, parsed_response)
410
+ rescue Exception => e
411
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
412
+ end
413
+ end
414
+
415
+ result
416
+ end
417
+
418
+ promise.execute
419
+ end
420
+
421
+ #
422
+ # Checks whether a resource exists.
423
+ #
424
+ # @param resource_group_name [String] The name of the resource group containing
425
+ # the resource to check. The name is case insensitive.
426
+ # @param resource_provider_namespace [String] The resource provider of the
427
+ # resource to check.
428
+ # @param parent_resource_path [String] The parent resource identity.
429
+ # @param resource_type [String] The resource type.
430
+ # @param resource_name [String] The name of the resource to check whether it
431
+ # exists.
432
+ # @param api_version [String] The API version to use for the operation.
433
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
434
+ # will be added to the HTTP request.
435
+ #
436
+ # @return [Boolean] operation results.
437
+ #
438
+ def check_existence(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers:nil)
439
+ response = check_existence_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers:custom_headers).value!
440
+ response.body unless response.nil?
441
+ end
442
+
443
+ #
444
+ # Checks whether a resource exists.
445
+ #
446
+ # @param resource_group_name [String] The name of the resource group containing
447
+ # the resource to check. The name is case insensitive.
448
+ # @param resource_provider_namespace [String] The resource provider of the
449
+ # resource to check.
450
+ # @param parent_resource_path [String] The parent resource identity.
451
+ # @param resource_type [String] The resource type.
452
+ # @param resource_name [String] The name of the resource to check whether it
453
+ # exists.
454
+ # @param api_version [String] The API version to use for the operation.
455
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
456
+ # will be added to the HTTP request.
457
+ #
458
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
459
+ #
460
+ def check_existence_with_http_info(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers:nil)
461
+ check_existence_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers:custom_headers).value!
462
+ end
463
+
464
+ #
465
+ # Checks whether a resource exists.
466
+ #
467
+ # @param resource_group_name [String] The name of the resource group containing
468
+ # the resource to check. The name is case insensitive.
469
+ # @param resource_provider_namespace [String] The resource provider of the
470
+ # resource to check.
471
+ # @param parent_resource_path [String] The parent resource identity.
472
+ # @param resource_type [String] The resource type.
473
+ # @param resource_name [String] The name of the resource to check whether it
474
+ # exists.
475
+ # @param api_version [String] The API version to use for the operation.
476
+ # @param [Hash{String => String}] A hash of custom headers that will be added
477
+ # to the HTTP request.
478
+ #
479
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
480
+ #
481
+ def check_existence_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers:nil)
482
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
483
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
484
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
485
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
486
+ fail ArgumentError, 'resource_provider_namespace is nil' if resource_provider_namespace.nil?
487
+ fail ArgumentError, 'parent_resource_path is nil' if parent_resource_path.nil?
488
+ fail ArgumentError, 'resource_type is nil' if resource_type.nil?
489
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
490
+ fail ArgumentError, 'api_version is nil' if api_version.nil?
491
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
492
+
493
+
494
+ request_headers = {}
495
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
496
+
497
+ # Set Headers
498
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
499
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
500
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}'
501
+
502
+ request_url = @base_url || @client.base_url
503
+
504
+ options = {
505
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
506
+ path_params: {'resourceGroupName' => resource_group_name,'resourceProviderNamespace' => resource_provider_namespace,'resourceName' => resource_name,'subscriptionId' => @client.subscription_id},
507
+ skip_encoding_path_params: {'parentResourcePath' => parent_resource_path,'resourceType' => resource_type},
508
+ query_params: {'api-version' => api_version},
509
+ headers: request_headers.merge(custom_headers || {}),
510
+ base_url: request_url
511
+ }
512
+ promise = @client.make_request_async(:head, path_template, options)
513
+
514
+ promise = promise.then do |result|
515
+ http_response = result.response
516
+ status_code = http_response.status
517
+ response_content = http_response.body
518
+ unless status_code == 204 || status_code == 404
519
+ error_model = JSON.load(response_content)
520
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
521
+ end
522
+
523
+ result.body = (status_code == 204)
524
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
525
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
526
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
527
+
528
+ result
529
+ end
530
+
531
+ promise.execute
532
+ end
533
+
534
+ #
535
+ # Deletes a resource.
536
+ #
537
+ # @param resource_group_name [String] The name of the resource group that
538
+ # contains the resource to delete. The name is case insensitive.
539
+ # @param resource_provider_namespace [String] The namespace of the resource
540
+ # provider.
541
+ # @param parent_resource_path [String] The parent resource identity.
542
+ # @param resource_type [String] The resource type.
543
+ # @param resource_name [String] The name of the resource to delete.
544
+ # @param api_version [String] The API version to use for the operation.
545
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
546
+ # will be added to the HTTP request.
547
+ #
548
+ def delete(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers:nil)
549
+ response = delete_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers:custom_headers).value!
550
+ nil
551
+ end
552
+
553
+ #
554
+ # @param resource_group_name [String] The name of the resource group that
555
+ # contains the resource to delete. The name is case insensitive.
556
+ # @param resource_provider_namespace [String] The namespace of the resource
557
+ # provider.
558
+ # @param parent_resource_path [String] The parent resource identity.
559
+ # @param resource_type [String] The resource type.
560
+ # @param resource_name [String] The name of the resource to delete.
561
+ # @param api_version [String] The API version to use for the operation.
562
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
563
+ # will be added to the HTTP request.
564
+ #
565
+ # @return [Concurrent::Promise] promise which provides async access to http
566
+ # response.
567
+ #
568
+ def delete_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers:nil)
569
+ # Send request
570
+ promise = begin_delete_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers:custom_headers)
571
+
572
+ promise = promise.then do |response|
573
+ # Defining deserialization method.
574
+ deserialize_method = lambda do |parsed_response|
575
+ end
576
+
577
+ # Waiting for response.
578
+ @client.get_long_running_operation_result(response, deserialize_method)
579
+ end
580
+
581
+ promise
582
+ end
583
+
584
+ #
585
+ # Creates a resource.
586
+ #
587
+ # @param resource_group_name [String] The name of the resource group for the
588
+ # resource. The name is case insensitive.
589
+ # @param resource_provider_namespace [String] The namespace of the resource
590
+ # provider.
591
+ # @param parent_resource_path [String] The parent resource identity.
592
+ # @param resource_type [String] The resource type of the resource to create.
593
+ # @param resource_name [String] The name of the resource to create.
594
+ # @param api_version [String] The API version to use for the operation.
595
+ # @param parameters [GenericResource] Parameters for creating or updating the
596
+ # resource.
597
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
598
+ # will be added to the HTTP request.
599
+ #
600
+ # @return [GenericResource] operation results.
601
+ #
602
+ def create_or_update(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers:nil)
603
+ response = create_or_update_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers:custom_headers).value!
604
+ response.body unless response.nil?
605
+ end
606
+
607
+ #
608
+ # @param resource_group_name [String] The name of the resource group for the
609
+ # resource. The name is case insensitive.
610
+ # @param resource_provider_namespace [String] The namespace of the resource
611
+ # provider.
612
+ # @param parent_resource_path [String] The parent resource identity.
613
+ # @param resource_type [String] The resource type of the resource to create.
614
+ # @param resource_name [String] The name of the resource to create.
615
+ # @param api_version [String] The API version to use for the operation.
616
+ # @param parameters [GenericResource] Parameters for creating or updating the
617
+ # resource.
618
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
619
+ # will be added to the HTTP request.
620
+ #
621
+ # @return [Concurrent::Promise] promise which provides async access to http
622
+ # response.
623
+ #
624
+ def create_or_update_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers:nil)
625
+ # Send request
626
+ promise = begin_create_or_update_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers:custom_headers)
627
+
628
+ promise = promise.then do |response|
629
+ # Defining deserialization method.
630
+ deserialize_method = lambda do |parsed_response|
631
+ result_mapper = Azure::Resources::Mgmt::V2019_03_01::Models::GenericResource.mapper()
632
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
633
+ end
634
+
635
+ # Waiting for response.
636
+ @client.get_long_running_operation_result(response, deserialize_method)
637
+ end
638
+
639
+ promise
640
+ end
641
+
642
+ #
643
+ # Updates a resource.
644
+ #
645
+ # @param resource_group_name [String] The name of the resource group for the
646
+ # resource. The name is case insensitive.
647
+ # @param resource_provider_namespace [String] The namespace of the resource
648
+ # provider.
649
+ # @param parent_resource_path [String] The parent resource identity.
650
+ # @param resource_type [String] The resource type of the resource to update.
651
+ # @param resource_name [String] The name of the resource to update.
652
+ # @param api_version [String] The API version to use for the operation.
653
+ # @param parameters [GenericResource] Parameters for updating the resource.
654
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
655
+ # will be added to the HTTP request.
656
+ #
657
+ # @return [GenericResource] operation results.
658
+ #
659
+ def update(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers:nil)
660
+ response = update_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers:custom_headers).value!
661
+ response.body unless response.nil?
662
+ end
663
+
664
+ #
665
+ # @param resource_group_name [String] The name of the resource group for the
666
+ # resource. The name is case insensitive.
667
+ # @param resource_provider_namespace [String] The namespace of the resource
668
+ # provider.
669
+ # @param parent_resource_path [String] The parent resource identity.
670
+ # @param resource_type [String] The resource type of the resource to update.
671
+ # @param resource_name [String] The name of the resource to update.
672
+ # @param api_version [String] The API version to use for the operation.
673
+ # @param parameters [GenericResource] Parameters for updating the resource.
674
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
675
+ # will be added to the HTTP request.
676
+ #
677
+ # @return [Concurrent::Promise] promise which provides async access to http
678
+ # response.
679
+ #
680
+ def update_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers:nil)
681
+ # Send request
682
+ promise = begin_update_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers:custom_headers)
683
+
684
+ promise = promise.then do |response|
685
+ # Defining deserialization method.
686
+ deserialize_method = lambda do |parsed_response|
687
+ result_mapper = Azure::Resources::Mgmt::V2019_03_01::Models::GenericResource.mapper()
688
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
689
+ end
690
+
691
+ # Waiting for response.
692
+ @client.get_long_running_operation_result(response, deserialize_method)
693
+ end
694
+
695
+ promise
696
+ end
697
+
698
+ #
699
+ # Gets a resource.
700
+ #
701
+ # @param resource_group_name [String] The name of the resource group containing
702
+ # the resource to get. The name is case insensitive.
703
+ # @param resource_provider_namespace [String] The namespace of the resource
704
+ # provider.
705
+ # @param parent_resource_path [String] The parent resource identity.
706
+ # @param resource_type [String] The resource type of the resource.
707
+ # @param resource_name [String] The name of the resource to get.
708
+ # @param api_version [String] The API version to use for the operation.
709
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
710
+ # will be added to the HTTP request.
711
+ #
712
+ # @return [GenericResource] operation results.
713
+ #
714
+ def get(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers:nil)
715
+ response = get_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers:custom_headers).value!
716
+ response.body unless response.nil?
717
+ end
718
+
719
+ #
720
+ # Gets a resource.
721
+ #
722
+ # @param resource_group_name [String] The name of the resource group containing
723
+ # the resource to get. The name is case insensitive.
724
+ # @param resource_provider_namespace [String] The namespace of the resource
725
+ # provider.
726
+ # @param parent_resource_path [String] The parent resource identity.
727
+ # @param resource_type [String] The resource type of the resource.
728
+ # @param resource_name [String] The name of the resource to get.
729
+ # @param api_version [String] The API version to use for the operation.
730
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
731
+ # will be added to the HTTP request.
732
+ #
733
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
734
+ #
735
+ def get_with_http_info(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers:nil)
736
+ get_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers:custom_headers).value!
737
+ end
738
+
739
+ #
740
+ # Gets a resource.
741
+ #
742
+ # @param resource_group_name [String] The name of the resource group containing
743
+ # the resource to get. The name is case insensitive.
744
+ # @param resource_provider_namespace [String] The namespace of the resource
745
+ # provider.
746
+ # @param parent_resource_path [String] The parent resource identity.
747
+ # @param resource_type [String] The resource type of the resource.
748
+ # @param resource_name [String] The name of the resource to get.
749
+ # @param api_version [String] The API version to use for the operation.
750
+ # @param [Hash{String => String}] A hash of custom headers that will be added
751
+ # to the HTTP request.
752
+ #
753
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
754
+ #
755
+ def get_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers:nil)
756
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
757
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
758
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
759
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
760
+ fail ArgumentError, 'resource_provider_namespace is nil' if resource_provider_namespace.nil?
761
+ fail ArgumentError, 'parent_resource_path is nil' if parent_resource_path.nil?
762
+ fail ArgumentError, 'resource_type is nil' if resource_type.nil?
763
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
764
+ fail ArgumentError, 'api_version is nil' if api_version.nil?
765
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
766
+
767
+
768
+ request_headers = {}
769
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
770
+
771
+ # Set Headers
772
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
773
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
774
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}'
775
+
776
+ request_url = @base_url || @client.base_url
777
+
778
+ options = {
779
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
780
+ path_params: {'resourceGroupName' => resource_group_name,'resourceProviderNamespace' => resource_provider_namespace,'resourceName' => resource_name,'subscriptionId' => @client.subscription_id},
781
+ skip_encoding_path_params: {'parentResourcePath' => parent_resource_path,'resourceType' => resource_type},
782
+ query_params: {'api-version' => api_version},
783
+ headers: request_headers.merge(custom_headers || {}),
784
+ base_url: request_url
785
+ }
786
+ promise = @client.make_request_async(:get, path_template, options)
787
+
788
+ promise = promise.then do |result|
789
+ http_response = result.response
790
+ status_code = http_response.status
791
+ response_content = http_response.body
792
+ unless status_code == 200
793
+ error_model = JSON.load(response_content)
794
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
795
+ end
796
+
797
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
798
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
799
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
800
+ # Deserialize Response
801
+ if status_code == 200
802
+ begin
803
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
804
+ result_mapper = Azure::Resources::Mgmt::V2019_03_01::Models::GenericResource.mapper()
805
+ result.body = @client.deserialize(result_mapper, parsed_response)
806
+ rescue Exception => e
807
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
808
+ end
809
+ end
810
+
811
+ result
812
+ end
813
+
814
+ promise.execute
815
+ end
816
+
817
+ #
818
+ # Checks by ID whether a resource exists.
819
+ #
820
+ # @param resource_id [String] The fully qualified ID of the resource, including
821
+ # the resource name and resource type. Use the format,
822
+ # /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
823
+ # @param api_version [String] The API version to use for the operation.
824
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
825
+ # will be added to the HTTP request.
826
+ #
827
+ # @return [Boolean] operation results.
828
+ #
829
+ def check_existence_by_id(resource_id, api_version, custom_headers:nil)
830
+ response = check_existence_by_id_async(resource_id, api_version, custom_headers:custom_headers).value!
831
+ response.body unless response.nil?
832
+ end
833
+
834
+ #
835
+ # Checks by ID whether a resource exists.
836
+ #
837
+ # @param resource_id [String] The fully qualified ID of the resource, including
838
+ # the resource name and resource type. Use the format,
839
+ # /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
840
+ # @param api_version [String] The API version to use for the operation.
841
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
842
+ # will be added to the HTTP request.
843
+ #
844
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
845
+ #
846
+ def check_existence_by_id_with_http_info(resource_id, api_version, custom_headers:nil)
847
+ check_existence_by_id_async(resource_id, api_version, custom_headers:custom_headers).value!
848
+ end
849
+
850
+ #
851
+ # Checks by ID whether a resource exists.
852
+ #
853
+ # @param resource_id [String] The fully qualified ID of the resource, including
854
+ # the resource name and resource type. Use the format,
855
+ # /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
856
+ # @param api_version [String] The API version to use for the operation.
857
+ # @param [Hash{String => String}] A hash of custom headers that will be added
858
+ # to the HTTP request.
859
+ #
860
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
861
+ #
862
+ def check_existence_by_id_async(resource_id, api_version, custom_headers:nil)
863
+ fail ArgumentError, 'resource_id is nil' if resource_id.nil?
864
+ fail ArgumentError, 'api_version is nil' if api_version.nil?
865
+
866
+
867
+ request_headers = {}
868
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
869
+
870
+ # Set Headers
871
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
872
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
873
+ path_template = '{resourceId}'
874
+
875
+ request_url = @base_url || @client.base_url
876
+
877
+ options = {
878
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
879
+ skip_encoding_path_params: {'resourceId' => resource_id},
880
+ query_params: {'api-version' => api_version},
881
+ headers: request_headers.merge(custom_headers || {}),
882
+ base_url: request_url
883
+ }
884
+ promise = @client.make_request_async(:head, path_template, options)
885
+
886
+ promise = promise.then do |result|
887
+ http_response = result.response
888
+ status_code = http_response.status
889
+ response_content = http_response.body
890
+ unless status_code == 204 || status_code == 404
891
+ error_model = JSON.load(response_content)
892
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
893
+ end
894
+
895
+ result.body = (status_code == 204)
896
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
897
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
898
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
899
+
900
+ result
901
+ end
902
+
903
+ promise.execute
904
+ end
905
+
906
+ #
907
+ # Deletes a resource by ID.
908
+ #
909
+ # @param resource_id [String] The fully qualified ID of the resource, including
910
+ # the resource name and resource type. Use the format,
911
+ # /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
912
+ # @param api_version [String] The API version to use for the operation.
913
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
914
+ # will be added to the HTTP request.
915
+ #
916
+ def delete_by_id(resource_id, api_version, custom_headers:nil)
917
+ response = delete_by_id_async(resource_id, api_version, custom_headers:custom_headers).value!
918
+ nil
919
+ end
920
+
921
+ #
922
+ # @param resource_id [String] The fully qualified ID of the resource, including
923
+ # the resource name and resource type. Use the format,
924
+ # /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
925
+ # @param api_version [String] The API version to use for the operation.
926
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
927
+ # will be added to the HTTP request.
928
+ #
929
+ # @return [Concurrent::Promise] promise which provides async access to http
930
+ # response.
931
+ #
932
+ def delete_by_id_async(resource_id, api_version, custom_headers:nil)
933
+ # Send request
934
+ promise = begin_delete_by_id_async(resource_id, api_version, custom_headers:custom_headers)
935
+
936
+ promise = promise.then do |response|
937
+ # Defining deserialization method.
938
+ deserialize_method = lambda do |parsed_response|
939
+ end
940
+
941
+ # Waiting for response.
942
+ @client.get_long_running_operation_result(response, deserialize_method)
943
+ end
944
+
945
+ promise
946
+ end
947
+
948
+ #
949
+ # Create a resource by ID.
950
+ #
951
+ # @param resource_id [String] The fully qualified ID of the resource, including
952
+ # the resource name and resource type. Use the format,
953
+ # /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
954
+ # @param api_version [String] The API version to use for the operation.
955
+ # @param parameters [GenericResource] Create or update resource parameters.
956
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
957
+ # will be added to the HTTP request.
958
+ #
959
+ # @return [GenericResource] operation results.
960
+ #
961
+ def create_or_update_by_id(resource_id, api_version, parameters, custom_headers:nil)
962
+ response = create_or_update_by_id_async(resource_id, api_version, parameters, custom_headers:custom_headers).value!
963
+ response.body unless response.nil?
964
+ end
965
+
966
+ #
967
+ # @param resource_id [String] The fully qualified ID of the resource, including
968
+ # the resource name and resource type. Use the format,
969
+ # /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
970
+ # @param api_version [String] The API version to use for the operation.
971
+ # @param parameters [GenericResource] Create or update resource parameters.
972
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
973
+ # will be added to the HTTP request.
974
+ #
975
+ # @return [Concurrent::Promise] promise which provides async access to http
976
+ # response.
977
+ #
978
+ def create_or_update_by_id_async(resource_id, api_version, parameters, custom_headers:nil)
979
+ # Send request
980
+ promise = begin_create_or_update_by_id_async(resource_id, api_version, parameters, custom_headers:custom_headers)
981
+
982
+ promise = promise.then do |response|
983
+ # Defining deserialization method.
984
+ deserialize_method = lambda do |parsed_response|
985
+ result_mapper = Azure::Resources::Mgmt::V2019_03_01::Models::GenericResource.mapper()
986
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
987
+ end
988
+
989
+ # Waiting for response.
990
+ @client.get_long_running_operation_result(response, deserialize_method)
991
+ end
992
+
993
+ promise
994
+ end
995
+
996
+ #
997
+ # Updates a resource by ID.
998
+ #
999
+ # @param resource_id [String] The fully qualified ID of the resource, including
1000
+ # the resource name and resource type. Use the format,
1001
+ # /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
1002
+ # @param api_version [String] The API version to use for the operation.
1003
+ # @param parameters [GenericResource] Update resource parameters.
1004
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1005
+ # will be added to the HTTP request.
1006
+ #
1007
+ # @return [GenericResource] operation results.
1008
+ #
1009
+ def update_by_id(resource_id, api_version, parameters, custom_headers:nil)
1010
+ response = update_by_id_async(resource_id, api_version, parameters, custom_headers:custom_headers).value!
1011
+ response.body unless response.nil?
1012
+ end
1013
+
1014
+ #
1015
+ # @param resource_id [String] The fully qualified ID of the resource, including
1016
+ # the resource name and resource type. Use the format,
1017
+ # /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
1018
+ # @param api_version [String] The API version to use for the operation.
1019
+ # @param parameters [GenericResource] Update resource parameters.
1020
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1021
+ # will be added to the HTTP request.
1022
+ #
1023
+ # @return [Concurrent::Promise] promise which provides async access to http
1024
+ # response.
1025
+ #
1026
+ def update_by_id_async(resource_id, api_version, parameters, custom_headers:nil)
1027
+ # Send request
1028
+ promise = begin_update_by_id_async(resource_id, api_version, parameters, custom_headers:custom_headers)
1029
+
1030
+ promise = promise.then do |response|
1031
+ # Defining deserialization method.
1032
+ deserialize_method = lambda do |parsed_response|
1033
+ result_mapper = Azure::Resources::Mgmt::V2019_03_01::Models::GenericResource.mapper()
1034
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
1035
+ end
1036
+
1037
+ # Waiting for response.
1038
+ @client.get_long_running_operation_result(response, deserialize_method)
1039
+ end
1040
+
1041
+ promise
1042
+ end
1043
+
1044
+ #
1045
+ # Gets a resource by ID.
1046
+ #
1047
+ # @param resource_id [String] The fully qualified ID of the resource, including
1048
+ # the resource name and resource type. Use the format,
1049
+ # /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
1050
+ # @param api_version [String] The API version to use for the operation.
1051
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1052
+ # will be added to the HTTP request.
1053
+ #
1054
+ # @return [GenericResource] operation results.
1055
+ #
1056
+ def get_by_id(resource_id, api_version, custom_headers:nil)
1057
+ response = get_by_id_async(resource_id, api_version, custom_headers:custom_headers).value!
1058
+ response.body unless response.nil?
1059
+ end
1060
+
1061
+ #
1062
+ # Gets a resource by ID.
1063
+ #
1064
+ # @param resource_id [String] The fully qualified ID of the resource, including
1065
+ # the resource name and resource type. Use the format,
1066
+ # /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
1067
+ # @param api_version [String] The API version to use for the operation.
1068
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1069
+ # will be added to the HTTP request.
1070
+ #
1071
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1072
+ #
1073
+ def get_by_id_with_http_info(resource_id, api_version, custom_headers:nil)
1074
+ get_by_id_async(resource_id, api_version, custom_headers:custom_headers).value!
1075
+ end
1076
+
1077
+ #
1078
+ # Gets a resource by ID.
1079
+ #
1080
+ # @param resource_id [String] The fully qualified ID of the resource, including
1081
+ # the resource name and resource type. Use the format,
1082
+ # /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
1083
+ # @param api_version [String] The API version to use for the operation.
1084
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1085
+ # to the HTTP request.
1086
+ #
1087
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1088
+ #
1089
+ def get_by_id_async(resource_id, api_version, custom_headers:nil)
1090
+ fail ArgumentError, 'resource_id is nil' if resource_id.nil?
1091
+ fail ArgumentError, 'api_version is nil' if api_version.nil?
1092
+
1093
+
1094
+ request_headers = {}
1095
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1096
+
1097
+ # Set Headers
1098
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1099
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1100
+ path_template = '{resourceId}'
1101
+
1102
+ request_url = @base_url || @client.base_url
1103
+
1104
+ options = {
1105
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1106
+ skip_encoding_path_params: {'resourceId' => resource_id},
1107
+ query_params: {'api-version' => api_version},
1108
+ headers: request_headers.merge(custom_headers || {}),
1109
+ base_url: request_url
1110
+ }
1111
+ promise = @client.make_request_async(:get, path_template, options)
1112
+
1113
+ promise = promise.then do |result|
1114
+ http_response = result.response
1115
+ status_code = http_response.status
1116
+ response_content = http_response.body
1117
+ unless status_code == 200
1118
+ error_model = JSON.load(response_content)
1119
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1120
+ end
1121
+
1122
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1123
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1124
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1125
+ # Deserialize Response
1126
+ if status_code == 200
1127
+ begin
1128
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1129
+ result_mapper = Azure::Resources::Mgmt::V2019_03_01::Models::GenericResource.mapper()
1130
+ result.body = @client.deserialize(result_mapper, parsed_response)
1131
+ rescue Exception => e
1132
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1133
+ end
1134
+ end
1135
+
1136
+ result
1137
+ end
1138
+
1139
+ promise.execute
1140
+ end
1141
+
1142
+ #
1143
+ # Moves resources from one resource group to another resource group.
1144
+ #
1145
+ # The resources to move must be in the same source resource group. The target
1146
+ # resource group may be in a different subscription. When moving resources,
1147
+ # both the source group and the target group are locked for the duration of the
1148
+ # operation. Write and delete operations are blocked on the groups until the
1149
+ # move completes.
1150
+ #
1151
+ # @param source_resource_group_name [String] The name of the resource group
1152
+ # containing the resources to move.
1153
+ # @param parameters [ResourcesMoveInfo] Parameters for moving resources.
1154
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1155
+ # will be added to the HTTP request.
1156
+ #
1157
+ #
1158
+ def begin_move_resources(source_resource_group_name, parameters, custom_headers:nil)
1159
+ response = begin_move_resources_async(source_resource_group_name, parameters, custom_headers:custom_headers).value!
1160
+ nil
1161
+ end
1162
+
1163
+ #
1164
+ # Moves resources from one resource group to another resource group.
1165
+ #
1166
+ # The resources to move must be in the same source resource group. The target
1167
+ # resource group may be in a different subscription. When moving resources,
1168
+ # both the source group and the target group are locked for the duration of the
1169
+ # operation. Write and delete operations are blocked on the groups until the
1170
+ # move completes.
1171
+ #
1172
+ # @param source_resource_group_name [String] The name of the resource group
1173
+ # containing the resources to move.
1174
+ # @param parameters [ResourcesMoveInfo] Parameters for moving resources.
1175
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1176
+ # will be added to the HTTP request.
1177
+ #
1178
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1179
+ #
1180
+ def begin_move_resources_with_http_info(source_resource_group_name, parameters, custom_headers:nil)
1181
+ begin_move_resources_async(source_resource_group_name, parameters, custom_headers:custom_headers).value!
1182
+ end
1183
+
1184
+ #
1185
+ # Moves resources from one resource group to another resource group.
1186
+ #
1187
+ # The resources to move must be in the same source resource group. The target
1188
+ # resource group may be in a different subscription. When moving resources,
1189
+ # both the source group and the target group are locked for the duration of the
1190
+ # operation. Write and delete operations are blocked on the groups until the
1191
+ # move completes.
1192
+ #
1193
+ # @param source_resource_group_name [String] The name of the resource group
1194
+ # containing the resources to move.
1195
+ # @param parameters [ResourcesMoveInfo] Parameters for moving resources.
1196
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1197
+ # to the HTTP request.
1198
+ #
1199
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1200
+ #
1201
+ def begin_move_resources_async(source_resource_group_name, parameters, custom_headers:nil)
1202
+ fail ArgumentError, 'source_resource_group_name is nil' if source_resource_group_name.nil?
1203
+ fail ArgumentError, "'source_resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !source_resource_group_name.nil? && source_resource_group_name.length > 90
1204
+ fail ArgumentError, "'source_resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !source_resource_group_name.nil? && source_resource_group_name.length < 1
1205
+ fail ArgumentError, "'source_resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !source_resource_group_name.nil? && source_resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1206
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1207
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1208
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1209
+
1210
+
1211
+ request_headers = {}
1212
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1213
+
1214
+ # Set Headers
1215
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1216
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1217
+
1218
+ # Serialize Request
1219
+ request_mapper = Azure::Resources::Mgmt::V2019_03_01::Models::ResourcesMoveInfo.mapper()
1220
+ request_content = @client.serialize(request_mapper, parameters)
1221
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1222
+
1223
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/moveResources'
1224
+
1225
+ request_url = @base_url || @client.base_url
1226
+
1227
+ options = {
1228
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1229
+ path_params: {'sourceResourceGroupName' => source_resource_group_name,'subscriptionId' => @client.subscription_id},
1230
+ query_params: {'api-version' => @client.api_version},
1231
+ body: request_content,
1232
+ headers: request_headers.merge(custom_headers || {}),
1233
+ base_url: request_url
1234
+ }
1235
+ promise = @client.make_request_async(:post, path_template, options)
1236
+
1237
+ promise = promise.then do |result|
1238
+ http_response = result.response
1239
+ status_code = http_response.status
1240
+ response_content = http_response.body
1241
+ unless status_code == 202 || status_code == 204
1242
+ error_model = JSON.load(response_content)
1243
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1244
+ end
1245
+
1246
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1247
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1248
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1249
+
1250
+ result
1251
+ end
1252
+
1253
+ promise.execute
1254
+ end
1255
+
1256
+ #
1257
+ # Validates whether resources can be moved from one resource group to another
1258
+ # resource group.
1259
+ #
1260
+ # This operation checks whether the specified resources can be moved to the
1261
+ # target. The resources to move must be in the same source resource group. The
1262
+ # target resource group may be in a different subscription. If validation
1263
+ # succeeds, it returns HTTP response code 204 (no content). If validation
1264
+ # fails, it returns HTTP response code 409 (Conflict) with an error message.
1265
+ # Retrieve the URL in the Location header value to check the result of the
1266
+ # long-running operation.
1267
+ #
1268
+ # @param source_resource_group_name [String] The name of the resource group
1269
+ # containing the resources to validate for move.
1270
+ # @param parameters [ResourcesMoveInfo] Parameters for moving resources.
1271
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1272
+ # will be added to the HTTP request.
1273
+ #
1274
+ #
1275
+ def begin_validate_move_resources(source_resource_group_name, parameters, custom_headers:nil)
1276
+ response = begin_validate_move_resources_async(source_resource_group_name, parameters, custom_headers:custom_headers).value!
1277
+ nil
1278
+ end
1279
+
1280
+ #
1281
+ # Validates whether resources can be moved from one resource group to another
1282
+ # resource group.
1283
+ #
1284
+ # This operation checks whether the specified resources can be moved to the
1285
+ # target. The resources to move must be in the same source resource group. The
1286
+ # target resource group may be in a different subscription. If validation
1287
+ # succeeds, it returns HTTP response code 204 (no content). If validation
1288
+ # fails, it returns HTTP response code 409 (Conflict) with an error message.
1289
+ # Retrieve the URL in the Location header value to check the result of the
1290
+ # long-running operation.
1291
+ #
1292
+ # @param source_resource_group_name [String] The name of the resource group
1293
+ # containing the resources to validate for move.
1294
+ # @param parameters [ResourcesMoveInfo] Parameters for moving resources.
1295
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1296
+ # will be added to the HTTP request.
1297
+ #
1298
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1299
+ #
1300
+ def begin_validate_move_resources_with_http_info(source_resource_group_name, parameters, custom_headers:nil)
1301
+ begin_validate_move_resources_async(source_resource_group_name, parameters, custom_headers:custom_headers).value!
1302
+ end
1303
+
1304
+ #
1305
+ # Validates whether resources can be moved from one resource group to another
1306
+ # resource group.
1307
+ #
1308
+ # This operation checks whether the specified resources can be moved to the
1309
+ # target. The resources to move must be in the same source resource group. The
1310
+ # target resource group may be in a different subscription. If validation
1311
+ # succeeds, it returns HTTP response code 204 (no content). If validation
1312
+ # fails, it returns HTTP response code 409 (Conflict) with an error message.
1313
+ # Retrieve the URL in the Location header value to check the result of the
1314
+ # long-running operation.
1315
+ #
1316
+ # @param source_resource_group_name [String] The name of the resource group
1317
+ # containing the resources to validate for move.
1318
+ # @param parameters [ResourcesMoveInfo] Parameters for moving resources.
1319
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1320
+ # to the HTTP request.
1321
+ #
1322
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1323
+ #
1324
+ def begin_validate_move_resources_async(source_resource_group_name, parameters, custom_headers:nil)
1325
+ fail ArgumentError, 'source_resource_group_name is nil' if source_resource_group_name.nil?
1326
+ fail ArgumentError, "'source_resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !source_resource_group_name.nil? && source_resource_group_name.length > 90
1327
+ fail ArgumentError, "'source_resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !source_resource_group_name.nil? && source_resource_group_name.length < 1
1328
+ fail ArgumentError, "'source_resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !source_resource_group_name.nil? && source_resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1329
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1330
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1331
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1332
+
1333
+
1334
+ request_headers = {}
1335
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1336
+
1337
+ # Set Headers
1338
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1339
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1340
+
1341
+ # Serialize Request
1342
+ request_mapper = Azure::Resources::Mgmt::V2019_03_01::Models::ResourcesMoveInfo.mapper()
1343
+ request_content = @client.serialize(request_mapper, parameters)
1344
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1345
+
1346
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/validateMoveResources'
1347
+
1348
+ request_url = @base_url || @client.base_url
1349
+
1350
+ options = {
1351
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1352
+ path_params: {'sourceResourceGroupName' => source_resource_group_name,'subscriptionId' => @client.subscription_id},
1353
+ query_params: {'api-version' => @client.api_version},
1354
+ body: request_content,
1355
+ headers: request_headers.merge(custom_headers || {}),
1356
+ base_url: request_url
1357
+ }
1358
+ promise = @client.make_request_async(:post, path_template, options)
1359
+
1360
+ promise = promise.then do |result|
1361
+ http_response = result.response
1362
+ status_code = http_response.status
1363
+ response_content = http_response.body
1364
+ unless status_code == 202 || status_code == 204 || status_code == 409
1365
+ error_model = JSON.load(response_content)
1366
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1367
+ end
1368
+
1369
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1370
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1371
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1372
+
1373
+ result
1374
+ end
1375
+
1376
+ promise.execute
1377
+ end
1378
+
1379
+ #
1380
+ # Deletes a resource.
1381
+ #
1382
+ # @param resource_group_name [String] The name of the resource group that
1383
+ # contains the resource to delete. The name is case insensitive.
1384
+ # @param resource_provider_namespace [String] The namespace of the resource
1385
+ # provider.
1386
+ # @param parent_resource_path [String] The parent resource identity.
1387
+ # @param resource_type [String] The resource type.
1388
+ # @param resource_name [String] The name of the resource to delete.
1389
+ # @param api_version [String] The API version to use for the operation.
1390
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1391
+ # will be added to the HTTP request.
1392
+ #
1393
+ #
1394
+ def begin_delete(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers:nil)
1395
+ response = begin_delete_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers:custom_headers).value!
1396
+ nil
1397
+ end
1398
+
1399
+ #
1400
+ # Deletes a resource.
1401
+ #
1402
+ # @param resource_group_name [String] The name of the resource group that
1403
+ # contains the resource to delete. The name is case insensitive.
1404
+ # @param resource_provider_namespace [String] The namespace of the resource
1405
+ # provider.
1406
+ # @param parent_resource_path [String] The parent resource identity.
1407
+ # @param resource_type [String] The resource type.
1408
+ # @param resource_name [String] The name of the resource to delete.
1409
+ # @param api_version [String] The API version to use for the operation.
1410
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1411
+ # will be added to the HTTP request.
1412
+ #
1413
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1414
+ #
1415
+ def begin_delete_with_http_info(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers:nil)
1416
+ begin_delete_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers:custom_headers).value!
1417
+ end
1418
+
1419
+ #
1420
+ # Deletes a resource.
1421
+ #
1422
+ # @param resource_group_name [String] The name of the resource group that
1423
+ # contains the resource to delete. The name is case insensitive.
1424
+ # @param resource_provider_namespace [String] The namespace of the resource
1425
+ # provider.
1426
+ # @param parent_resource_path [String] The parent resource identity.
1427
+ # @param resource_type [String] The resource type.
1428
+ # @param resource_name [String] The name of the resource to delete.
1429
+ # @param api_version [String] The API version to use for the operation.
1430
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1431
+ # to the HTTP request.
1432
+ #
1433
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1434
+ #
1435
+ def begin_delete_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers:nil)
1436
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1437
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1438
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1439
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1440
+ fail ArgumentError, 'resource_provider_namespace is nil' if resource_provider_namespace.nil?
1441
+ fail ArgumentError, 'parent_resource_path is nil' if parent_resource_path.nil?
1442
+ fail ArgumentError, 'resource_type is nil' if resource_type.nil?
1443
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
1444
+ fail ArgumentError, 'api_version is nil' if api_version.nil?
1445
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1446
+
1447
+
1448
+ request_headers = {}
1449
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1450
+
1451
+ # Set Headers
1452
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1453
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1454
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}'
1455
+
1456
+ request_url = @base_url || @client.base_url
1457
+
1458
+ options = {
1459
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1460
+ path_params: {'resourceGroupName' => resource_group_name,'resourceProviderNamespace' => resource_provider_namespace,'resourceName' => resource_name,'subscriptionId' => @client.subscription_id},
1461
+ skip_encoding_path_params: {'parentResourcePath' => parent_resource_path,'resourceType' => resource_type},
1462
+ query_params: {'api-version' => api_version},
1463
+ headers: request_headers.merge(custom_headers || {}),
1464
+ base_url: request_url
1465
+ }
1466
+ promise = @client.make_request_async(:delete, path_template, options)
1467
+
1468
+ promise = promise.then do |result|
1469
+ http_response = result.response
1470
+ status_code = http_response.status
1471
+ response_content = http_response.body
1472
+ unless status_code == 200 || status_code == 204 || status_code == 202
1473
+ error_model = JSON.load(response_content)
1474
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1475
+ end
1476
+
1477
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1478
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1479
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1480
+
1481
+ result
1482
+ end
1483
+
1484
+ promise.execute
1485
+ end
1486
+
1487
+ #
1488
+ # Creates a resource.
1489
+ #
1490
+ # @param resource_group_name [String] The name of the resource group for the
1491
+ # resource. The name is case insensitive.
1492
+ # @param resource_provider_namespace [String] The namespace of the resource
1493
+ # provider.
1494
+ # @param parent_resource_path [String] The parent resource identity.
1495
+ # @param resource_type [String] The resource type of the resource to create.
1496
+ # @param resource_name [String] The name of the resource to create.
1497
+ # @param api_version [String] The API version to use for the operation.
1498
+ # @param parameters [GenericResource] Parameters for creating or updating the
1499
+ # resource.
1500
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1501
+ # will be added to the HTTP request.
1502
+ #
1503
+ # @return [GenericResource] operation results.
1504
+ #
1505
+ def begin_create_or_update(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers:nil)
1506
+ response = begin_create_or_update_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers:custom_headers).value!
1507
+ response.body unless response.nil?
1508
+ end
1509
+
1510
+ #
1511
+ # Creates a resource.
1512
+ #
1513
+ # @param resource_group_name [String] The name of the resource group for the
1514
+ # resource. The name is case insensitive.
1515
+ # @param resource_provider_namespace [String] The namespace of the resource
1516
+ # provider.
1517
+ # @param parent_resource_path [String] The parent resource identity.
1518
+ # @param resource_type [String] The resource type of the resource to create.
1519
+ # @param resource_name [String] The name of the resource to create.
1520
+ # @param api_version [String] The API version to use for the operation.
1521
+ # @param parameters [GenericResource] Parameters for creating or updating the
1522
+ # resource.
1523
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1524
+ # will be added to the HTTP request.
1525
+ #
1526
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1527
+ #
1528
+ def begin_create_or_update_with_http_info(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers:nil)
1529
+ begin_create_or_update_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers:custom_headers).value!
1530
+ end
1531
+
1532
+ #
1533
+ # Creates a resource.
1534
+ #
1535
+ # @param resource_group_name [String] The name of the resource group for the
1536
+ # resource. The name is case insensitive.
1537
+ # @param resource_provider_namespace [String] The namespace of the resource
1538
+ # provider.
1539
+ # @param parent_resource_path [String] The parent resource identity.
1540
+ # @param resource_type [String] The resource type of the resource to create.
1541
+ # @param resource_name [String] The name of the resource to create.
1542
+ # @param api_version [String] The API version to use for the operation.
1543
+ # @param parameters [GenericResource] Parameters for creating or updating the
1544
+ # resource.
1545
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1546
+ # to the HTTP request.
1547
+ #
1548
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1549
+ #
1550
+ def begin_create_or_update_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers:nil)
1551
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1552
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1553
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1554
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1555
+ fail ArgumentError, 'resource_provider_namespace is nil' if resource_provider_namespace.nil?
1556
+ fail ArgumentError, 'parent_resource_path is nil' if parent_resource_path.nil?
1557
+ fail ArgumentError, 'resource_type is nil' if resource_type.nil?
1558
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
1559
+ fail ArgumentError, 'api_version is nil' if api_version.nil?
1560
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1561
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1562
+
1563
+
1564
+ request_headers = {}
1565
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1566
+
1567
+ # Set Headers
1568
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1569
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1570
+
1571
+ # Serialize Request
1572
+ request_mapper = Azure::Resources::Mgmt::V2019_03_01::Models::GenericResource.mapper()
1573
+ request_content = @client.serialize(request_mapper, parameters)
1574
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1575
+
1576
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}'
1577
+
1578
+ request_url = @base_url || @client.base_url
1579
+
1580
+ options = {
1581
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1582
+ path_params: {'resourceGroupName' => resource_group_name,'resourceProviderNamespace' => resource_provider_namespace,'resourceName' => resource_name,'subscriptionId' => @client.subscription_id},
1583
+ skip_encoding_path_params: {'parentResourcePath' => parent_resource_path,'resourceType' => resource_type},
1584
+ query_params: {'api-version' => api_version},
1585
+ body: request_content,
1586
+ headers: request_headers.merge(custom_headers || {}),
1587
+ base_url: request_url
1588
+ }
1589
+ promise = @client.make_request_async(:put, path_template, options)
1590
+
1591
+ promise = promise.then do |result|
1592
+ http_response = result.response
1593
+ status_code = http_response.status
1594
+ response_content = http_response.body
1595
+ unless status_code == 201 || status_code == 200 || status_code == 202
1596
+ error_model = JSON.load(response_content)
1597
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1598
+ end
1599
+
1600
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1601
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1602
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1603
+ # Deserialize Response
1604
+ if status_code == 201
1605
+ begin
1606
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1607
+ result_mapper = Azure::Resources::Mgmt::V2019_03_01::Models::GenericResource.mapper()
1608
+ result.body = @client.deserialize(result_mapper, parsed_response)
1609
+ rescue Exception => e
1610
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1611
+ end
1612
+ end
1613
+ # Deserialize Response
1614
+ if status_code == 200
1615
+ begin
1616
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1617
+ result_mapper = Azure::Resources::Mgmt::V2019_03_01::Models::GenericResource.mapper()
1618
+ result.body = @client.deserialize(result_mapper, parsed_response)
1619
+ rescue Exception => e
1620
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1621
+ end
1622
+ end
1623
+
1624
+ result
1625
+ end
1626
+
1627
+ promise.execute
1628
+ end
1629
+
1630
+ #
1631
+ # Updates a resource.
1632
+ #
1633
+ # @param resource_group_name [String] The name of the resource group for the
1634
+ # resource. The name is case insensitive.
1635
+ # @param resource_provider_namespace [String] The namespace of the resource
1636
+ # provider.
1637
+ # @param parent_resource_path [String] The parent resource identity.
1638
+ # @param resource_type [String] The resource type of the resource to update.
1639
+ # @param resource_name [String] The name of the resource to update.
1640
+ # @param api_version [String] The API version to use for the operation.
1641
+ # @param parameters [GenericResource] Parameters for updating the resource.
1642
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1643
+ # will be added to the HTTP request.
1644
+ #
1645
+ # @return [GenericResource] operation results.
1646
+ #
1647
+ def begin_update(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers:nil)
1648
+ response = begin_update_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers:custom_headers).value!
1649
+ response.body unless response.nil?
1650
+ end
1651
+
1652
+ #
1653
+ # Updates a resource.
1654
+ #
1655
+ # @param resource_group_name [String] The name of the resource group for the
1656
+ # resource. The name is case insensitive.
1657
+ # @param resource_provider_namespace [String] The namespace of the resource
1658
+ # provider.
1659
+ # @param parent_resource_path [String] The parent resource identity.
1660
+ # @param resource_type [String] The resource type of the resource to update.
1661
+ # @param resource_name [String] The name of the resource to update.
1662
+ # @param api_version [String] The API version to use for the operation.
1663
+ # @param parameters [GenericResource] Parameters for updating the resource.
1664
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1665
+ # will be added to the HTTP request.
1666
+ #
1667
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1668
+ #
1669
+ def begin_update_with_http_info(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers:nil)
1670
+ begin_update_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers:custom_headers).value!
1671
+ end
1672
+
1673
+ #
1674
+ # Updates a resource.
1675
+ #
1676
+ # @param resource_group_name [String] The name of the resource group for the
1677
+ # resource. The name is case insensitive.
1678
+ # @param resource_provider_namespace [String] The namespace of the resource
1679
+ # provider.
1680
+ # @param parent_resource_path [String] The parent resource identity.
1681
+ # @param resource_type [String] The resource type of the resource to update.
1682
+ # @param resource_name [String] The name of the resource to update.
1683
+ # @param api_version [String] The API version to use for the operation.
1684
+ # @param parameters [GenericResource] Parameters for updating the resource.
1685
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1686
+ # to the HTTP request.
1687
+ #
1688
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1689
+ #
1690
+ def begin_update_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers:nil)
1691
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1692
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1693
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1694
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1695
+ fail ArgumentError, 'resource_provider_namespace is nil' if resource_provider_namespace.nil?
1696
+ fail ArgumentError, 'parent_resource_path is nil' if parent_resource_path.nil?
1697
+ fail ArgumentError, 'resource_type is nil' if resource_type.nil?
1698
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
1699
+ fail ArgumentError, 'api_version is nil' if api_version.nil?
1700
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1701
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1702
+
1703
+
1704
+ request_headers = {}
1705
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1706
+
1707
+ # Set Headers
1708
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1709
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1710
+
1711
+ # Serialize Request
1712
+ request_mapper = Azure::Resources::Mgmt::V2019_03_01::Models::GenericResource.mapper()
1713
+ request_content = @client.serialize(request_mapper, parameters)
1714
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1715
+
1716
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}'
1717
+
1718
+ request_url = @base_url || @client.base_url
1719
+
1720
+ options = {
1721
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1722
+ path_params: {'resourceGroupName' => resource_group_name,'resourceProviderNamespace' => resource_provider_namespace,'resourceName' => resource_name,'subscriptionId' => @client.subscription_id},
1723
+ skip_encoding_path_params: {'parentResourcePath' => parent_resource_path,'resourceType' => resource_type},
1724
+ query_params: {'api-version' => api_version},
1725
+ body: request_content,
1726
+ headers: request_headers.merge(custom_headers || {}),
1727
+ base_url: request_url
1728
+ }
1729
+ promise = @client.make_request_async(:patch, path_template, options)
1730
+
1731
+ promise = promise.then do |result|
1732
+ http_response = result.response
1733
+ status_code = http_response.status
1734
+ response_content = http_response.body
1735
+ unless status_code == 200 || status_code == 202
1736
+ error_model = JSON.load(response_content)
1737
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1738
+ end
1739
+
1740
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1741
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1742
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1743
+ # Deserialize Response
1744
+ if status_code == 200
1745
+ begin
1746
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1747
+ result_mapper = Azure::Resources::Mgmt::V2019_03_01::Models::GenericResource.mapper()
1748
+ result.body = @client.deserialize(result_mapper, parsed_response)
1749
+ rescue Exception => e
1750
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1751
+ end
1752
+ end
1753
+
1754
+ result
1755
+ end
1756
+
1757
+ promise.execute
1758
+ end
1759
+
1760
+ #
1761
+ # Deletes a resource by ID.
1762
+ #
1763
+ # @param resource_id [String] The fully qualified ID of the resource, including
1764
+ # the resource name and resource type. Use the format,
1765
+ # /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
1766
+ # @param api_version [String] The API version to use for the operation.
1767
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1768
+ # will be added to the HTTP request.
1769
+ #
1770
+ #
1771
+ def begin_delete_by_id(resource_id, api_version, custom_headers:nil)
1772
+ response = begin_delete_by_id_async(resource_id, api_version, custom_headers:custom_headers).value!
1773
+ nil
1774
+ end
1775
+
1776
+ #
1777
+ # Deletes a resource by ID.
1778
+ #
1779
+ # @param resource_id [String] The fully qualified ID of the resource, including
1780
+ # the resource name and resource type. Use the format,
1781
+ # /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
1782
+ # @param api_version [String] The API version to use for the operation.
1783
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1784
+ # will be added to the HTTP request.
1785
+ #
1786
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1787
+ #
1788
+ def begin_delete_by_id_with_http_info(resource_id, api_version, custom_headers:nil)
1789
+ begin_delete_by_id_async(resource_id, api_version, custom_headers:custom_headers).value!
1790
+ end
1791
+
1792
+ #
1793
+ # Deletes a resource by ID.
1794
+ #
1795
+ # @param resource_id [String] The fully qualified ID of the resource, including
1796
+ # the resource name and resource type. Use the format,
1797
+ # /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
1798
+ # @param api_version [String] The API version to use for the operation.
1799
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1800
+ # to the HTTP request.
1801
+ #
1802
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1803
+ #
1804
+ def begin_delete_by_id_async(resource_id, api_version, custom_headers:nil)
1805
+ fail ArgumentError, 'resource_id is nil' if resource_id.nil?
1806
+ fail ArgumentError, 'api_version is nil' if api_version.nil?
1807
+
1808
+
1809
+ request_headers = {}
1810
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1811
+
1812
+ # Set Headers
1813
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1814
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1815
+ path_template = '{resourceId}'
1816
+
1817
+ request_url = @base_url || @client.base_url
1818
+
1819
+ options = {
1820
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1821
+ skip_encoding_path_params: {'resourceId' => resource_id},
1822
+ query_params: {'api-version' => api_version},
1823
+ headers: request_headers.merge(custom_headers || {}),
1824
+ base_url: request_url
1825
+ }
1826
+ promise = @client.make_request_async(:delete, path_template, options)
1827
+
1828
+ promise = promise.then do |result|
1829
+ http_response = result.response
1830
+ status_code = http_response.status
1831
+ response_content = http_response.body
1832
+ unless status_code == 200 || status_code == 204 || status_code == 202
1833
+ error_model = JSON.load(response_content)
1834
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1835
+ end
1836
+
1837
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1838
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1839
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1840
+
1841
+ result
1842
+ end
1843
+
1844
+ promise.execute
1845
+ end
1846
+
1847
+ #
1848
+ # Create a resource by ID.
1849
+ #
1850
+ # @param resource_id [String] The fully qualified ID of the resource, including
1851
+ # the resource name and resource type. Use the format,
1852
+ # /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
1853
+ # @param api_version [String] The API version to use for the operation.
1854
+ # @param parameters [GenericResource] Create or update resource parameters.
1855
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1856
+ # will be added to the HTTP request.
1857
+ #
1858
+ # @return [GenericResource] operation results.
1859
+ #
1860
+ def begin_create_or_update_by_id(resource_id, api_version, parameters, custom_headers:nil)
1861
+ response = begin_create_or_update_by_id_async(resource_id, api_version, parameters, custom_headers:custom_headers).value!
1862
+ response.body unless response.nil?
1863
+ end
1864
+
1865
+ #
1866
+ # Create a resource by ID.
1867
+ #
1868
+ # @param resource_id [String] The fully qualified ID of the resource, including
1869
+ # the resource name and resource type. Use the format,
1870
+ # /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
1871
+ # @param api_version [String] The API version to use for the operation.
1872
+ # @param parameters [GenericResource] Create or update resource parameters.
1873
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1874
+ # will be added to the HTTP request.
1875
+ #
1876
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1877
+ #
1878
+ def begin_create_or_update_by_id_with_http_info(resource_id, api_version, parameters, custom_headers:nil)
1879
+ begin_create_or_update_by_id_async(resource_id, api_version, parameters, custom_headers:custom_headers).value!
1880
+ end
1881
+
1882
+ #
1883
+ # Create a resource by ID.
1884
+ #
1885
+ # @param resource_id [String] The fully qualified ID of the resource, including
1886
+ # the resource name and resource type. Use the format,
1887
+ # /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
1888
+ # @param api_version [String] The API version to use for the operation.
1889
+ # @param parameters [GenericResource] Create or update resource parameters.
1890
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1891
+ # to the HTTP request.
1892
+ #
1893
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1894
+ #
1895
+ def begin_create_or_update_by_id_async(resource_id, api_version, parameters, custom_headers:nil)
1896
+ fail ArgumentError, 'resource_id is nil' if resource_id.nil?
1897
+ fail ArgumentError, 'api_version is nil' if api_version.nil?
1898
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1899
+
1900
+
1901
+ request_headers = {}
1902
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1903
+
1904
+ # Set Headers
1905
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1906
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1907
+
1908
+ # Serialize Request
1909
+ request_mapper = Azure::Resources::Mgmt::V2019_03_01::Models::GenericResource.mapper()
1910
+ request_content = @client.serialize(request_mapper, parameters)
1911
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1912
+
1913
+ path_template = '{resourceId}'
1914
+
1915
+ request_url = @base_url || @client.base_url
1916
+
1917
+ options = {
1918
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1919
+ skip_encoding_path_params: {'resourceId' => resource_id},
1920
+ query_params: {'api-version' => api_version},
1921
+ body: request_content,
1922
+ headers: request_headers.merge(custom_headers || {}),
1923
+ base_url: request_url
1924
+ }
1925
+ promise = @client.make_request_async(:put, path_template, options)
1926
+
1927
+ promise = promise.then do |result|
1928
+ http_response = result.response
1929
+ status_code = http_response.status
1930
+ response_content = http_response.body
1931
+ unless status_code == 201 || status_code == 200 || status_code == 202
1932
+ error_model = JSON.load(response_content)
1933
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1934
+ end
1935
+
1936
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1937
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1938
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1939
+ # Deserialize Response
1940
+ if status_code == 201
1941
+ begin
1942
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1943
+ result_mapper = Azure::Resources::Mgmt::V2019_03_01::Models::GenericResource.mapper()
1944
+ result.body = @client.deserialize(result_mapper, parsed_response)
1945
+ rescue Exception => e
1946
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1947
+ end
1948
+ end
1949
+ # Deserialize Response
1950
+ if status_code == 200
1951
+ begin
1952
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1953
+ result_mapper = Azure::Resources::Mgmt::V2019_03_01::Models::GenericResource.mapper()
1954
+ result.body = @client.deserialize(result_mapper, parsed_response)
1955
+ rescue Exception => e
1956
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1957
+ end
1958
+ end
1959
+
1960
+ result
1961
+ end
1962
+
1963
+ promise.execute
1964
+ end
1965
+
1966
+ #
1967
+ # Updates a resource by ID.
1968
+ #
1969
+ # @param resource_id [String] The fully qualified ID of the resource, including
1970
+ # the resource name and resource type. Use the format,
1971
+ # /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
1972
+ # @param api_version [String] The API version to use for the operation.
1973
+ # @param parameters [GenericResource] Update resource parameters.
1974
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1975
+ # will be added to the HTTP request.
1976
+ #
1977
+ # @return [GenericResource] operation results.
1978
+ #
1979
+ def begin_update_by_id(resource_id, api_version, parameters, custom_headers:nil)
1980
+ response = begin_update_by_id_async(resource_id, api_version, parameters, custom_headers:custom_headers).value!
1981
+ response.body unless response.nil?
1982
+ end
1983
+
1984
+ #
1985
+ # Updates a resource by ID.
1986
+ #
1987
+ # @param resource_id [String] The fully qualified ID of the resource, including
1988
+ # the resource name and resource type. Use the format,
1989
+ # /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
1990
+ # @param api_version [String] The API version to use for the operation.
1991
+ # @param parameters [GenericResource] Update resource parameters.
1992
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1993
+ # will be added to the HTTP request.
1994
+ #
1995
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1996
+ #
1997
+ def begin_update_by_id_with_http_info(resource_id, api_version, parameters, custom_headers:nil)
1998
+ begin_update_by_id_async(resource_id, api_version, parameters, custom_headers:custom_headers).value!
1999
+ end
2000
+
2001
+ #
2002
+ # Updates a resource by ID.
2003
+ #
2004
+ # @param resource_id [String] The fully qualified ID of the resource, including
2005
+ # the resource name and resource type. Use the format,
2006
+ # /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
2007
+ # @param api_version [String] The API version to use for the operation.
2008
+ # @param parameters [GenericResource] Update resource parameters.
2009
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2010
+ # to the HTTP request.
2011
+ #
2012
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2013
+ #
2014
+ def begin_update_by_id_async(resource_id, api_version, parameters, custom_headers:nil)
2015
+ fail ArgumentError, 'resource_id is nil' if resource_id.nil?
2016
+ fail ArgumentError, 'api_version is nil' if api_version.nil?
2017
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
2018
+
2019
+
2020
+ request_headers = {}
2021
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2022
+
2023
+ # Set Headers
2024
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2025
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2026
+
2027
+ # Serialize Request
2028
+ request_mapper = Azure::Resources::Mgmt::V2019_03_01::Models::GenericResource.mapper()
2029
+ request_content = @client.serialize(request_mapper, parameters)
2030
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
2031
+
2032
+ path_template = '{resourceId}'
2033
+
2034
+ request_url = @base_url || @client.base_url
2035
+
2036
+ options = {
2037
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2038
+ skip_encoding_path_params: {'resourceId' => resource_id},
2039
+ query_params: {'api-version' => api_version},
2040
+ body: request_content,
2041
+ headers: request_headers.merge(custom_headers || {}),
2042
+ base_url: request_url
2043
+ }
2044
+ promise = @client.make_request_async(:patch, path_template, options)
2045
+
2046
+ promise = promise.then do |result|
2047
+ http_response = result.response
2048
+ status_code = http_response.status
2049
+ response_content = http_response.body
2050
+ unless status_code == 200 || status_code == 202
2051
+ error_model = JSON.load(response_content)
2052
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2053
+ end
2054
+
2055
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2056
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2057
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2058
+ # Deserialize Response
2059
+ if status_code == 200
2060
+ begin
2061
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2062
+ result_mapper = Azure::Resources::Mgmt::V2019_03_01::Models::GenericResource.mapper()
2063
+ result.body = @client.deserialize(result_mapper, parsed_response)
2064
+ rescue Exception => e
2065
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2066
+ end
2067
+ end
2068
+
2069
+ result
2070
+ end
2071
+
2072
+ promise.execute
2073
+ end
2074
+
2075
+ #
2076
+ # Get all the resources for a resource group.
2077
+ #
2078
+ # @param next_page_link [String] The NextLink from the previous successful call
2079
+ # to List operation.
2080
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2081
+ # will be added to the HTTP request.
2082
+ #
2083
+ # @return [ResourceListResult] operation results.
2084
+ #
2085
+ def list_by_resource_group_next(next_page_link, custom_headers:nil)
2086
+ response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
2087
+ response.body unless response.nil?
2088
+ end
2089
+
2090
+ #
2091
+ # Get all the resources for a resource group.
2092
+ #
2093
+ # @param next_page_link [String] The NextLink from the previous successful call
2094
+ # to List operation.
2095
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2096
+ # will be added to the HTTP request.
2097
+ #
2098
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2099
+ #
2100
+ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
2101
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
2102
+ end
2103
+
2104
+ #
2105
+ # Get all the resources for a resource group.
2106
+ #
2107
+ # @param next_page_link [String] The NextLink from the previous successful call
2108
+ # to List operation.
2109
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2110
+ # to the HTTP request.
2111
+ #
2112
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2113
+ #
2114
+ def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
2115
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2116
+
2117
+
2118
+ request_headers = {}
2119
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2120
+
2121
+ # Set Headers
2122
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2123
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2124
+ path_template = '{nextLink}'
2125
+
2126
+ request_url = @base_url || @client.base_url
2127
+
2128
+ options = {
2129
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2130
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2131
+ headers: request_headers.merge(custom_headers || {}),
2132
+ base_url: request_url
2133
+ }
2134
+ promise = @client.make_request_async(:get, path_template, options)
2135
+
2136
+ promise = promise.then do |result|
2137
+ http_response = result.response
2138
+ status_code = http_response.status
2139
+ response_content = http_response.body
2140
+ unless status_code == 200
2141
+ error_model = JSON.load(response_content)
2142
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2143
+ end
2144
+
2145
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2146
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2147
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2148
+ # Deserialize Response
2149
+ if status_code == 200
2150
+ begin
2151
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2152
+ result_mapper = Azure::Resources::Mgmt::V2019_03_01::Models::ResourceListResult.mapper()
2153
+ result.body = @client.deserialize(result_mapper, parsed_response)
2154
+ rescue Exception => e
2155
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2156
+ end
2157
+ end
2158
+
2159
+ result
2160
+ end
2161
+
2162
+ promise.execute
2163
+ end
2164
+
2165
+ #
2166
+ # Get all the resources in a subscription.
2167
+ #
2168
+ # @param next_page_link [String] The NextLink from the previous successful call
2169
+ # to List operation.
2170
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2171
+ # will be added to the HTTP request.
2172
+ #
2173
+ # @return [ResourceListResult] operation results.
2174
+ #
2175
+ def list_next(next_page_link, custom_headers:nil)
2176
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
2177
+ response.body unless response.nil?
2178
+ end
2179
+
2180
+ #
2181
+ # Get all the resources in a subscription.
2182
+ #
2183
+ # @param next_page_link [String] The NextLink from the previous successful call
2184
+ # to List operation.
2185
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2186
+ # will be added to the HTTP request.
2187
+ #
2188
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2189
+ #
2190
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
2191
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
2192
+ end
2193
+
2194
+ #
2195
+ # Get all the resources in a subscription.
2196
+ #
2197
+ # @param next_page_link [String] The NextLink from the previous successful call
2198
+ # to List operation.
2199
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2200
+ # to the HTTP request.
2201
+ #
2202
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2203
+ #
2204
+ def list_next_async(next_page_link, custom_headers:nil)
2205
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
2206
+
2207
+
2208
+ request_headers = {}
2209
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2210
+
2211
+ # Set Headers
2212
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2213
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2214
+ path_template = '{nextLink}'
2215
+
2216
+ request_url = @base_url || @client.base_url
2217
+
2218
+ options = {
2219
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2220
+ skip_encoding_path_params: {'nextLink' => next_page_link},
2221
+ headers: request_headers.merge(custom_headers || {}),
2222
+ base_url: request_url
2223
+ }
2224
+ promise = @client.make_request_async(:get, path_template, options)
2225
+
2226
+ promise = promise.then do |result|
2227
+ http_response = result.response
2228
+ status_code = http_response.status
2229
+ response_content = http_response.body
2230
+ unless status_code == 200
2231
+ error_model = JSON.load(response_content)
2232
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2233
+ end
2234
+
2235
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2236
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2237
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2238
+ # Deserialize Response
2239
+ if status_code == 200
2240
+ begin
2241
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2242
+ result_mapper = Azure::Resources::Mgmt::V2019_03_01::Models::ResourceListResult.mapper()
2243
+ result.body = @client.deserialize(result_mapper, parsed_response)
2244
+ rescue Exception => e
2245
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2246
+ end
2247
+ end
2248
+
2249
+ result
2250
+ end
2251
+
2252
+ promise.execute
2253
+ end
2254
+
2255
+ #
2256
+ # Get all the resources for a resource group.
2257
+ #
2258
+ # @param resource_group_name [String] The resource group with the resources to
2259
+ # get.
2260
+ # @param filter [String] The filter to apply on the operation.<br><br>The
2261
+ # properties you can use for eq (equals) or ne (not equals) are: location,
2262
+ # resourceType, name, resourceGroup, identity, identity/principalId, plan,
2263
+ # plan/publisher, plan/product, plan/name, plan/version, and
2264
+ # plan/promotionCode.<br><br>For example, to filter by a resource type, use:
2265
+ # $filter=resourceType eq 'Microsoft.Network/virtualNetworks'<br><br>You can
2266
+ # use substringof(value, property) in the filter. The properties you can use
2267
+ # for substring are: name and resourceGroup.<br><br>For example, to get all
2268
+ # resources with 'demo' anywhere in the name, use: $filter=substringof('demo',
2269
+ # name)<br><br>You can link more than one substringof together by adding and/or
2270
+ # operators.<br><br>You can filter by tag names and values. For example, to
2271
+ # filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue
2272
+ # eq 'Value1'<br><br>You can use some properties together when filtering. The
2273
+ # combinations you can use are: substringof and/or resourceType, plan and
2274
+ # plan/publisher and plan/name, identity and identity/principalId.
2275
+ # @param expand [String] The $expand query parameter. You can expand
2276
+ # createdTime and changedTime. For example, to expand both properties, use
2277
+ # $expand=changedTime,createdTime
2278
+ # @param top [Integer] The number of results to return. If null is passed,
2279
+ # returns all resources.
2280
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2281
+ # will be added to the HTTP request.
2282
+ #
2283
+ # @return [ResourceListResult] which provide lazy access to pages of the
2284
+ # response.
2285
+ #
2286
+ def list_by_resource_group_as_lazy(resource_group_name, filter:nil, expand:nil, top:nil, custom_headers:nil)
2287
+ response = list_by_resource_group_async(resource_group_name, filter:filter, expand:expand, top:top, custom_headers:custom_headers).value!
2288
+ unless response.nil?
2289
+ page = response.body
2290
+ page.next_method = Proc.new do |next_page_link|
2291
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
2292
+ end
2293
+ page
2294
+ end
2295
+ end
2296
+
2297
+ #
2298
+ # Get all the resources in a subscription.
2299
+ #
2300
+ # @param filter [String] The filter to apply on the operation.<br><br>The
2301
+ # properties you can use for eq (equals) or ne (not equals) are: location,
2302
+ # resourceType, name, resourceGroup, identity, identity/principalId, plan,
2303
+ # plan/publisher, plan/product, plan/name, plan/version, and
2304
+ # plan/promotionCode.<br><br>For example, to filter by a resource type, use:
2305
+ # $filter=resourceType eq 'Microsoft.Network/virtualNetworks'<br><br>You can
2306
+ # use substringof(value, property) in the filter. The properties you can use
2307
+ # for substring are: name and resourceGroup.<br><br>For example, to get all
2308
+ # resources with 'demo' anywhere in the name, use: $filter=substringof('demo',
2309
+ # name)<br><br>You can link more than one substringof together by adding and/or
2310
+ # operators.<br><br>You can filter by tag names and values. For example, to
2311
+ # filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue
2312
+ # eq 'Value1'<br><br>You can use some properties together when filtering. The
2313
+ # combinations you can use are: substringof and/or resourceType, plan and
2314
+ # plan/publisher and plan/name, identity and identity/principalId.
2315
+ # @param expand [String] The $expand query parameter. You can expand
2316
+ # createdTime and changedTime. For example, to expand both properties, use
2317
+ # $expand=changedTime,createdTime
2318
+ # @param top [Integer] The number of results to return. If null is passed,
2319
+ # returns all resource groups.
2320
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2321
+ # will be added to the HTTP request.
2322
+ #
2323
+ # @return [ResourceListResult] which provide lazy access to pages of the
2324
+ # response.
2325
+ #
2326
+ def list_as_lazy(filter:nil, expand:nil, top:nil, custom_headers:nil)
2327
+ response = list_async(filter:filter, expand:expand, top:top, custom_headers:custom_headers).value!
2328
+ unless response.nil?
2329
+ page = response.body
2330
+ page.next_method = Proc.new do |next_page_link|
2331
+ list_next_async(next_page_link, custom_headers:custom_headers)
2332
+ end
2333
+ page
2334
+ end
2335
+ end
2336
+
2337
+ end
2338
+ end