azure_mgmt_key_vault2 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (224) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2015-06-01/generated/azure_mgmt_key_vault2/key_vault_management_client.rb +133 -0
  4. data/lib/2015-06-01/generated/azure_mgmt_key_vault2/models/access_policy_entry.rb +86 -0
  5. data/lib/2015-06-01/generated/azure_mgmt_key_vault2/models/certificate_permissions.rb +29 -0
  6. data/lib/2015-06-01/generated/azure_mgmt_key_vault2/models/key_permissions.rb +31 -0
  7. data/lib/2015-06-01/generated/azure_mgmt_key_vault2/models/permissions.rb +92 -0
  8. data/lib/2015-06-01/generated/azure_mgmt_key_vault2/models/resource.rb +112 -0
  9. data/lib/2015-06-01/generated/azure_mgmt_key_vault2/models/resource_list_result.rb +98 -0
  10. data/lib/2015-06-01/generated/azure_mgmt_key_vault2/models/secret_permissions.rb +23 -0
  11. data/lib/2015-06-01/generated/azure_mgmt_key_vault2/models/sku.rb +62 -0
  12. data/lib/2015-06-01/generated/azure_mgmt_key_vault2/models/sku_name.rb +16 -0
  13. data/lib/2015-06-01/generated/azure_mgmt_key_vault2/models/vault.rb +98 -0
  14. data/lib/2015-06-01/generated/azure_mgmt_key_vault2/models/vault_create_or_update_parameters.rb +80 -0
  15. data/lib/2015-06-01/generated/azure_mgmt_key_vault2/models/vault_list_result.rb +98 -0
  16. data/lib/2015-06-01/generated/azure_mgmt_key_vault2/models/vault_properties.rb +146 -0
  17. data/lib/2015-06-01/generated/azure_mgmt_key_vault2/module_definition.rb +9 -0
  18. data/lib/2015-06-01/generated/azure_mgmt_key_vault2/vaults.rb +754 -0
  19. data/lib/2015-06-01/generated/azure_mgmt_key_vault2.rb +41 -0
  20. data/lib/2016-10-01/generated/azure_mgmt_key_vault2/key_vault_management_client.rb +137 -0
  21. data/lib/2016-10-01/generated/azure_mgmt_key_vault2/models/access_policy_entry.rb +86 -0
  22. data/lib/2016-10-01/generated/azure_mgmt_key_vault2/models/access_policy_update_kind.rb +17 -0
  23. data/lib/2016-10-01/generated/azure_mgmt_key_vault2/models/certificate_permissions.rb +28 -0
  24. data/lib/2016-10-01/generated/azure_mgmt_key_vault2/models/check_name_availability_result.rb +77 -0
  25. data/lib/2016-10-01/generated/azure_mgmt_key_vault2/models/create_mode.rb +16 -0
  26. data/lib/2016-10-01/generated/azure_mgmt_key_vault2/models/deleted_vault.rb +83 -0
  27. data/lib/2016-10-01/generated/azure_mgmt_key_vault2/models/deleted_vault_list_result.rb +98 -0
  28. data/lib/2016-10-01/generated/azure_mgmt_key_vault2/models/deleted_vault_properties.rb +103 -0
  29. data/lib/2016-10-01/generated/azure_mgmt_key_vault2/models/key_permissions.rb +30 -0
  30. data/lib/2016-10-01/generated/azure_mgmt_key_vault2/models/log_specification.rb +68 -0
  31. data/lib/2016-10-01/generated/azure_mgmt_key_vault2/models/operation.rb +83 -0
  32. data/lib/2016-10-01/generated/azure_mgmt_key_vault2/models/operation_display.rb +79 -0
  33. data/lib/2016-10-01/generated/azure_mgmt_key_vault2/models/operation_list_result.rb +100 -0
  34. data/lib/2016-10-01/generated/azure_mgmt_key_vault2/models/permissions.rb +111 -0
  35. data/lib/2016-10-01/generated/azure_mgmt_key_vault2/models/reason.rb +16 -0
  36. data/lib/2016-10-01/generated/azure_mgmt_key_vault2/models/resource.rb +113 -0
  37. data/lib/2016-10-01/generated/azure_mgmt_key_vault2/models/resource_list_result.rb +98 -0
  38. data/lib/2016-10-01/generated/azure_mgmt_key_vault2/models/secret_permissions.rb +22 -0
  39. data/lib/2016-10-01/generated/azure_mgmt_key_vault2/models/service_specification.rb +55 -0
  40. data/lib/2016-10-01/generated/azure_mgmt_key_vault2/models/sku.rb +62 -0
  41. data/lib/2016-10-01/generated/azure_mgmt_key_vault2/models/sku_name.rb +16 -0
  42. data/lib/2016-10-01/generated/azure_mgmt_key_vault2/models/storage_permissions.rb +28 -0
  43. data/lib/2016-10-01/generated/azure_mgmt_key_vault2/models/vault.rb +99 -0
  44. data/lib/2016-10-01/generated/azure_mgmt_key_vault2/models/vault_access_policy_parameters.rb +95 -0
  45. data/lib/2016-10-01/generated/azure_mgmt_key_vault2/models/vault_access_policy_properties.rb +57 -0
  46. data/lib/2016-10-01/generated/azure_mgmt_key_vault2/models/vault_check_name_availability_parameters.rb +60 -0
  47. data/lib/2016-10-01/generated/azure_mgmt_key_vault2/models/vault_create_or_update_parameters.rb +80 -0
  48. data/lib/2016-10-01/generated/azure_mgmt_key_vault2/models/vault_list_result.rb +98 -0
  49. data/lib/2016-10-01/generated/azure_mgmt_key_vault2/models/vault_patch_parameters.rb +67 -0
  50. data/lib/2016-10-01/generated/azure_mgmt_key_vault2/models/vault_patch_properties.rb +158 -0
  51. data/lib/2016-10-01/generated/azure_mgmt_key_vault2/models/vault_properties.rb +177 -0
  52. data/lib/2016-10-01/generated/azure_mgmt_key_vault2/module_definition.rb +9 -0
  53. data/lib/2016-10-01/generated/azure_mgmt_key_vault2/operations.rb +220 -0
  54. data/lib/2016-10-01/generated/azure_mgmt_key_vault2/vaults.rb +1723 -0
  55. data/lib/2016-10-01/generated/azure_mgmt_key_vault2.rb +60 -0
  56. data/lib/2018-02-14/generated/azure_mgmt_key_vault2/key_vault_management_client.rb +137 -0
  57. data/lib/2018-02-14/generated/azure_mgmt_key_vault2/models/access_policy_entry.rb +86 -0
  58. data/lib/2018-02-14/generated/azure_mgmt_key_vault2/models/access_policy_update_kind.rb +17 -0
  59. data/lib/2018-02-14/generated/azure_mgmt_key_vault2/models/certificate_permissions.rb +30 -0
  60. data/lib/2018-02-14/generated/azure_mgmt_key_vault2/models/check_name_availability_result.rb +77 -0
  61. data/lib/2018-02-14/generated/azure_mgmt_key_vault2/models/create_mode.rb +16 -0
  62. data/lib/2018-02-14/generated/azure_mgmt_key_vault2/models/deleted_vault.rb +83 -0
  63. data/lib/2018-02-14/generated/azure_mgmt_key_vault2/models/deleted_vault_list_result.rb +98 -0
  64. data/lib/2018-02-14/generated/azure_mgmt_key_vault2/models/deleted_vault_properties.rb +103 -0
  65. data/lib/2018-02-14/generated/azure_mgmt_key_vault2/models/iprule.rb +49 -0
  66. data/lib/2018-02-14/generated/azure_mgmt_key_vault2/models/key_permissions.rb +30 -0
  67. data/lib/2018-02-14/generated/azure_mgmt_key_vault2/models/log_specification.rb +68 -0
  68. data/lib/2018-02-14/generated/azure_mgmt_key_vault2/models/network_rule_action.rb +16 -0
  69. data/lib/2018-02-14/generated/azure_mgmt_key_vault2/models/network_rule_bypass_options.rb +16 -0
  70. data/lib/2018-02-14/generated/azure_mgmt_key_vault2/models/network_rule_set.rb +103 -0
  71. data/lib/2018-02-14/generated/azure_mgmt_key_vault2/models/operation.rb +83 -0
  72. data/lib/2018-02-14/generated/azure_mgmt_key_vault2/models/operation_display.rb +79 -0
  73. data/lib/2018-02-14/generated/azure_mgmt_key_vault2/models/operation_list_result.rb +100 -0
  74. data/lib/2018-02-14/generated/azure_mgmt_key_vault2/models/permissions.rb +111 -0
  75. data/lib/2018-02-14/generated/azure_mgmt_key_vault2/models/reason.rb +16 -0
  76. data/lib/2018-02-14/generated/azure_mgmt_key_vault2/models/resource.rb +113 -0
  77. data/lib/2018-02-14/generated/azure_mgmt_key_vault2/models/resource_list_result.rb +98 -0
  78. data/lib/2018-02-14/generated/azure_mgmt_key_vault2/models/secret_permissions.rb +22 -0
  79. data/lib/2018-02-14/generated/azure_mgmt_key_vault2/models/service_specification.rb +55 -0
  80. data/lib/2018-02-14/generated/azure_mgmt_key_vault2/models/sku.rb +62 -0
  81. data/lib/2018-02-14/generated/azure_mgmt_key_vault2/models/sku_name.rb +16 -0
  82. data/lib/2018-02-14/generated/azure_mgmt_key_vault2/models/storage_permissions.rb +28 -0
  83. data/lib/2018-02-14/generated/azure_mgmt_key_vault2/models/vault.rb +99 -0
  84. data/lib/2018-02-14/generated/azure_mgmt_key_vault2/models/vault_access_policy_parameters.rb +95 -0
  85. data/lib/2018-02-14/generated/azure_mgmt_key_vault2/models/vault_access_policy_properties.rb +57 -0
  86. data/lib/2018-02-14/generated/azure_mgmt_key_vault2/models/vault_check_name_availability_parameters.rb +60 -0
  87. data/lib/2018-02-14/generated/azure_mgmt_key_vault2/models/vault_create_or_update_parameters.rb +80 -0
  88. data/lib/2018-02-14/generated/azure_mgmt_key_vault2/models/vault_list_result.rb +98 -0
  89. data/lib/2018-02-14/generated/azure_mgmt_key_vault2/models/vault_patch_parameters.rb +67 -0
  90. data/lib/2018-02-14/generated/azure_mgmt_key_vault2/models/vault_patch_properties.rb +175 -0
  91. data/lib/2018-02-14/generated/azure_mgmt_key_vault2/models/vault_properties.rb +188 -0
  92. data/lib/2018-02-14/generated/azure_mgmt_key_vault2/models/virtual_network_rule.rb +48 -0
  93. data/lib/2018-02-14/generated/azure_mgmt_key_vault2/module_definition.rb +9 -0
  94. data/lib/2018-02-14/generated/azure_mgmt_key_vault2/operations.rb +220 -0
  95. data/lib/2018-02-14/generated/azure_mgmt_key_vault2/vaults.rb +1771 -0
  96. data/lib/2018-02-14/generated/azure_mgmt_key_vault2.rb +65 -0
  97. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2/key_vault_management_client.rb +141 -0
  98. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2/models/access_policy_entry.rb +86 -0
  99. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2/models/access_policy_update_kind.rb +17 -0
  100. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2/models/attributes.rb +92 -0
  101. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2/models/certificate_permissions.rb +30 -0
  102. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2/models/check_name_availability_result.rb +77 -0
  103. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2/models/create_mode.rb +16 -0
  104. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2/models/deleted_vault.rb +83 -0
  105. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2/models/deleted_vault_list_result.rb +98 -0
  106. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2/models/deleted_vault_properties.rb +103 -0
  107. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2/models/iprule.rb +49 -0
  108. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2/models/key_permissions.rb +30 -0
  109. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2/models/log_specification.rb +68 -0
  110. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2/models/network_rule_action.rb +16 -0
  111. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2/models/network_rule_bypass_options.rb +16 -0
  112. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2/models/network_rule_set.rb +103 -0
  113. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2/models/operation.rb +83 -0
  114. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2/models/operation_display.rb +79 -0
  115. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2/models/operation_list_result.rb +100 -0
  116. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2/models/permissions.rb +111 -0
  117. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2/models/reason.rb +16 -0
  118. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2/models/resource.rb +113 -0
  119. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2/models/resource_list_result.rb +98 -0
  120. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2/models/secret.rb +98 -0
  121. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2/models/secret_attributes.rb +77 -0
  122. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2/models/secret_create_or_update_parameters.rb +67 -0
  123. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2/models/secret_list_result.rb +98 -0
  124. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2/models/secret_patch_parameters.rb +67 -0
  125. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2/models/secret_patch_properties.rb +69 -0
  126. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2/models/secret_permissions.rb +22 -0
  127. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2/models/secret_properties.rb +97 -0
  128. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2/models/service_specification.rb +55 -0
  129. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2/models/sku.rb +62 -0
  130. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2/models/sku_name.rb +16 -0
  131. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2/models/storage_permissions.rb +28 -0
  132. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2/models/vault.rb +99 -0
  133. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2/models/vault_access_policy_parameters.rb +95 -0
  134. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2/models/vault_access_policy_properties.rb +57 -0
  135. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2/models/vault_check_name_availability_parameters.rb +60 -0
  136. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2/models/vault_create_or_update_parameters.rb +80 -0
  137. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2/models/vault_list_result.rb +98 -0
  138. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2/models/vault_patch_parameters.rb +67 -0
  139. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2/models/vault_patch_properties.rb +175 -0
  140. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2/models/vault_properties.rb +188 -0
  141. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2/models/virtual_network_rule.rb +48 -0
  142. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2/module_definition.rb +9 -0
  143. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2/operations.rb +220 -0
  144. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2/secrets.rb +624 -0
  145. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2/vaults.rb +1771 -0
  146. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault2.rb +74 -0
  147. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/key_vault_management_client.rb +149 -0
  148. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/keys.rb +806 -0
  149. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/access_policy_entry.rb +86 -0
  150. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/access_policy_update_kind.rb +17 -0
  151. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/attributes.rb +111 -0
  152. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/certificate_permissions.rb +31 -0
  153. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/check_name_availability_result.rb +77 -0
  154. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/create_mode.rb +16 -0
  155. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/deleted_vault.rb +83 -0
  156. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/deleted_vault_list_result.rb +98 -0
  157. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/deleted_vault_properties.rb +103 -0
  158. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/deletion_recovery_level.rb +18 -0
  159. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/iprule.rb +49 -0
  160. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/json_web_key_curve_name.rb +18 -0
  161. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/json_web_key_operation.rb +21 -0
  162. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/json_web_key_type.rb +18 -0
  163. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/key.rb +184 -0
  164. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/key_attributes.rb +86 -0
  165. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/key_create_parameters.rb +67 -0
  166. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/key_list_result.rb +98 -0
  167. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/key_permissions.rb +31 -0
  168. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/key_properties.rb +131 -0
  169. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/log_specification.rb +68 -0
  170. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/network_rule_action.rb +16 -0
  171. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/network_rule_bypass_options.rb +16 -0
  172. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/network_rule_set.rb +103 -0
  173. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/operation.rb +83 -0
  174. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/operation_display.rb +79 -0
  175. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/operation_list_result.rb +100 -0
  176. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/permissions.rb +111 -0
  177. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/private_endpoint.rb +47 -0
  178. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/private_endpoint_connection.rb +127 -0
  179. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/private_endpoint_connection_item.rb +74 -0
  180. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/private_endpoint_connection_provisioning_state.rb +20 -0
  181. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/private_endpoint_service_connection_status.rb +18 -0
  182. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/private_link_resource.rb +140 -0
  183. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/private_link_resource_list_result.rb +55 -0
  184. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/private_link_service_connection_state.rb +73 -0
  185. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/reason.rb +16 -0
  186. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/resource.rb +113 -0
  187. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/resource_list_result.rb +98 -0
  188. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/secret_permissions.rb +23 -0
  189. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/service_specification.rb +55 -0
  190. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/sku.rb +62 -0
  191. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/sku_name.rb +16 -0
  192. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/storage_permissions.rb +29 -0
  193. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/vault.rb +115 -0
  194. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/vault_access_policy_parameters.rb +95 -0
  195. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/vault_access_policy_properties.rb +57 -0
  196. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/vault_check_name_availability_parameters.rb +60 -0
  197. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/vault_create_or_update_parameters.rb +80 -0
  198. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/vault_list_result.rb +98 -0
  199. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/vault_patch_parameters.rb +67 -0
  200. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/vault_patch_properties.rb +205 -0
  201. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/vault_properties.rb +248 -0
  202. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/models/virtual_network_rule.rb +48 -0
  203. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/module_definition.rb +9 -0
  204. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/operations.rb +220 -0
  205. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/private_endpoint_connections.rb +410 -0
  206. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/private_link_resources.rb +124 -0
  207. data/lib/2019-09-01/generated/azure_mgmt_key_vault2/vaults.rb +1771 -0
  208. data/lib/2019-09-01/generated/azure_mgmt_key_vault2.rb +86 -0
  209. data/lib/azure_mgmt_key_vault2.rb +13 -0
  210. data/lib/module_definition.rb +7 -0
  211. data/lib/profiles/latest/keyvault_latest_profile_client.rb +40 -0
  212. data/lib/profiles/latest/keyvault_module_definition.rb +8 -0
  213. data/lib/profiles/latest/modules/keyvault_profile_module.rb +207 -0
  214. data/lib/profiles/v2017_03_09/keyvault_module_definition.rb +8 -0
  215. data/lib/profiles/v2017_03_09/keyvault_v2017_03_09_profile_client.rb +40 -0
  216. data/lib/profiles/v2017_03_09/modules/keyvault_profile_module.rb +187 -0
  217. data/lib/profiles/v2018_03_01/keyvault_module_definition.rb +8 -0
  218. data/lib/profiles/v2018_03_01/keyvault_v2018_03_01_profile_client.rb +40 -0
  219. data/lib/profiles/v2018_03_01/modules/keyvault_profile_module.rb +187 -0
  220. data/lib/profiles/v2019_03_01_hybrid/keyvault_module_definition.rb +8 -0
  221. data/lib/profiles/v2019_03_01_hybrid/keyvault_v2019_03_01_hybrid_profile_client.rb +40 -0
  222. data/lib/profiles/v2019_03_01_hybrid/modules/keyvault_profile_module.rb +187 -0
  223. data/lib/version.rb +7 -0
  224. metadata +340 -0
@@ -0,0 +1,1723 @@
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::KeyVault2::Mgmt::V2016_10_01
7
+ #
8
+ # The Azure management API provides a RESTful set of web services that
9
+ # interact with Azure Key Vault.
10
+ #
11
+ class Vaults
12
+ include MsRestAzure2
13
+
14
+ #
15
+ # Creates and initializes a new instance of the Vaults class.
16
+ # @param client service class for accessing basic functionality.
17
+ #
18
+ def initialize(client)
19
+ @client = client
20
+ end
21
+
22
+ # @return [KeyVaultManagementClient] reference to the KeyVaultManagementClient
23
+ attr_reader :client
24
+
25
+ #
26
+ # Create or update a key vault in the specified subscription.
27
+ #
28
+ # @param resource_group_name [String] The name of the Resource Group to which
29
+ # the server belongs.
30
+ # @param vault_name [String] Name of the vault
31
+ # @param parameters [VaultCreateOrUpdateParameters] Parameters to create or
32
+ # update the vault
33
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
34
+ # will be added to the HTTP request.
35
+ #
36
+ # @return [Vault] operation results.
37
+ #
38
+ def create_or_update(resource_group_name, vault_name, parameters, custom_headers:nil)
39
+ response = create_or_update_async(resource_group_name, vault_name, parameters, custom_headers:custom_headers).value!
40
+ response.body unless response.nil?
41
+ end
42
+
43
+ #
44
+ # Create or update a key vault in the specified subscription.
45
+ #
46
+ # @param resource_group_name [String] The name of the Resource Group to which
47
+ # the server belongs.
48
+ # @param vault_name [String] Name of the vault
49
+ # @param parameters [VaultCreateOrUpdateParameters] Parameters to create or
50
+ # update the vault
51
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
52
+ # will be added to the HTTP request.
53
+ #
54
+ # @return [MsRestAzure2::AzureOperationResponse] HTTP response information.
55
+ #
56
+ def create_or_update_with_http_info(resource_group_name, vault_name, parameters, custom_headers:nil)
57
+ create_or_update_async(resource_group_name, vault_name, parameters, custom_headers:custom_headers).value!
58
+ end
59
+
60
+ #
61
+ # Create or update a key vault in the specified subscription.
62
+ #
63
+ # @param resource_group_name [String] The name of the Resource Group to which
64
+ # the server belongs.
65
+ # @param vault_name [String] Name of the vault
66
+ # @param parameters [VaultCreateOrUpdateParameters] Parameters to create or
67
+ # update the vault
68
+ # @param [Hash{String => String}] A hash of custom headers that will be added
69
+ # to the HTTP request.
70
+ #
71
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
72
+ #
73
+ def create_or_update_async(resource_group_name, vault_name, parameters, custom_headers:nil)
74
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
75
+ fail ArgumentError, 'vault_name is nil' if vault_name.nil?
76
+ fail ArgumentError, "'vault_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9-]{3,24}$'" if !vault_name.nil? && vault_name.match(Regexp.new('^^[a-zA-Z0-9-]{3,24}$$')).nil?
77
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
78
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
79
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
80
+
81
+
82
+ request_headers = {}
83
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
84
+
85
+ # Set Headers
86
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
87
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
88
+
89
+ # Serialize Request
90
+ request_mapper = Azure::KeyVault2::Mgmt::V2016_10_01::Models::VaultCreateOrUpdateParameters.mapper()
91
+ request_content = @client.serialize(request_mapper, parameters)
92
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
93
+
94
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}'
95
+
96
+ request_url = @base_url || @client.base_url
97
+
98
+ options = {
99
+ middlewares: [[MsRest2::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
100
+ path_params: {'resourceGroupName' => resource_group_name,'vaultName' => vault_name,'subscriptionId' => @client.subscription_id},
101
+ query_params: {'api-version' => @client.api_version},
102
+ body: request_content,
103
+ headers: request_headers.merge(custom_headers || {}),
104
+ base_url: request_url
105
+ }
106
+ promise = @client.make_request_async(:put, path_template, options)
107
+
108
+ promise = promise.then do |result|
109
+ http_response = result.response
110
+ status_code = http_response.status
111
+ response_content = http_response.body
112
+ unless status_code == 201 || status_code == 200
113
+ error_model = JSON.load(response_content)
114
+ fail MsRestAzure2::AzureOperationError.new(result.request, http_response, error_model)
115
+ end
116
+
117
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
118
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
119
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
120
+ # Deserialize Response
121
+ if status_code == 201
122
+ begin
123
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
124
+ result_mapper = Azure::KeyVault2::Mgmt::V2016_10_01::Models::Vault.mapper()
125
+ result.body = @client.deserialize(result_mapper, parsed_response)
126
+ rescue Exception => e
127
+ fail MsRest2::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
128
+ end
129
+ end
130
+ # Deserialize Response
131
+ if status_code == 200
132
+ begin
133
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
134
+ result_mapper = Azure::KeyVault2::Mgmt::V2016_10_01::Models::Vault.mapper()
135
+ result.body = @client.deserialize(result_mapper, parsed_response)
136
+ rescue Exception => e
137
+ fail MsRest2::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
138
+ end
139
+ end
140
+
141
+ result
142
+ end
143
+
144
+ promise.execute
145
+ end
146
+
147
+ #
148
+ # Update a key vault in the specified subscription.
149
+ #
150
+ # @param resource_group_name [String] The name of the Resource Group to which
151
+ # the server belongs.
152
+ # @param vault_name [String] Name of the vault
153
+ # @param parameters [VaultPatchParameters] Parameters to patch the vault
154
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
155
+ # will be added to the HTTP request.
156
+ #
157
+ # @return [Vault] operation results.
158
+ #
159
+ def update(resource_group_name, vault_name, parameters, custom_headers:nil)
160
+ response = update_async(resource_group_name, vault_name, parameters, custom_headers:custom_headers).value!
161
+ response.body unless response.nil?
162
+ end
163
+
164
+ #
165
+ # Update a key vault in the specified subscription.
166
+ #
167
+ # @param resource_group_name [String] The name of the Resource Group to which
168
+ # the server belongs.
169
+ # @param vault_name [String] Name of the vault
170
+ # @param parameters [VaultPatchParameters] Parameters to patch the vault
171
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
172
+ # will be added to the HTTP request.
173
+ #
174
+ # @return [MsRestAzure2::AzureOperationResponse] HTTP response information.
175
+ #
176
+ def update_with_http_info(resource_group_name, vault_name, parameters, custom_headers:nil)
177
+ update_async(resource_group_name, vault_name, parameters, custom_headers:custom_headers).value!
178
+ end
179
+
180
+ #
181
+ # Update a key vault in the specified subscription.
182
+ #
183
+ # @param resource_group_name [String] The name of the Resource Group to which
184
+ # the server belongs.
185
+ # @param vault_name [String] Name of the vault
186
+ # @param parameters [VaultPatchParameters] Parameters to patch the vault
187
+ # @param [Hash{String => String}] A hash of custom headers that will be added
188
+ # to the HTTP request.
189
+ #
190
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
191
+ #
192
+ def update_async(resource_group_name, vault_name, parameters, custom_headers:nil)
193
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
194
+ fail ArgumentError, 'vault_name is nil' if vault_name.nil?
195
+ fail ArgumentError, "'vault_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9-]{3,24}$'" if !vault_name.nil? && vault_name.match(Regexp.new('^^[a-zA-Z0-9-]{3,24}$$')).nil?
196
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
197
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
198
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
199
+
200
+
201
+ request_headers = {}
202
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
203
+
204
+ # Set Headers
205
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
206
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
207
+
208
+ # Serialize Request
209
+ request_mapper = Azure::KeyVault2::Mgmt::V2016_10_01::Models::VaultPatchParameters.mapper()
210
+ request_content = @client.serialize(request_mapper, parameters)
211
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
212
+
213
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}'
214
+
215
+ request_url = @base_url || @client.base_url
216
+
217
+ options = {
218
+ middlewares: [[MsRest2::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
219
+ path_params: {'resourceGroupName' => resource_group_name,'vaultName' => vault_name,'subscriptionId' => @client.subscription_id},
220
+ query_params: {'api-version' => @client.api_version},
221
+ body: request_content,
222
+ headers: request_headers.merge(custom_headers || {}),
223
+ base_url: request_url
224
+ }
225
+ promise = @client.make_request_async(:patch, path_template, options)
226
+
227
+ promise = promise.then do |result|
228
+ http_response = result.response
229
+ status_code = http_response.status
230
+ response_content = http_response.body
231
+ unless status_code == 201 || status_code == 200
232
+ error_model = JSON.load(response_content)
233
+ fail MsRestAzure2::AzureOperationError.new(result.request, http_response, error_model)
234
+ end
235
+
236
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
237
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
238
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
239
+ # Deserialize Response
240
+ if status_code == 201
241
+ begin
242
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
243
+ result_mapper = Azure::KeyVault2::Mgmt::V2016_10_01::Models::Vault.mapper()
244
+ result.body = @client.deserialize(result_mapper, parsed_response)
245
+ rescue Exception => e
246
+ fail MsRest2::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
247
+ end
248
+ end
249
+ # Deserialize Response
250
+ if status_code == 200
251
+ begin
252
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
253
+ result_mapper = Azure::KeyVault2::Mgmt::V2016_10_01::Models::Vault.mapper()
254
+ result.body = @client.deserialize(result_mapper, parsed_response)
255
+ rescue Exception => e
256
+ fail MsRest2::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
257
+ end
258
+ end
259
+
260
+ result
261
+ end
262
+
263
+ promise.execute
264
+ end
265
+
266
+ #
267
+ # Deletes the specified Azure key vault.
268
+ #
269
+ # @param resource_group_name [String] The name of the Resource Group to which
270
+ # the vault belongs.
271
+ # @param vault_name [String] The name of the vault to delete
272
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
273
+ # will be added to the HTTP request.
274
+ #
275
+ #
276
+ def delete(resource_group_name, vault_name, custom_headers:nil)
277
+ response = delete_async(resource_group_name, vault_name, custom_headers:custom_headers).value!
278
+ nil
279
+ end
280
+
281
+ #
282
+ # Deletes the specified Azure key vault.
283
+ #
284
+ # @param resource_group_name [String] The name of the Resource Group to which
285
+ # the vault belongs.
286
+ # @param vault_name [String] The name of the vault to delete
287
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
288
+ # will be added to the HTTP request.
289
+ #
290
+ # @return [MsRestAzure2::AzureOperationResponse] HTTP response information.
291
+ #
292
+ def delete_with_http_info(resource_group_name, vault_name, custom_headers:nil)
293
+ delete_async(resource_group_name, vault_name, custom_headers:custom_headers).value!
294
+ end
295
+
296
+ #
297
+ # Deletes the specified Azure key vault.
298
+ #
299
+ # @param resource_group_name [String] The name of the Resource Group to which
300
+ # the vault belongs.
301
+ # @param vault_name [String] The name of the vault to delete
302
+ # @param [Hash{String => String}] A hash of custom headers that will be added
303
+ # to the HTTP request.
304
+ #
305
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
306
+ #
307
+ def delete_async(resource_group_name, vault_name, custom_headers:nil)
308
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
309
+ fail ArgumentError, 'vault_name is nil' if vault_name.nil?
310
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
311
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
312
+
313
+
314
+ request_headers = {}
315
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
316
+
317
+ # Set Headers
318
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
319
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
320
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}'
321
+
322
+ request_url = @base_url || @client.base_url
323
+
324
+ options = {
325
+ middlewares: [[MsRest2::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
326
+ path_params: {'resourceGroupName' => resource_group_name,'vaultName' => vault_name,'subscriptionId' => @client.subscription_id},
327
+ query_params: {'api-version' => @client.api_version},
328
+ headers: request_headers.merge(custom_headers || {}),
329
+ base_url: request_url
330
+ }
331
+ promise = @client.make_request_async(:delete, path_template, options)
332
+
333
+ promise = promise.then do |result|
334
+ http_response = result.response
335
+ status_code = http_response.status
336
+ response_content = http_response.body
337
+ unless status_code == 200
338
+ error_model = JSON.load(response_content)
339
+ fail MsRestAzure2::AzureOperationError.new(result.request, http_response, error_model)
340
+ end
341
+
342
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
343
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
344
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
345
+
346
+ result
347
+ end
348
+
349
+ promise.execute
350
+ end
351
+
352
+ #
353
+ # Gets the specified Azure key vault.
354
+ #
355
+ # @param resource_group_name [String] The name of the Resource Group to which
356
+ # the vault belongs.
357
+ # @param vault_name [String] The name of the vault.
358
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
359
+ # will be added to the HTTP request.
360
+ #
361
+ # @return [Vault] operation results.
362
+ #
363
+ def get(resource_group_name, vault_name, custom_headers:nil)
364
+ response = get_async(resource_group_name, vault_name, custom_headers:custom_headers).value!
365
+ response.body unless response.nil?
366
+ end
367
+
368
+ #
369
+ # Gets the specified Azure key vault.
370
+ #
371
+ # @param resource_group_name [String] The name of the Resource Group to which
372
+ # the vault belongs.
373
+ # @param vault_name [String] The name of the vault.
374
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
375
+ # will be added to the HTTP request.
376
+ #
377
+ # @return [MsRestAzure2::AzureOperationResponse] HTTP response information.
378
+ #
379
+ def get_with_http_info(resource_group_name, vault_name, custom_headers:nil)
380
+ get_async(resource_group_name, vault_name, custom_headers:custom_headers).value!
381
+ end
382
+
383
+ #
384
+ # Gets the specified Azure key vault.
385
+ #
386
+ # @param resource_group_name [String] The name of the Resource Group to which
387
+ # the vault belongs.
388
+ # @param vault_name [String] The name of the vault.
389
+ # @param [Hash{String => String}] A hash of custom headers that will be added
390
+ # to the HTTP request.
391
+ #
392
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
393
+ #
394
+ def get_async(resource_group_name, vault_name, custom_headers:nil)
395
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
396
+ fail ArgumentError, 'vault_name is nil' if vault_name.nil?
397
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
398
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
399
+
400
+
401
+ request_headers = {}
402
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
403
+
404
+ # Set Headers
405
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
406
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
407
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}'
408
+
409
+ request_url = @base_url || @client.base_url
410
+
411
+ options = {
412
+ middlewares: [[MsRest2::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
413
+ path_params: {'resourceGroupName' => resource_group_name,'vaultName' => vault_name,'subscriptionId' => @client.subscription_id},
414
+ query_params: {'api-version' => @client.api_version},
415
+ headers: request_headers.merge(custom_headers || {}),
416
+ base_url: request_url
417
+ }
418
+ promise = @client.make_request_async(:get, path_template, options)
419
+
420
+ promise = promise.then do |result|
421
+ http_response = result.response
422
+ status_code = http_response.status
423
+ response_content = http_response.body
424
+ unless status_code == 200
425
+ error_model = JSON.load(response_content)
426
+ fail MsRestAzure2::AzureOperationError.new(result.request, http_response, error_model)
427
+ end
428
+
429
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
430
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
431
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
432
+ # Deserialize Response
433
+ if status_code == 200
434
+ begin
435
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
436
+ result_mapper = Azure::KeyVault2::Mgmt::V2016_10_01::Models::Vault.mapper()
437
+ result.body = @client.deserialize(result_mapper, parsed_response)
438
+ rescue Exception => e
439
+ fail MsRest2::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
440
+ end
441
+ end
442
+
443
+ result
444
+ end
445
+
446
+ promise.execute
447
+ end
448
+
449
+ #
450
+ # Update access policies in a key vault in the specified subscription.
451
+ #
452
+ # @param resource_group_name [String] The name of the Resource Group to which
453
+ # the vault belongs.
454
+ # @param vault_name [String] Name of the vault
455
+ # @param operation_kind [AccessPolicyUpdateKind] Name of the operation.
456
+ # Possible values include: 'add', 'replace', 'remove'
457
+ # @param parameters [VaultAccessPolicyParameters] Access policy to merge into
458
+ # the vault
459
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
460
+ # will be added to the HTTP request.
461
+ #
462
+ # @return [VaultAccessPolicyParameters] operation results.
463
+ #
464
+ def update_access_policy(resource_group_name, vault_name, operation_kind, parameters, custom_headers:nil)
465
+ response = update_access_policy_async(resource_group_name, vault_name, operation_kind, parameters, custom_headers:custom_headers).value!
466
+ response.body unless response.nil?
467
+ end
468
+
469
+ #
470
+ # Update access policies in a key vault in the specified subscription.
471
+ #
472
+ # @param resource_group_name [String] The name of the Resource Group to which
473
+ # the vault belongs.
474
+ # @param vault_name [String] Name of the vault
475
+ # @param operation_kind [AccessPolicyUpdateKind] Name of the operation.
476
+ # Possible values include: 'add', 'replace', 'remove'
477
+ # @param parameters [VaultAccessPolicyParameters] Access policy to merge into
478
+ # the vault
479
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
480
+ # will be added to the HTTP request.
481
+ #
482
+ # @return [MsRestAzure2::AzureOperationResponse] HTTP response information.
483
+ #
484
+ def update_access_policy_with_http_info(resource_group_name, vault_name, operation_kind, parameters, custom_headers:nil)
485
+ update_access_policy_async(resource_group_name, vault_name, operation_kind, parameters, custom_headers:custom_headers).value!
486
+ end
487
+
488
+ #
489
+ # Update access policies in a key vault in the specified subscription.
490
+ #
491
+ # @param resource_group_name [String] The name of the Resource Group to which
492
+ # the vault belongs.
493
+ # @param vault_name [String] Name of the vault
494
+ # @param operation_kind [AccessPolicyUpdateKind] Name of the operation.
495
+ # Possible values include: 'add', 'replace', 'remove'
496
+ # @param parameters [VaultAccessPolicyParameters] Access policy to merge into
497
+ # the vault
498
+ # @param [Hash{String => String}] A hash of custom headers that will be added
499
+ # to the HTTP request.
500
+ #
501
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
502
+ #
503
+ def update_access_policy_async(resource_group_name, vault_name, operation_kind, parameters, custom_headers:nil)
504
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
505
+ fail ArgumentError, 'vault_name is nil' if vault_name.nil?
506
+ fail ArgumentError, "'vault_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9-]{3,24}$'" if !vault_name.nil? && vault_name.match(Regexp.new('^^[a-zA-Z0-9-]{3,24}$$')).nil?
507
+ fail ArgumentError, 'operation_kind is nil' if operation_kind.nil?
508
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
509
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
510
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
511
+
512
+
513
+ request_headers = {}
514
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
515
+
516
+ # Set Headers
517
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
518
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
519
+
520
+ # Serialize Request
521
+ request_mapper = Azure::KeyVault2::Mgmt::V2016_10_01::Models::VaultAccessPolicyParameters.mapper()
522
+ request_content = @client.serialize(request_mapper, parameters)
523
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
524
+
525
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/accessPolicies/{operationKind}'
526
+
527
+ request_url = @base_url || @client.base_url
528
+
529
+ options = {
530
+ middlewares: [[MsRest2::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
531
+ path_params: {'resourceGroupName' => resource_group_name,'vaultName' => vault_name,'operationKind' => operation_kind,'subscriptionId' => @client.subscription_id},
532
+ query_params: {'api-version' => @client.api_version},
533
+ body: request_content,
534
+ headers: request_headers.merge(custom_headers || {}),
535
+ base_url: request_url
536
+ }
537
+ promise = @client.make_request_async(:put, path_template, options)
538
+
539
+ promise = promise.then do |result|
540
+ http_response = result.response
541
+ status_code = http_response.status
542
+ response_content = http_response.body
543
+ unless status_code == 201 || status_code == 200
544
+ error_model = JSON.load(response_content)
545
+ fail MsRestAzure2::AzureOperationError.new(result.request, http_response, error_model)
546
+ end
547
+
548
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
549
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
550
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
551
+ # Deserialize Response
552
+ if status_code == 201
553
+ begin
554
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
555
+ result_mapper = Azure::KeyVault2::Mgmt::V2016_10_01::Models::VaultAccessPolicyParameters.mapper()
556
+ result.body = @client.deserialize(result_mapper, parsed_response)
557
+ rescue Exception => e
558
+ fail MsRest2::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
559
+ end
560
+ end
561
+ # Deserialize Response
562
+ if status_code == 200
563
+ begin
564
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
565
+ result_mapper = Azure::KeyVault2::Mgmt::V2016_10_01::Models::VaultAccessPolicyParameters.mapper()
566
+ result.body = @client.deserialize(result_mapper, parsed_response)
567
+ rescue Exception => e
568
+ fail MsRest2::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
569
+ end
570
+ end
571
+
572
+ result
573
+ end
574
+
575
+ promise.execute
576
+ end
577
+
578
+ #
579
+ # The List operation gets information about the vaults associated with the
580
+ # subscription and within the specified resource group.
581
+ #
582
+ # @param resource_group_name [String] The name of the Resource Group to which
583
+ # the vault belongs.
584
+ # @param top [Integer] Maximum number of results to return.
585
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
586
+ # will be added to the HTTP request.
587
+ #
588
+ # @return [Array<Vault>] operation results.
589
+ #
590
+ def list_by_resource_group(resource_group_name, top:nil, custom_headers:nil)
591
+ first_page = list_by_resource_group_as_lazy(resource_group_name, top:top, custom_headers:custom_headers)
592
+ first_page.get_all_items
593
+ end
594
+
595
+ #
596
+ # The List operation gets information about the vaults associated with the
597
+ # subscription and within the specified resource group.
598
+ #
599
+ # @param resource_group_name [String] The name of the Resource Group to which
600
+ # the vault belongs.
601
+ # @param top [Integer] Maximum number of results to return.
602
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
603
+ # will be added to the HTTP request.
604
+ #
605
+ # @return [MsRestAzure2::AzureOperationResponse] HTTP response information.
606
+ #
607
+ def list_by_resource_group_with_http_info(resource_group_name, top:nil, custom_headers:nil)
608
+ list_by_resource_group_async(resource_group_name, top:top, custom_headers:custom_headers).value!
609
+ end
610
+
611
+ #
612
+ # The List operation gets information about the vaults associated with the
613
+ # subscription and within the specified resource group.
614
+ #
615
+ # @param resource_group_name [String] The name of the Resource Group to which
616
+ # the vault belongs.
617
+ # @param top [Integer] Maximum number of results to return.
618
+ # @param [Hash{String => String}] A hash of custom headers that will be added
619
+ # to the HTTP request.
620
+ #
621
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
622
+ #
623
+ def list_by_resource_group_async(resource_group_name, top:nil, custom_headers:nil)
624
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
625
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
626
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
627
+
628
+
629
+ request_headers = {}
630
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
631
+
632
+ # Set Headers
633
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
634
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
635
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults'
636
+
637
+ request_url = @base_url || @client.base_url
638
+
639
+ options = {
640
+ middlewares: [[MsRest2::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
641
+ path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
642
+ query_params: {'$top' => top,'api-version' => @client.api_version},
643
+ headers: request_headers.merge(custom_headers || {}),
644
+ base_url: request_url
645
+ }
646
+ promise = @client.make_request_async(:get, path_template, options)
647
+
648
+ promise = promise.then do |result|
649
+ http_response = result.response
650
+ status_code = http_response.status
651
+ response_content = http_response.body
652
+ unless status_code == 200
653
+ error_model = JSON.load(response_content)
654
+ fail MsRestAzure2::AzureOperationError.new(result.request, http_response, error_model)
655
+ end
656
+
657
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
658
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
659
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
660
+ # Deserialize Response
661
+ if status_code == 200
662
+ begin
663
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
664
+ result_mapper = Azure::KeyVault2::Mgmt::V2016_10_01::Models::VaultListResult.mapper()
665
+ result.body = @client.deserialize(result_mapper, parsed_response)
666
+ rescue Exception => e
667
+ fail MsRest2::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
668
+ end
669
+ end
670
+
671
+ result
672
+ end
673
+
674
+ promise.execute
675
+ end
676
+
677
+ #
678
+ # The List operation gets information about the vaults associated with the
679
+ # subscription.
680
+ #
681
+ # @param top [Integer] Maximum number of results to return.
682
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
683
+ # will be added to the HTTP request.
684
+ #
685
+ # @return [Array<Vault>] operation results.
686
+ #
687
+ def list_by_subscription(top:nil, custom_headers:nil)
688
+ first_page = list_by_subscription_as_lazy(top:top, custom_headers:custom_headers)
689
+ first_page.get_all_items
690
+ end
691
+
692
+ #
693
+ # The List operation gets information about the vaults associated with the
694
+ # subscription.
695
+ #
696
+ # @param top [Integer] Maximum number of results to return.
697
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
698
+ # will be added to the HTTP request.
699
+ #
700
+ # @return [MsRestAzure2::AzureOperationResponse] HTTP response information.
701
+ #
702
+ def list_by_subscription_with_http_info(top:nil, custom_headers:nil)
703
+ list_by_subscription_async(top:top, custom_headers:custom_headers).value!
704
+ end
705
+
706
+ #
707
+ # The List operation gets information about the vaults associated with the
708
+ # subscription.
709
+ #
710
+ # @param top [Integer] Maximum number of results to return.
711
+ # @param [Hash{String => String}] A hash of custom headers that will be added
712
+ # to the HTTP request.
713
+ #
714
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
715
+ #
716
+ def list_by_subscription_async(top:nil, custom_headers:nil)
717
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
718
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
719
+
720
+
721
+ request_headers = {}
722
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
723
+
724
+ # Set Headers
725
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
726
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
727
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/vaults'
728
+
729
+ request_url = @base_url || @client.base_url
730
+
731
+ options = {
732
+ middlewares: [[MsRest2::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
733
+ path_params: {'subscriptionId' => @client.subscription_id},
734
+ query_params: {'$top' => top,'api-version' => @client.api_version},
735
+ headers: request_headers.merge(custom_headers || {}),
736
+ base_url: request_url
737
+ }
738
+ promise = @client.make_request_async(:get, path_template, options)
739
+
740
+ promise = promise.then do |result|
741
+ http_response = result.response
742
+ status_code = http_response.status
743
+ response_content = http_response.body
744
+ unless status_code == 200
745
+ error_model = JSON.load(response_content)
746
+ fail MsRestAzure2::AzureOperationError.new(result.request, http_response, error_model)
747
+ end
748
+
749
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
750
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
751
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
752
+ # Deserialize Response
753
+ if status_code == 200
754
+ begin
755
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
756
+ result_mapper = Azure::KeyVault2::Mgmt::V2016_10_01::Models::VaultListResult.mapper()
757
+ result.body = @client.deserialize(result_mapper, parsed_response)
758
+ rescue Exception => e
759
+ fail MsRest2::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
760
+ end
761
+ end
762
+
763
+ result
764
+ end
765
+
766
+ promise.execute
767
+ end
768
+
769
+ #
770
+ # Gets information about the deleted vaults in a subscription.
771
+ #
772
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
773
+ # will be added to the HTTP request.
774
+ #
775
+ # @return [Array<DeletedVault>] operation results.
776
+ #
777
+ def list_deleted(custom_headers:nil)
778
+ first_page = list_deleted_as_lazy(custom_headers:custom_headers)
779
+ first_page.get_all_items
780
+ end
781
+
782
+ #
783
+ # Gets information about the deleted vaults in a subscription.
784
+ #
785
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
786
+ # will be added to the HTTP request.
787
+ #
788
+ # @return [MsRestAzure2::AzureOperationResponse] HTTP response information.
789
+ #
790
+ def list_deleted_with_http_info(custom_headers:nil)
791
+ list_deleted_async(custom_headers:custom_headers).value!
792
+ end
793
+
794
+ #
795
+ # Gets information about the deleted vaults in a subscription.
796
+ #
797
+ # @param [Hash{String => String}] A hash of custom headers that will be added
798
+ # to the HTTP request.
799
+ #
800
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
801
+ #
802
+ def list_deleted_async(custom_headers:nil)
803
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
804
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
805
+
806
+
807
+ request_headers = {}
808
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
809
+
810
+ # Set Headers
811
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
812
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
813
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/deletedVaults'
814
+
815
+ request_url = @base_url || @client.base_url
816
+
817
+ options = {
818
+ middlewares: [[MsRest2::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
819
+ path_params: {'subscriptionId' => @client.subscription_id},
820
+ query_params: {'api-version' => @client.api_version},
821
+ headers: request_headers.merge(custom_headers || {}),
822
+ base_url: request_url
823
+ }
824
+ promise = @client.make_request_async(:get, path_template, options)
825
+
826
+ promise = promise.then do |result|
827
+ http_response = result.response
828
+ status_code = http_response.status
829
+ response_content = http_response.body
830
+ unless status_code == 200
831
+ error_model = JSON.load(response_content)
832
+ fail MsRestAzure2::AzureOperationError.new(result.request, http_response, error_model)
833
+ end
834
+
835
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
836
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
837
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
838
+ # Deserialize Response
839
+ if status_code == 200
840
+ begin
841
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
842
+ result_mapper = Azure::KeyVault2::Mgmt::V2016_10_01::Models::DeletedVaultListResult.mapper()
843
+ result.body = @client.deserialize(result_mapper, parsed_response)
844
+ rescue Exception => e
845
+ fail MsRest2::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
846
+ end
847
+ end
848
+
849
+ result
850
+ end
851
+
852
+ promise.execute
853
+ end
854
+
855
+ #
856
+ # Gets the deleted Azure key vault.
857
+ #
858
+ # @param vault_name [String] The name of the vault.
859
+ # @param location [String] The location of the deleted vault.
860
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
861
+ # will be added to the HTTP request.
862
+ #
863
+ # @return [DeletedVault] operation results.
864
+ #
865
+ def get_deleted(vault_name, location, custom_headers:nil)
866
+ response = get_deleted_async(vault_name, location, custom_headers:custom_headers).value!
867
+ response.body unless response.nil?
868
+ end
869
+
870
+ #
871
+ # Gets the deleted Azure key vault.
872
+ #
873
+ # @param vault_name [String] The name of the vault.
874
+ # @param location [String] The location of the deleted vault.
875
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
876
+ # will be added to the HTTP request.
877
+ #
878
+ # @return [MsRestAzure2::AzureOperationResponse] HTTP response information.
879
+ #
880
+ def get_deleted_with_http_info(vault_name, location, custom_headers:nil)
881
+ get_deleted_async(vault_name, location, custom_headers:custom_headers).value!
882
+ end
883
+
884
+ #
885
+ # Gets the deleted Azure key vault.
886
+ #
887
+ # @param vault_name [String] The name of the vault.
888
+ # @param location [String] The location of the deleted vault.
889
+ # @param [Hash{String => String}] A hash of custom headers that will be added
890
+ # to the HTTP request.
891
+ #
892
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
893
+ #
894
+ def get_deleted_async(vault_name, location, custom_headers:nil)
895
+ fail ArgumentError, 'vault_name is nil' if vault_name.nil?
896
+ fail ArgumentError, 'location is nil' if location.nil?
897
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
898
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
899
+
900
+
901
+ request_headers = {}
902
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
903
+
904
+ # Set Headers
905
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
906
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
907
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/locations/{location}/deletedVaults/{vaultName}'
908
+
909
+ request_url = @base_url || @client.base_url
910
+
911
+ options = {
912
+ middlewares: [[MsRest2::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
913
+ path_params: {'vaultName' => vault_name,'location' => location,'subscriptionId' => @client.subscription_id},
914
+ query_params: {'api-version' => @client.api_version},
915
+ headers: request_headers.merge(custom_headers || {}),
916
+ base_url: request_url
917
+ }
918
+ promise = @client.make_request_async(:get, path_template, options)
919
+
920
+ promise = promise.then do |result|
921
+ http_response = result.response
922
+ status_code = http_response.status
923
+ response_content = http_response.body
924
+ unless status_code == 200
925
+ error_model = JSON.load(response_content)
926
+ fail MsRestAzure2::AzureOperationError.new(result.request, http_response, error_model)
927
+ end
928
+
929
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
930
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
931
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
932
+ # Deserialize Response
933
+ if status_code == 200
934
+ begin
935
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
936
+ result_mapper = Azure::KeyVault2::Mgmt::V2016_10_01::Models::DeletedVault.mapper()
937
+ result.body = @client.deserialize(result_mapper, parsed_response)
938
+ rescue Exception => e
939
+ fail MsRest2::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
940
+ end
941
+ end
942
+
943
+ result
944
+ end
945
+
946
+ promise.execute
947
+ end
948
+
949
+ #
950
+ # Permanently deletes the specified vault. aka Purges the deleted Azure key
951
+ # vault.
952
+ #
953
+ # @param vault_name [String] The name of the soft-deleted vault.
954
+ # @param location [String] The location of the soft-deleted vault.
955
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
956
+ # will be added to the HTTP request.
957
+ #
958
+ def purge_deleted(vault_name, location, custom_headers:nil)
959
+ response = purge_deleted_async(vault_name, location, custom_headers:custom_headers).value!
960
+ nil
961
+ end
962
+
963
+ #
964
+ # @param vault_name [String] The name of the soft-deleted vault.
965
+ # @param location [String] The location of the soft-deleted vault.
966
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
967
+ # will be added to the HTTP request.
968
+ #
969
+ # @return [Concurrent::Promise] promise which provides async access to http
970
+ # response.
971
+ #
972
+ def purge_deleted_async(vault_name, location, custom_headers:nil)
973
+ # Send request
974
+ promise = begin_purge_deleted_async(vault_name, location, custom_headers:custom_headers)
975
+
976
+ promise = promise.then do |response|
977
+ # Defining deserialization method.
978
+ deserialize_method = lambda do |parsed_response|
979
+ end
980
+
981
+ # Waiting for response.
982
+ @client.get_long_running_operation_result(response, deserialize_method)
983
+ end
984
+
985
+ promise
986
+ end
987
+
988
+ #
989
+ # The List operation gets information about the vaults associated with the
990
+ # subscription.
991
+ #
992
+ # @param top [Integer] Maximum number of results to return.
993
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
994
+ # will be added to the HTTP request.
995
+ #
996
+ # @return [Array<Resource>] operation results.
997
+ #
998
+ def list(top:nil, custom_headers:nil)
999
+ first_page = list_as_lazy(top:top, custom_headers:custom_headers)
1000
+ first_page.get_all_items
1001
+ end
1002
+
1003
+ #
1004
+ # The List operation gets information about the vaults associated with the
1005
+ # subscription.
1006
+ #
1007
+ # @param top [Integer] Maximum number of results to return.
1008
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1009
+ # will be added to the HTTP request.
1010
+ #
1011
+ # @return [MsRestAzure2::AzureOperationResponse] HTTP response information.
1012
+ #
1013
+ def list_with_http_info(top:nil, custom_headers:nil)
1014
+ list_async(top:top, custom_headers:custom_headers).value!
1015
+ end
1016
+
1017
+ #
1018
+ # The List operation gets information about the vaults associated with the
1019
+ # subscription.
1020
+ #
1021
+ # @param top [Integer] Maximum number of results to return.
1022
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1023
+ # to the HTTP request.
1024
+ #
1025
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1026
+ #
1027
+ def list_async(top:nil, custom_headers:nil)
1028
+ filter = 'resourceType eq \'Microsoft.KeyVault/vaults\''
1029
+ api_version = '2015-11-01'
1030
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1031
+
1032
+
1033
+ request_headers = {}
1034
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1035
+
1036
+ # Set Headers
1037
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1038
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1039
+ path_template = 'subscriptions/{subscriptionId}/resources'
1040
+
1041
+ request_url = @base_url || @client.base_url
1042
+
1043
+ options = {
1044
+ middlewares: [[MsRest2::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1045
+ path_params: {'subscriptionId' => @client.subscription_id},
1046
+ query_params: {'$filter' => filter,'$top' => top,'api-version' => api_version},
1047
+ headers: request_headers.merge(custom_headers || {}),
1048
+ base_url: request_url
1049
+ }
1050
+ promise = @client.make_request_async(:get, path_template, options)
1051
+
1052
+ promise = promise.then do |result|
1053
+ http_response = result.response
1054
+ status_code = http_response.status
1055
+ response_content = http_response.body
1056
+ unless status_code == 200
1057
+ error_model = JSON.load(response_content)
1058
+ fail MsRestAzure2::AzureOperationError.new(result.request, http_response, error_model)
1059
+ end
1060
+
1061
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1062
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1063
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1064
+ # Deserialize Response
1065
+ if status_code == 200
1066
+ begin
1067
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1068
+ result_mapper = Azure::KeyVault2::Mgmt::V2016_10_01::Models::ResourceListResult.mapper()
1069
+ result.body = @client.deserialize(result_mapper, parsed_response)
1070
+ rescue Exception => e
1071
+ fail MsRest2::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1072
+ end
1073
+ end
1074
+
1075
+ result
1076
+ end
1077
+
1078
+ promise.execute
1079
+ end
1080
+
1081
+ #
1082
+ # Checks that the vault name is valid and is not already in use.
1083
+ #
1084
+ # @param vault_name [VaultCheckNameAvailabilityParameters] The name of the
1085
+ # vault.
1086
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1087
+ # will be added to the HTTP request.
1088
+ #
1089
+ # @return [CheckNameAvailabilityResult] operation results.
1090
+ #
1091
+ def check_name_availability(vault_name, custom_headers:nil)
1092
+ response = check_name_availability_async(vault_name, custom_headers:custom_headers).value!
1093
+ response.body unless response.nil?
1094
+ end
1095
+
1096
+ #
1097
+ # Checks that the vault name is valid and is not already in use.
1098
+ #
1099
+ # @param vault_name [VaultCheckNameAvailabilityParameters] The name of the
1100
+ # vault.
1101
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1102
+ # will be added to the HTTP request.
1103
+ #
1104
+ # @return [MsRestAzure2::AzureOperationResponse] HTTP response information.
1105
+ #
1106
+ def check_name_availability_with_http_info(vault_name, custom_headers:nil)
1107
+ check_name_availability_async(vault_name, custom_headers:custom_headers).value!
1108
+ end
1109
+
1110
+ #
1111
+ # Checks that the vault name is valid and is not already in use.
1112
+ #
1113
+ # @param vault_name [VaultCheckNameAvailabilityParameters] The name of the
1114
+ # vault.
1115
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1116
+ # to the HTTP request.
1117
+ #
1118
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1119
+ #
1120
+ def check_name_availability_async(vault_name, custom_headers:nil)
1121
+ fail ArgumentError, 'vault_name is nil' if vault_name.nil?
1122
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1123
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1124
+
1125
+
1126
+ request_headers = {}
1127
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1128
+
1129
+ # Set Headers
1130
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1131
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1132
+
1133
+ # Serialize Request
1134
+ request_mapper = Azure::KeyVault2::Mgmt::V2016_10_01::Models::VaultCheckNameAvailabilityParameters.mapper()
1135
+ request_content = @client.serialize(request_mapper, vault_name)
1136
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1137
+
1138
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/checkNameAvailability'
1139
+
1140
+ request_url = @base_url || @client.base_url
1141
+
1142
+ options = {
1143
+ middlewares: [[MsRest2::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1144
+ path_params: {'subscriptionId' => @client.subscription_id},
1145
+ query_params: {'api-version' => @client.api_version},
1146
+ body: request_content,
1147
+ headers: request_headers.merge(custom_headers || {}),
1148
+ base_url: request_url
1149
+ }
1150
+ promise = @client.make_request_async(:post, path_template, options)
1151
+
1152
+ promise = promise.then do |result|
1153
+ http_response = result.response
1154
+ status_code = http_response.status
1155
+ response_content = http_response.body
1156
+ unless status_code == 200
1157
+ error_model = JSON.load(response_content)
1158
+ fail MsRestAzure2::AzureOperationError.new(result.request, http_response, error_model)
1159
+ end
1160
+
1161
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1162
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1163
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1164
+ # Deserialize Response
1165
+ if status_code == 200
1166
+ begin
1167
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1168
+ result_mapper = Azure::KeyVault2::Mgmt::V2016_10_01::Models::CheckNameAvailabilityResult.mapper()
1169
+ result.body = @client.deserialize(result_mapper, parsed_response)
1170
+ rescue Exception => e
1171
+ fail MsRest2::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1172
+ end
1173
+ end
1174
+
1175
+ result
1176
+ end
1177
+
1178
+ promise.execute
1179
+ end
1180
+
1181
+ #
1182
+ # Permanently deletes the specified vault. aka Purges the deleted Azure key
1183
+ # vault.
1184
+ #
1185
+ # @param vault_name [String] The name of the soft-deleted vault.
1186
+ # @param location [String] The location of the soft-deleted vault.
1187
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1188
+ # will be added to the HTTP request.
1189
+ #
1190
+ #
1191
+ def begin_purge_deleted(vault_name, location, custom_headers:nil)
1192
+ response = begin_purge_deleted_async(vault_name, location, custom_headers:custom_headers).value!
1193
+ nil
1194
+ end
1195
+
1196
+ #
1197
+ # Permanently deletes the specified vault. aka Purges the deleted Azure key
1198
+ # vault.
1199
+ #
1200
+ # @param vault_name [String] The name of the soft-deleted vault.
1201
+ # @param location [String] The location of the soft-deleted vault.
1202
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1203
+ # will be added to the HTTP request.
1204
+ #
1205
+ # @return [MsRestAzure2::AzureOperationResponse] HTTP response information.
1206
+ #
1207
+ def begin_purge_deleted_with_http_info(vault_name, location, custom_headers:nil)
1208
+ begin_purge_deleted_async(vault_name, location, custom_headers:custom_headers).value!
1209
+ end
1210
+
1211
+ #
1212
+ # Permanently deletes the specified vault. aka Purges the deleted Azure key
1213
+ # vault.
1214
+ #
1215
+ # @param vault_name [String] The name of the soft-deleted vault.
1216
+ # @param location [String] The location of the soft-deleted vault.
1217
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1218
+ # to the HTTP request.
1219
+ #
1220
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1221
+ #
1222
+ def begin_purge_deleted_async(vault_name, location, custom_headers:nil)
1223
+ fail ArgumentError, 'vault_name is nil' if vault_name.nil?
1224
+ fail ArgumentError, 'location is nil' if location.nil?
1225
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1226
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1227
+
1228
+
1229
+ request_headers = {}
1230
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1231
+
1232
+ # Set Headers
1233
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1234
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1235
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/locations/{location}/deletedVaults/{vaultName}/purge'
1236
+
1237
+ request_url = @base_url || @client.base_url
1238
+
1239
+ options = {
1240
+ middlewares: [[MsRest2::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1241
+ path_params: {'vaultName' => vault_name,'location' => location,'subscriptionId' => @client.subscription_id},
1242
+ query_params: {'api-version' => @client.api_version},
1243
+ headers: request_headers.merge(custom_headers || {}),
1244
+ base_url: request_url
1245
+ }
1246
+ promise = @client.make_request_async(:post, path_template, options)
1247
+
1248
+ promise = promise.then do |result|
1249
+ http_response = result.response
1250
+ status_code = http_response.status
1251
+ response_content = http_response.body
1252
+ unless status_code == 200 || status_code == 202
1253
+ error_model = JSON.load(response_content)
1254
+ fail MsRestAzure2::AzureOperationError.new(result.request, http_response, error_model)
1255
+ end
1256
+
1257
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1258
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1259
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1260
+
1261
+ result
1262
+ end
1263
+
1264
+ promise.execute
1265
+ end
1266
+
1267
+ #
1268
+ # The List operation gets information about the vaults associated with the
1269
+ # subscription and within the specified resource group.
1270
+ #
1271
+ # @param next_page_link [String] The NextLink from the previous successful call
1272
+ # to List operation.
1273
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1274
+ # will be added to the HTTP request.
1275
+ #
1276
+ # @return [VaultListResult] operation results.
1277
+ #
1278
+ def list_by_resource_group_next(next_page_link, custom_headers:nil)
1279
+ response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
1280
+ response.body unless response.nil?
1281
+ end
1282
+
1283
+ #
1284
+ # The List operation gets information about the vaults associated with the
1285
+ # subscription and within the specified resource group.
1286
+ #
1287
+ # @param next_page_link [String] The NextLink from the previous successful call
1288
+ # to List operation.
1289
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1290
+ # will be added to the HTTP request.
1291
+ #
1292
+ # @return [MsRestAzure2::AzureOperationResponse] HTTP response information.
1293
+ #
1294
+ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
1295
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
1296
+ end
1297
+
1298
+ #
1299
+ # The List operation gets information about the vaults associated with the
1300
+ # subscription and within the specified resource group.
1301
+ #
1302
+ # @param next_page_link [String] The NextLink from the previous successful call
1303
+ # to List operation.
1304
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1305
+ # to the HTTP request.
1306
+ #
1307
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1308
+ #
1309
+ def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
1310
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1311
+
1312
+
1313
+ request_headers = {}
1314
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1315
+
1316
+ # Set Headers
1317
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1318
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1319
+ path_template = '{nextLink}'
1320
+
1321
+ request_url = @base_url || @client.base_url
1322
+
1323
+ options = {
1324
+ middlewares: [[MsRest2::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1325
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1326
+ headers: request_headers.merge(custom_headers || {}),
1327
+ base_url: request_url
1328
+ }
1329
+ promise = @client.make_request_async(:get, path_template, options)
1330
+
1331
+ promise = promise.then do |result|
1332
+ http_response = result.response
1333
+ status_code = http_response.status
1334
+ response_content = http_response.body
1335
+ unless status_code == 200
1336
+ error_model = JSON.load(response_content)
1337
+ fail MsRestAzure2::AzureOperationError.new(result.request, http_response, error_model)
1338
+ end
1339
+
1340
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1341
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1342
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1343
+ # Deserialize Response
1344
+ if status_code == 200
1345
+ begin
1346
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1347
+ result_mapper = Azure::KeyVault2::Mgmt::V2016_10_01::Models::VaultListResult.mapper()
1348
+ result.body = @client.deserialize(result_mapper, parsed_response)
1349
+ rescue Exception => e
1350
+ fail MsRest2::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1351
+ end
1352
+ end
1353
+
1354
+ result
1355
+ end
1356
+
1357
+ promise.execute
1358
+ end
1359
+
1360
+ #
1361
+ # The List operation gets information about the vaults associated with the
1362
+ # subscription.
1363
+ #
1364
+ # @param next_page_link [String] The NextLink from the previous successful call
1365
+ # to List operation.
1366
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1367
+ # will be added to the HTTP request.
1368
+ #
1369
+ # @return [VaultListResult] operation results.
1370
+ #
1371
+ def list_by_subscription_next(next_page_link, custom_headers:nil)
1372
+ response = list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
1373
+ response.body unless response.nil?
1374
+ end
1375
+
1376
+ #
1377
+ # The List operation gets information about the vaults associated with the
1378
+ # subscription.
1379
+ #
1380
+ # @param next_page_link [String] The NextLink from the previous successful call
1381
+ # to List operation.
1382
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1383
+ # will be added to the HTTP request.
1384
+ #
1385
+ # @return [MsRestAzure2::AzureOperationResponse] HTTP response information.
1386
+ #
1387
+ def list_by_subscription_next_with_http_info(next_page_link, custom_headers:nil)
1388
+ list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
1389
+ end
1390
+
1391
+ #
1392
+ # The List operation gets information about the vaults associated with the
1393
+ # subscription.
1394
+ #
1395
+ # @param next_page_link [String] The NextLink from the previous successful call
1396
+ # to List operation.
1397
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1398
+ # to the HTTP request.
1399
+ #
1400
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1401
+ #
1402
+ def list_by_subscription_next_async(next_page_link, custom_headers:nil)
1403
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1404
+
1405
+
1406
+ request_headers = {}
1407
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1408
+
1409
+ # Set Headers
1410
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1411
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1412
+ path_template = '{nextLink}'
1413
+
1414
+ request_url = @base_url || @client.base_url
1415
+
1416
+ options = {
1417
+ middlewares: [[MsRest2::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1418
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1419
+ headers: request_headers.merge(custom_headers || {}),
1420
+ base_url: request_url
1421
+ }
1422
+ promise = @client.make_request_async(:get, path_template, options)
1423
+
1424
+ promise = promise.then do |result|
1425
+ http_response = result.response
1426
+ status_code = http_response.status
1427
+ response_content = http_response.body
1428
+ unless status_code == 200
1429
+ error_model = JSON.load(response_content)
1430
+ fail MsRestAzure2::AzureOperationError.new(result.request, http_response, error_model)
1431
+ end
1432
+
1433
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1434
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1435
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1436
+ # Deserialize Response
1437
+ if status_code == 200
1438
+ begin
1439
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1440
+ result_mapper = Azure::KeyVault2::Mgmt::V2016_10_01::Models::VaultListResult.mapper()
1441
+ result.body = @client.deserialize(result_mapper, parsed_response)
1442
+ rescue Exception => e
1443
+ fail MsRest2::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1444
+ end
1445
+ end
1446
+
1447
+ result
1448
+ end
1449
+
1450
+ promise.execute
1451
+ end
1452
+
1453
+ #
1454
+ # Gets information about the deleted vaults in a subscription.
1455
+ #
1456
+ # @param next_page_link [String] The NextLink from the previous successful call
1457
+ # to List operation.
1458
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1459
+ # will be added to the HTTP request.
1460
+ #
1461
+ # @return [DeletedVaultListResult] operation results.
1462
+ #
1463
+ def list_deleted_next(next_page_link, custom_headers:nil)
1464
+ response = list_deleted_next_async(next_page_link, custom_headers:custom_headers).value!
1465
+ response.body unless response.nil?
1466
+ end
1467
+
1468
+ #
1469
+ # Gets information about the deleted vaults in a subscription.
1470
+ #
1471
+ # @param next_page_link [String] The NextLink from the previous successful call
1472
+ # to List operation.
1473
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1474
+ # will be added to the HTTP request.
1475
+ #
1476
+ # @return [MsRestAzure2::AzureOperationResponse] HTTP response information.
1477
+ #
1478
+ def list_deleted_next_with_http_info(next_page_link, custom_headers:nil)
1479
+ list_deleted_next_async(next_page_link, custom_headers:custom_headers).value!
1480
+ end
1481
+
1482
+ #
1483
+ # Gets information about the deleted vaults in a subscription.
1484
+ #
1485
+ # @param next_page_link [String] The NextLink from the previous successful call
1486
+ # to List operation.
1487
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1488
+ # to the HTTP request.
1489
+ #
1490
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1491
+ #
1492
+ def list_deleted_next_async(next_page_link, custom_headers:nil)
1493
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1494
+
1495
+
1496
+ request_headers = {}
1497
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1498
+
1499
+ # Set Headers
1500
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1501
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1502
+ path_template = '{nextLink}'
1503
+
1504
+ request_url = @base_url || @client.base_url
1505
+
1506
+ options = {
1507
+ middlewares: [[MsRest2::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1508
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1509
+ headers: request_headers.merge(custom_headers || {}),
1510
+ base_url: request_url
1511
+ }
1512
+ promise = @client.make_request_async(:get, path_template, options)
1513
+
1514
+ promise = promise.then do |result|
1515
+ http_response = result.response
1516
+ status_code = http_response.status
1517
+ response_content = http_response.body
1518
+ unless status_code == 200
1519
+ error_model = JSON.load(response_content)
1520
+ fail MsRestAzure2::AzureOperationError.new(result.request, http_response, error_model)
1521
+ end
1522
+
1523
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1524
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1525
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1526
+ # Deserialize Response
1527
+ if status_code == 200
1528
+ begin
1529
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1530
+ result_mapper = Azure::KeyVault2::Mgmt::V2016_10_01::Models::DeletedVaultListResult.mapper()
1531
+ result.body = @client.deserialize(result_mapper, parsed_response)
1532
+ rescue Exception => e
1533
+ fail MsRest2::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1534
+ end
1535
+ end
1536
+
1537
+ result
1538
+ end
1539
+
1540
+ promise.execute
1541
+ end
1542
+
1543
+ #
1544
+ # The List operation gets information about the vaults associated with the
1545
+ # subscription.
1546
+ #
1547
+ # @param next_page_link [String] The NextLink from the previous successful call
1548
+ # to List operation.
1549
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1550
+ # will be added to the HTTP request.
1551
+ #
1552
+ # @return [ResourceListResult] operation results.
1553
+ #
1554
+ def list_next(next_page_link, custom_headers:nil)
1555
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
1556
+ response.body unless response.nil?
1557
+ end
1558
+
1559
+ #
1560
+ # The List operation gets information about the vaults associated with the
1561
+ # subscription.
1562
+ #
1563
+ # @param next_page_link [String] The NextLink from the previous successful call
1564
+ # to List operation.
1565
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1566
+ # will be added to the HTTP request.
1567
+ #
1568
+ # @return [MsRestAzure2::AzureOperationResponse] HTTP response information.
1569
+ #
1570
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
1571
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
1572
+ end
1573
+
1574
+ #
1575
+ # The List operation gets information about the vaults associated with the
1576
+ # subscription.
1577
+ #
1578
+ # @param next_page_link [String] The NextLink from the previous successful call
1579
+ # to List operation.
1580
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1581
+ # to the HTTP request.
1582
+ #
1583
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1584
+ #
1585
+ def list_next_async(next_page_link, custom_headers:nil)
1586
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1587
+
1588
+
1589
+ request_headers = {}
1590
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1591
+
1592
+ # Set Headers
1593
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1594
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1595
+ path_template = '{nextLink}'
1596
+
1597
+ request_url = @base_url || @client.base_url
1598
+
1599
+ options = {
1600
+ middlewares: [[MsRest2::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1601
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1602
+ headers: request_headers.merge(custom_headers || {}),
1603
+ base_url: request_url
1604
+ }
1605
+ promise = @client.make_request_async(:get, path_template, options)
1606
+
1607
+ promise = promise.then do |result|
1608
+ http_response = result.response
1609
+ status_code = http_response.status
1610
+ response_content = http_response.body
1611
+ unless status_code == 200
1612
+ error_model = JSON.load(response_content)
1613
+ fail MsRestAzure2::AzureOperationError.new(result.request, http_response, error_model)
1614
+ end
1615
+
1616
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1617
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1618
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1619
+ # Deserialize Response
1620
+ if status_code == 200
1621
+ begin
1622
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1623
+ result_mapper = Azure::KeyVault2::Mgmt::V2016_10_01::Models::ResourceListResult.mapper()
1624
+ result.body = @client.deserialize(result_mapper, parsed_response)
1625
+ rescue Exception => e
1626
+ fail MsRest2::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1627
+ end
1628
+ end
1629
+
1630
+ result
1631
+ end
1632
+
1633
+ promise.execute
1634
+ end
1635
+
1636
+ #
1637
+ # The List operation gets information about the vaults associated with the
1638
+ # subscription and within the specified resource group.
1639
+ #
1640
+ # @param resource_group_name [String] The name of the Resource Group to which
1641
+ # the vault belongs.
1642
+ # @param top [Integer] Maximum number of results to return.
1643
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1644
+ # will be added to the HTTP request.
1645
+ #
1646
+ # @return [VaultListResult] which provide lazy access to pages of the response.
1647
+ #
1648
+ def list_by_resource_group_as_lazy(resource_group_name, top:nil, custom_headers:nil)
1649
+ response = list_by_resource_group_async(resource_group_name, top:top, custom_headers:custom_headers).value!
1650
+ unless response.nil?
1651
+ page = response.body
1652
+ page.next_method = Proc.new do |next_page_link|
1653
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
1654
+ end
1655
+ page
1656
+ end
1657
+ end
1658
+
1659
+ #
1660
+ # The List operation gets information about the vaults associated with the
1661
+ # subscription.
1662
+ #
1663
+ # @param top [Integer] Maximum number of results to return.
1664
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1665
+ # will be added to the HTTP request.
1666
+ #
1667
+ # @return [VaultListResult] which provide lazy access to pages of the response.
1668
+ #
1669
+ def list_by_subscription_as_lazy(top:nil, custom_headers:nil)
1670
+ response = list_by_subscription_async(top:top, custom_headers:custom_headers).value!
1671
+ unless response.nil?
1672
+ page = response.body
1673
+ page.next_method = Proc.new do |next_page_link|
1674
+ list_by_subscription_next_async(next_page_link, custom_headers:custom_headers)
1675
+ end
1676
+ page
1677
+ end
1678
+ end
1679
+
1680
+ #
1681
+ # Gets information about the deleted vaults in a subscription.
1682
+ #
1683
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1684
+ # will be added to the HTTP request.
1685
+ #
1686
+ # @return [DeletedVaultListResult] which provide lazy access to pages of the
1687
+ # response.
1688
+ #
1689
+ def list_deleted_as_lazy(custom_headers:nil)
1690
+ response = list_deleted_async(custom_headers:custom_headers).value!
1691
+ unless response.nil?
1692
+ page = response.body
1693
+ page.next_method = Proc.new do |next_page_link|
1694
+ list_deleted_next_async(next_page_link, custom_headers:custom_headers)
1695
+ end
1696
+ page
1697
+ end
1698
+ end
1699
+
1700
+ #
1701
+ # The List operation gets information about the vaults associated with the
1702
+ # subscription.
1703
+ #
1704
+ # @param top [Integer] Maximum number of results to return.
1705
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1706
+ # will be added to the HTTP request.
1707
+ #
1708
+ # @return [ResourceListResult] which provide lazy access to pages of the
1709
+ # response.
1710
+ #
1711
+ def list_as_lazy(top:nil, custom_headers:nil)
1712
+ response = list_async(top:top, custom_headers:custom_headers).value!
1713
+ unless response.nil?
1714
+ page = response.body
1715
+ page.next_method = Proc.new do |next_page_link|
1716
+ list_next_async(next_page_link, custom_headers:custom_headers)
1717
+ end
1718
+ page
1719
+ end
1720
+ end
1721
+
1722
+ end
1723
+ end