azure_mgmt_network 0.3.1 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (284) hide show
  1. checksums.yaml +5 -13
  2. data/azure_mgmt_network.gemspec +4 -5
  3. data/lib/azure_mgmt_network.rb +3 -201
  4. data/lib/generated/azure_mgmt_network.rb +175 -0
  5. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/application_gateways.rb +158 -59
  6. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/express_route_circuit_authorizations.rb +92 -42
  7. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/express_route_circuit_peerings.rb +91 -42
  8. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/express_route_circuits.rb +210 -92
  9. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/express_route_service_providers.rb +32 -11
  10. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/load_balancers.rb +120 -53
  11. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/local_network_gateways.rb +91 -42
  12. data/lib/generated/azure_mgmt_network/models/address_space.rb +53 -0
  13. data/lib/generated/azure_mgmt_network/models/application_gateway.rb +326 -0
  14. data/lib/generated/azure_mgmt_network/models/application_gateway_backend_address.rb +54 -0
  15. data/lib/generated/azure_mgmt_network/models/application_gateway_backend_address_pool.rb +112 -0
  16. data/lib/generated/azure_mgmt_network/models/application_gateway_backend_http_settings.rb +128 -0
  17. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/models/application_gateway_cookie_based_affinity.rb +0 -0
  18. data/lib/generated/azure_mgmt_network/models/application_gateway_frontend_ipconfiguration.rb +120 -0
  19. data/lib/generated/azure_mgmt_network/models/application_gateway_frontend_port.rb +84 -0
  20. data/lib/generated/azure_mgmt_network/models/application_gateway_http_listener.rb +142 -0
  21. data/lib/generated/azure_mgmt_network/models/application_gateway_ipconfiguration.rb +87 -0
  22. data/lib/generated/azure_mgmt_network/models/application_gateway_list_result.rb +94 -0
  23. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/models/application_gateway_operational_state.rb +0 -0
  24. data/lib/generated/azure_mgmt_network/models/application_gateway_path_rule.rb +115 -0
  25. data/lib/generated/azure_mgmt_network/models/application_gateway_probe.rb +135 -0
  26. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/models/application_gateway_protocol.rb +0 -0
  27. data/lib/generated/azure_mgmt_network/models/application_gateway_request_routing_rule.rb +133 -0
  28. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/models/application_gateway_request_routing_rule_type.rb +0 -0
  29. data/lib/generated/azure_mgmt_network/models/application_gateway_sku.rb +68 -0
  30. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/models/application_gateway_sku_name.rb +0 -0
  31. data/lib/generated/azure_mgmt_network/models/application_gateway_ssl_certificate.rb +104 -0
  32. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/models/application_gateway_tier.rb +0 -0
  33. data/lib/generated/azure_mgmt_network/models/application_gateway_url_path_map.rb +117 -0
  34. data/lib/generated/azure_mgmt_network/models/authorization_list_result.rb +95 -0
  35. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/models/authorization_use_status.rb +0 -0
  36. data/lib/generated/azure_mgmt_network/models/azure_async_operation_result.rb +63 -0
  37. data/lib/generated/azure_mgmt_network/models/backend_address_pool.rb +127 -0
  38. data/lib/generated/azure_mgmt_network/models/bgp_settings.rb +66 -0
  39. data/lib/generated/azure_mgmt_network/models/connection_reset_shared_key.rb +45 -0
  40. data/lib/generated/azure_mgmt_network/models/connection_shared_key.rb +44 -0
  41. data/lib/generated/azure_mgmt_network/models/connection_shared_key_result.rb +44 -0
  42. data/lib/generated/azure_mgmt_network/models/dhcp_options.rb +53 -0
  43. data/lib/generated/azure_mgmt_network/models/dns_name_availability_result.rb +44 -0
  44. data/lib/generated/azure_mgmt_network/models/effective_network_security_group.rb +76 -0
  45. data/lib/generated/azure_mgmt_network/models/effective_network_security_group_association.rb +56 -0
  46. data/lib/generated/azure_mgmt_network/models/effective_network_security_group_list_result.rb +95 -0
  47. data/lib/generated/azure_mgmt_network/models/effective_network_security_rules.rb +162 -0
  48. data/lib/generated/azure_mgmt_network/models/effective_route.rb +124 -0
  49. data/lib/generated/azure_mgmt_network/models/effective_route_list_result.rb +93 -0
  50. data/lib/generated/azure_mgmt_network/models/effective_route_source.rb +18 -0
  51. data/lib/generated/azure_mgmt_network/models/effective_route_state.rb +16 -0
  52. data/lib/generated/azure_mgmt_network/models/error.rb +92 -0
  53. data/lib/generated/azure_mgmt_network/models/error_details.rb +64 -0
  54. data/lib/generated/azure_mgmt_network/models/express_route_circuit.rb +215 -0
  55. data/lib/generated/azure_mgmt_network/models/express_route_circuit_arp_table.rb +74 -0
  56. data/lib/generated/azure_mgmt_network/models/express_route_circuit_authorization.rb +95 -0
  57. data/lib/generated/azure_mgmt_network/models/express_route_circuit_list_result.rb +94 -0
  58. data/lib/generated/azure_mgmt_network/models/express_route_circuit_peering.rb +200 -0
  59. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/models/express_route_circuit_peering_advertised_public_prefix_state.rb +0 -0
  60. data/lib/generated/azure_mgmt_network/models/express_route_circuit_peering_config.rb +85 -0
  61. data/lib/generated/azure_mgmt_network/models/express_route_circuit_peering_list_result.rb +95 -0
  62. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/models/express_route_circuit_peering_state.rb +0 -0
  63. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/models/express_route_circuit_peering_type.rb +0 -0
  64. data/lib/generated/azure_mgmt_network/models/express_route_circuit_routes_table.rb +84 -0
  65. data/lib/generated/azure_mgmt_network/models/express_route_circuit_routes_table_summary.rb +87 -0
  66. data/lib/generated/azure_mgmt_network/models/express_route_circuit_service_provider_properties.rb +65 -0
  67. data/lib/generated/azure_mgmt_network/models/express_route_circuit_sku.rb +66 -0
  68. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/models/express_route_circuit_sku_family.rb +0 -0
  69. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/models/express_route_circuit_sku_tier.rb +0 -0
  70. data/lib/generated/azure_mgmt_network/models/express_route_circuit_stats.rb +74 -0
  71. data/lib/generated/azure_mgmt_network/models/express_route_circuits_arp_table_list_result.rb +62 -0
  72. data/lib/generated/azure_mgmt_network/models/express_route_circuits_routes_table_list_result.rb +65 -0
  73. data/lib/generated/azure_mgmt_network/models/express_route_circuits_routes_table_summary_list_result.rb +65 -0
  74. data/lib/generated/azure_mgmt_network/models/express_route_service_provider.rb +124 -0
  75. data/lib/generated/azure_mgmt_network/models/express_route_service_provider_bandwidths_offered.rb +55 -0
  76. data/lib/generated/azure_mgmt_network/models/express_route_service_provider_list_result.rb +94 -0
  77. data/lib/generated/azure_mgmt_network/models/frontend_ipconfiguration.rb +199 -0
  78. data/lib/generated/azure_mgmt_network/models/inbound_nat_pool.rb +140 -0
  79. data/lib/generated/azure_mgmt_network/models/inbound_nat_rule.rb +169 -0
  80. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/models/ipallocation_method.rb +0 -0
  81. data/lib/generated/azure_mgmt_network/models/ipconfiguration.rb +119 -0
  82. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/models/ipversion.rb +0 -0
  83. data/lib/generated/azure_mgmt_network/models/load_balancer.rb +239 -0
  84. data/lib/generated/azure_mgmt_network/models/load_balancer_list_result.rb +94 -0
  85. data/lib/generated/azure_mgmt_network/models/load_balancing_rule.rb +191 -0
  86. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/models/load_distribution.rb +0 -0
  87. data/lib/generated/azure_mgmt_network/models/local_network_gateway.rb +143 -0
  88. data/lib/generated/azure_mgmt_network/models/local_network_gateway_list_result.rb +94 -0
  89. data/lib/generated/azure_mgmt_network/models/network_interface.rb +197 -0
  90. data/lib/generated/azure_mgmt_network/models/network_interface_dns_settings.rb +99 -0
  91. data/lib/generated/azure_mgmt_network/models/network_interface_ipconfiguration.rb +195 -0
  92. data/lib/generated/azure_mgmt_network/models/network_interface_list_result.rb +94 -0
  93. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/models/network_operation_status.rb +0 -0
  94. data/lib/generated/azure_mgmt_network/models/network_security_group.rb +188 -0
  95. data/lib/generated/azure_mgmt_network/models/network_security_group_list_result.rb +94 -0
  96. data/lib/generated/azure_mgmt_network/models/outbound_nat_rule.rb +117 -0
  97. data/lib/generated/azure_mgmt_network/models/probe.rb +159 -0
  98. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/models/probe_protocol.rb +0 -0
  99. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/models/processor_architecture.rb +0 -0
  100. data/lib/generated/azure_mgmt_network/models/public_ipaddress.rb +177 -0
  101. data/lib/generated/azure_mgmt_network/models/public_ipaddress_dns_settings.rb +73 -0
  102. data/lib/generated/azure_mgmt_network/models/public_ipaddress_list_result.rb +94 -0
  103. data/lib/generated/azure_mgmt_network/models/route.rb +110 -0
  104. data/lib/generated/azure_mgmt_network/models/route_list_result.rb +93 -0
  105. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/models/route_next_hop_type.rb +0 -0
  106. data/lib/generated/azure_mgmt_network/models/route_table.rb +137 -0
  107. data/lib/generated/azure_mgmt_network/models/route_table_list_result.rb +94 -0
  108. data/lib/generated/azure_mgmt_network/models/security_rule.rb +185 -0
  109. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/models/security_rule_access.rb +0 -0
  110. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/models/security_rule_direction.rb +0 -0
  111. data/lib/generated/azure_mgmt_network/models/security_rule_list_result.rb +95 -0
  112. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/models/security_rule_protocol.rb +0 -0
  113. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/models/service_provider_provisioning_state.rb +0 -0
  114. data/lib/generated/azure_mgmt_network/models/subnet.rb +127 -0
  115. data/lib/generated/azure_mgmt_network/models/subnet_list_result.rb +94 -0
  116. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/models/transport_protocol.rb +0 -0
  117. data/lib/generated/azure_mgmt_network/models/usage.rb +78 -0
  118. data/lib/generated/azure_mgmt_network/models/usage_name.rb +55 -0
  119. data/lib/generated/azure_mgmt_network/models/usages_list_result.rb +52 -0
  120. data/lib/generated/azure_mgmt_network/models/virtual_network.rb +173 -0
  121. data/lib/generated/azure_mgmt_network/models/virtual_network_gateway.rb +213 -0
  122. data/lib/generated/azure_mgmt_network/models/virtual_network_gateway_connection.rb +239 -0
  123. data/lib/generated/azure_mgmt_network/models/virtual_network_gateway_connection_list_result.rb +96 -0
  124. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/models/virtual_network_gateway_connection_status.rb +0 -0
  125. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/models/virtual_network_gateway_connection_type.rb +0 -0
  126. data/lib/generated/azure_mgmt_network/models/virtual_network_gateway_ipconfiguration.rb +108 -0
  127. data/lib/generated/azure_mgmt_network/models/virtual_network_gateway_list_result.rb +94 -0
  128. data/lib/generated/azure_mgmt_network/models/virtual_network_gateway_sku.rb +68 -0
  129. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/models/virtual_network_gateway_sku_name.rb +0 -0
  130. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/models/virtual_network_gateway_sku_tier.rb +0 -0
  131. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/models/virtual_network_gateway_type.rb +0 -0
  132. data/lib/generated/azure_mgmt_network/models/virtual_network_list_result.rb +94 -0
  133. data/lib/generated/azure_mgmt_network/models/virtual_network_peering.rb +146 -0
  134. data/lib/generated/azure_mgmt_network/models/virtual_network_peering_list_result.rb +95 -0
  135. data/lib/generated/azure_mgmt_network/models/virtual_network_peering_state.rb +17 -0
  136. data/lib/generated/azure_mgmt_network/models/vpn_client_configuration.rb +84 -0
  137. data/lib/generated/azure_mgmt_network/models/vpn_client_parameters.rb +45 -0
  138. data/lib/generated/azure_mgmt_network/models/vpn_client_revoked_certificate.rb +85 -0
  139. data/lib/generated/azure_mgmt_network/models/vpn_client_root_certificate.rb +84 -0
  140. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/models/vpn_type.rb +0 -0
  141. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/module_definition.rb +0 -0
  142. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/network_interfaces.rb +913 -113
  143. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/network_management_client.rb +31 -25
  144. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/network_security_groups.rb +122 -53
  145. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/public_ipaddresses.rb +120 -53
  146. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/route_tables.rb +118 -53
  147. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/routes.rb +90 -42
  148. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/security_rules.rb +94 -42
  149. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/subnets.rb +94 -46
  150. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/usages.rb +4 -94
  151. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/version.rb +1 -1
  152. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/virtual_network_gateway_connections.rb +164 -86
  153. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/virtual_network_gateways.rb +146 -70
  154. data/lib/generated/azure_mgmt_network/virtual_network_peerings.rb +654 -0
  155. data/lib/{azure_mgmt_network → generated/azure_mgmt_network}/virtual_networks.rb +123 -58
  156. metadata +173 -221
  157. data/lib/azure_mgmt_network/models/address_space.rb +0 -58
  158. data/lib/azure_mgmt_network/models/application_gateway.rb +0 -102
  159. data/lib/azure_mgmt_network/models/application_gateway_backend_address.rb +0 -65
  160. data/lib/azure_mgmt_network/models/application_gateway_backend_address_pool.rb +0 -88
  161. data/lib/azure_mgmt_network/models/application_gateway_backend_address_pool_properties_format.rb +0 -119
  162. data/lib/azure_mgmt_network/models/application_gateway_backend_http_settings.rb +0 -88
  163. data/lib/azure_mgmt_network/models/application_gateway_backend_http_settings_properties_format.rb +0 -122
  164. data/lib/azure_mgmt_network/models/application_gateway_frontend_ipconfiguration.rb +0 -89
  165. data/lib/azure_mgmt_network/models/application_gateway_frontend_ipconfiguration_properties_format.rb +0 -114
  166. data/lib/azure_mgmt_network/models/application_gateway_frontend_port.rb +0 -88
  167. data/lib/azure_mgmt_network/models/application_gateway_frontend_port_properties_format.rb +0 -68
  168. data/lib/azure_mgmt_network/models/application_gateway_http_listener.rb +0 -88
  169. data/lib/azure_mgmt_network/models/application_gateway_http_listener_properties_format.rb +0 -141
  170. data/lib/azure_mgmt_network/models/application_gateway_ipconfiguration.rb +0 -88
  171. data/lib/azure_mgmt_network/models/application_gateway_ipconfiguration_properties_format.rb +0 -75
  172. data/lib/azure_mgmt_network/models/application_gateway_list_result.rb +0 -86
  173. data/lib/azure_mgmt_network/models/application_gateway_path_rule.rb +0 -88
  174. data/lib/azure_mgmt_network/models/application_gateway_path_rule_properties_format.rb +0 -101
  175. data/lib/azure_mgmt_network/models/application_gateway_probe.rb +0 -88
  176. data/lib/azure_mgmt_network/models/application_gateway_probe_properties_format.rb +0 -118
  177. data/lib/azure_mgmt_network/models/application_gateway_properties_format.rb +0 -408
  178. data/lib/azure_mgmt_network/models/application_gateway_request_routing_rule.rb +0 -88
  179. data/lib/azure_mgmt_network/models/application_gateway_request_routing_rule_properties_format.rb +0 -139
  180. data/lib/azure_mgmt_network/models/application_gateway_sku.rb +0 -86
  181. data/lib/azure_mgmt_network/models/application_gateway_ssl_certificate.rb +0 -88
  182. data/lib/azure_mgmt_network/models/application_gateway_ssl_certificate_properties_format.rb +0 -85
  183. data/lib/azure_mgmt_network/models/application_gateway_url_path_map.rb +0 -88
  184. data/lib/azure_mgmt_network/models/application_gateway_url_path_map_properties_format.rb +0 -122
  185. data/lib/azure_mgmt_network/models/authorization_list_result.rb +0 -87
  186. data/lib/azure_mgmt_network/models/authorization_properties_format.rb +0 -79
  187. data/lib/azure_mgmt_network/models/azure_async_operation_result.rb +0 -83
  188. data/lib/azure_mgmt_network/models/backend_address_pool.rb +0 -88
  189. data/lib/azure_mgmt_network/models/backend_address_pool_properties_format.rb +0 -135
  190. data/lib/azure_mgmt_network/models/bgp_settings.rb +0 -78
  191. data/lib/azure_mgmt_network/models/connection_reset_shared_key.rb +0 -58
  192. data/lib/azure_mgmt_network/models/connection_shared_key.rb +0 -56
  193. data/lib/azure_mgmt_network/models/connection_shared_key_result.rb +0 -56
  194. data/lib/azure_mgmt_network/models/dhcp_options.rb +0 -58
  195. data/lib/azure_mgmt_network/models/dns_name_availability_result.rb +0 -56
  196. data/lib/azure_mgmt_network/models/error.rb +0 -112
  197. data/lib/azure_mgmt_network/models/error_details.rb +0 -74
  198. data/lib/azure_mgmt_network/models/express_route_circuit.rb +0 -118
  199. data/lib/azure_mgmt_network/models/express_route_circuit_arp_table.rb +0 -84
  200. data/lib/azure_mgmt_network/models/express_route_circuit_authorization.rb +0 -88
  201. data/lib/azure_mgmt_network/models/express_route_circuit_list_result.rb +0 -86
  202. data/lib/azure_mgmt_network/models/express_route_circuit_peering.rb +0 -88
  203. data/lib/azure_mgmt_network/models/express_route_circuit_peering_config.rb +0 -92
  204. data/lib/azure_mgmt_network/models/express_route_circuit_peering_list_result.rb +0 -87
  205. data/lib/azure_mgmt_network/models/express_route_circuit_peering_properties_format.rb +0 -194
  206. data/lib/azure_mgmt_network/models/express_route_circuit_properties_format.rb +0 -188
  207. data/lib/azure_mgmt_network/models/express_route_circuit_routes_table.rb +0 -93
  208. data/lib/azure_mgmt_network/models/express_route_circuit_routes_table_summary.rb +0 -97
  209. data/lib/azure_mgmt_network/models/express_route_circuit_service_provider_properties.rb +0 -76
  210. data/lib/azure_mgmt_network/models/express_route_circuit_sku.rb +0 -83
  211. data/lib/azure_mgmt_network/models/express_route_circuit_stats.rb +0 -87
  212. data/lib/azure_mgmt_network/models/express_route_circuits_arp_table_list_result.rb +0 -85
  213. data/lib/azure_mgmt_network/models/express_route_circuits_routes_table_list_result.rb +0 -88
  214. data/lib/azure_mgmt_network/models/express_route_circuits_routes_table_summary_list_result.rb +0 -88
  215. data/lib/azure_mgmt_network/models/express_route_service_provider.rb +0 -92
  216. data/lib/azure_mgmt_network/models/express_route_service_provider_bandwidths_offered.rb +0 -67
  217. data/lib/azure_mgmt_network/models/express_route_service_provider_list_result.rb +0 -86
  218. data/lib/azure_mgmt_network/models/express_route_service_provider_properties_format.rb +0 -97
  219. data/lib/azure_mgmt_network/models/frontend_ipconfiguration.rb +0 -88
  220. data/lib/azure_mgmt_network/models/frontend_ipconfiguration_properties_format.rb +0 -237
  221. data/lib/azure_mgmt_network/models/inbound_nat_pool.rb +0 -88
  222. data/lib/azure_mgmt_network/models/inbound_nat_pool_properties_format.rb +0 -134
  223. data/lib/azure_mgmt_network/models/inbound_nat_rule.rb +0 -88
  224. data/lib/azure_mgmt_network/models/inbound_nat_rule_properties_format.rb +0 -162
  225. data/lib/azure_mgmt_network/models/ipconfiguration.rb +0 -88
  226. data/lib/azure_mgmt_network/models/ipconfiguration_properties_format.rb +0 -113
  227. data/lib/azure_mgmt_network/models/load_balancer.rb +0 -102
  228. data/lib/azure_mgmt_network/models/load_balancer_list_result.rb +0 -86
  229. data/lib/azure_mgmt_network/models/load_balancer_properties_format.rb +0 -278
  230. data/lib/azure_mgmt_network/models/load_balancing_rule.rb +0 -88
  231. data/lib/azure_mgmt_network/models/load_balancing_rule_properties_format.rb +0 -195
  232. data/lib/azure_mgmt_network/models/local_network_gateway.rb +0 -102
  233. data/lib/azure_mgmt_network/models/local_network_gateway_list_result.rb +0 -86
  234. data/lib/azure_mgmt_network/models/local_network_gateway_properties_format.rb +0 -107
  235. data/lib/azure_mgmt_network/models/network_interface.rb +0 -102
  236. data/lib/azure_mgmt_network/models/network_interface_dns_settings.rb +0 -94
  237. data/lib/azure_mgmt_network/models/network_interface_ipconfiguration.rb +0 -88
  238. data/lib/azure_mgmt_network/models/network_interface_ipconfiguration_properties_format.rb +0 -218
  239. data/lib/azure_mgmt_network/models/network_interface_list_result.rb +0 -86
  240. data/lib/azure_mgmt_network/models/network_interface_properties_format.rb +0 -176
  241. data/lib/azure_mgmt_network/models/network_security_group.rb +0 -102
  242. data/lib/azure_mgmt_network/models/network_security_group_list_result.rb +0 -86
  243. data/lib/azure_mgmt_network/models/network_security_group_properties_format.rb +0 -189
  244. data/lib/azure_mgmt_network/models/outbound_nat_rule.rb +0 -88
  245. data/lib/azure_mgmt_network/models/outbound_nat_rule_properties_format.rb +0 -117
  246. data/lib/azure_mgmt_network/models/probe.rb +0 -88
  247. data/lib/azure_mgmt_network/models/probe_properties_format.rb +0 -156
  248. data/lib/azure_mgmt_network/models/public_ipaddress.rb +0 -102
  249. data/lib/azure_mgmt_network/models/public_ipaddress_dns_settings.rb +0 -83
  250. data/lib/azure_mgmt_network/models/public_ipaddress_list_result.rb +0 -86
  251. data/lib/azure_mgmt_network/models/public_ipaddress_properties_format.rb +0 -146
  252. data/lib/azure_mgmt_network/models/route.rb +0 -88
  253. data/lib/azure_mgmt_network/models/route_list_result.rb +0 -85
  254. data/lib/azure_mgmt_network/models/route_properties_format.rb +0 -94
  255. data/lib/azure_mgmt_network/models/route_table.rb +0 -102
  256. data/lib/azure_mgmt_network/models/route_table_list_result.rb +0 -86
  257. data/lib/azure_mgmt_network/models/route_table_properties_format.rb +0 -116
  258. data/lib/azure_mgmt_network/models/security_rule.rb +0 -88
  259. data/lib/azure_mgmt_network/models/security_rule_list_result.rb +0 -87
  260. data/lib/azure_mgmt_network/models/security_rule_properties_format.rb +0 -176
  261. data/lib/azure_mgmt_network/models/subnet.rb +0 -88
  262. data/lib/azure_mgmt_network/models/subnet_list_result.rb +0 -86
  263. data/lib/azure_mgmt_network/models/subnet_properties_format.rb +0 -130
  264. data/lib/azure_mgmt_network/models/usage.rb +0 -96
  265. data/lib/azure_mgmt_network/models/usage_name.rb +0 -66
  266. data/lib/azure_mgmt_network/models/usages_list_result.rb +0 -76
  267. data/lib/azure_mgmt_network/models/virtual_network.rb +0 -102
  268. data/lib/azure_mgmt_network/models/virtual_network_gateway.rb +0 -102
  269. data/lib/azure_mgmt_network/models/virtual_network_gateway_connection.rb +0 -102
  270. data/lib/azure_mgmt_network/models/virtual_network_gateway_connection_list_result.rb +0 -87
  271. data/lib/azure_mgmt_network/models/virtual_network_gateway_connection_properties_format.rb +0 -218
  272. data/lib/azure_mgmt_network/models/virtual_network_gateway_ipconfiguration.rb +0 -88
  273. data/lib/azure_mgmt_network/models/virtual_network_gateway_ipconfiguration_properties_format.rb +0 -114
  274. data/lib/azure_mgmt_network/models/virtual_network_gateway_list_result.rb +0 -86
  275. data/lib/azure_mgmt_network/models/virtual_network_gateway_properties_format.rb +0 -205
  276. data/lib/azure_mgmt_network/models/virtual_network_gateway_sku.rb +0 -86
  277. data/lib/azure_mgmt_network/models/virtual_network_list_result.rb +0 -86
  278. data/lib/azure_mgmt_network/models/virtual_network_properties_format.rb +0 -131
  279. data/lib/azure_mgmt_network/models/vpn_client_configuration.rb +0 -125
  280. data/lib/azure_mgmt_network/models/vpn_client_parameters.rb +0 -60
  281. data/lib/azure_mgmt_network/models/vpn_client_revoked_certificate.rb +0 -88
  282. data/lib/azure_mgmt_network/models/vpn_client_revoked_certificate_properties_format.rb +0 -69
  283. data/lib/azure_mgmt_network/models/vpn_client_root_certificate.rb +0 -88
  284. data/lib/azure_mgmt_network/models/vpn_client_root_certificate_properties_format.rb +0 -66
@@ -35,26 +35,38 @@ module Azure::ARM::Network
35
35
  # @param parameters [VirtualNetworkGateway] Parameters supplied to the Begin
36
36
  # Create or update Virtual Network Gateway operation through Network resource
37
37
  # provider.
38
- # @param @client.api_version [String] Client Api Version.
39
- # @param @client.subscription_id [String] Gets subscription credentials which
40
- # uniquely identify Microsoft Azure subscription. The subscription ID forms
41
- # part of the URI for every service call.
42
- # @param @client.accept_language [String] Gets or sets the preferred language
43
- # for the response.
38
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
39
+ # will be added to the HTTP request.
40
+ #
41
+ # @return [VirtualNetworkGateway] operation results.
42
+ #
43
+ def create_or_update(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil)
44
+ response = create_or_update_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers).value!
45
+ response.body unless response.nil?
46
+ end
47
+
48
+ #
49
+ # @param resource_group_name [String] The name of the resource group.
50
+ # @param virtual_network_gateway_name [String] The name of the virtual network
51
+ # gateway.
52
+ # @param parameters [VirtualNetworkGateway] Parameters supplied to the Begin
53
+ # Create or update Virtual Network Gateway operation through Network resource
54
+ # provider.
55
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
56
+ # will be added to the HTTP request.
44
57
  #
45
58
  # @return [Concurrent::Promise] promise which provides async access to http
46
59
  # response.
47
60
  #
48
- def create_or_update(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil)
61
+ def create_or_update_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil)
49
62
  # Send request
50
63
  promise = begin_create_or_update_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers)
51
64
 
52
65
  promise = promise.then do |response|
53
66
  # Defining deserialization method.
54
67
  deserialize_method = lambda do |parsed_response|
55
- unless parsed_response.nil?
56
- parsed_response = VirtualNetworkGateway.deserialize_object(parsed_response)
57
- end
68
+ result_mapper = VirtualNetworkGateway.mapper()
69
+ parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
58
70
  end
59
71
 
60
72
  # Waiting for response.
@@ -122,22 +134,24 @@ module Azure::ARM::Network
122
134
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
123
135
  fail ArgumentError, 'virtual_network_gateway_name is nil' if virtual_network_gateway_name.nil?
124
136
  fail ArgumentError, 'parameters is nil' if parameters.nil?
125
- parameters.validate unless parameters.nil?
126
137
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
127
138
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
139
+
140
+
128
141
  request_headers = {}
129
142
 
130
143
  # Set Headers
131
144
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
132
145
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
133
146
 
134
- # Serialize Request
135
147
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
136
- unless parameters.nil?
137
- parameters = VirtualNetworkGateway.serialize_object(parameters)
138
- end
139
- request_content = parameters != nil ? JSON.generate(parameters, quirks_mode: true) : nil
140
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworkgateways/{virtualNetworkGatewayName}'
148
+
149
+ # Serialize Request
150
+ request_mapper = VirtualNetworkGateway.mapper()
151
+ request_content = @client.serialize(request_mapper, parameters, 'parameters')
152
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
153
+
154
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'
141
155
  options = {
142
156
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
143
157
  path_params: {'resourceGroupName' => resource_group_name,'virtualNetworkGatewayName' => virtual_network_gateway_name,'subscriptionId' => @client.subscription_id},
@@ -168,10 +182,8 @@ module Azure::ARM::Network
168
182
  if status_code == 200
169
183
  begin
170
184
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
171
- unless parsed_response.nil?
172
- parsed_response = VirtualNetworkGateway.deserialize_object(parsed_response)
173
- end
174
- result.body = parsed_response
185
+ result_mapper = VirtualNetworkGateway.mapper()
186
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
175
187
  rescue Exception => e
176
188
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
177
189
  end
@@ -180,10 +192,8 @@ module Azure::ARM::Network
180
192
  if status_code == 201
181
193
  begin
182
194
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
183
- unless parsed_response.nil?
184
- parsed_response = VirtualNetworkGateway.deserialize_object(parsed_response)
185
- end
186
- result.body = parsed_response
195
+ result_mapper = VirtualNetworkGateway.mapper()
196
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
187
197
  rescue Exception => e
188
198
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
189
199
  end
@@ -245,12 +255,14 @@ module Azure::ARM::Network
245
255
  fail ArgumentError, 'virtual_network_gateway_name is nil' if virtual_network_gateway_name.nil?
246
256
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
247
257
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
258
+
259
+
248
260
  request_headers = {}
249
261
 
250
262
  # Set Headers
251
263
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
252
264
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
253
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworkgateways/{virtualNetworkGatewayName}'
265
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'
254
266
  options = {
255
267
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
256
268
  path_params: {'resourceGroupName' => resource_group_name,'virtualNetworkGatewayName' => virtual_network_gateway_name,'subscriptionId' => @client.subscription_id},
@@ -280,10 +292,8 @@ module Azure::ARM::Network
280
292
  if status_code == 200
281
293
  begin
282
294
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
283
- unless parsed_response.nil?
284
- parsed_response = VirtualNetworkGateway.deserialize_object(parsed_response)
285
- end
286
- result.body = parsed_response
295
+ result_mapper = VirtualNetworkGateway.mapper()
296
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
287
297
  rescue Exception => e
288
298
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
289
299
  end
@@ -302,10 +312,25 @@ module Azure::ARM::Network
302
312
  # @param resource_group_name [String] The name of the resource group.
303
313
  # @param virtual_network_gateway_name [String] The name of the virtual network
304
314
  # gateway.
315
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
316
+ # will be added to the HTTP request.
317
+ #
318
+ def delete(resource_group_name, virtual_network_gateway_name, custom_headers = nil)
319
+ response = delete_async(resource_group_name, virtual_network_gateway_name, custom_headers).value!
320
+ nil
321
+ end
322
+
323
+ #
324
+ # @param resource_group_name [String] The name of the resource group.
325
+ # @param virtual_network_gateway_name [String] The name of the virtual network
326
+ # gateway.
327
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
328
+ # will be added to the HTTP request.
329
+ #
305
330
  # @return [Concurrent::Promise] promise which provides async access to http
306
331
  # response.
307
332
  #
308
- def delete(resource_group_name, virtual_network_gateway_name, custom_headers = nil)
333
+ def delete_async(resource_group_name, virtual_network_gateway_name, custom_headers = nil)
309
334
  # Send request
310
335
  promise = begin_delete_async(resource_group_name, virtual_network_gateway_name, custom_headers)
311
336
 
@@ -314,8 +339,8 @@ module Azure::ARM::Network
314
339
  deserialize_method = lambda do |parsed_response|
315
340
  end
316
341
 
317
- # Waiting for response.
318
- @client.get_long_running_operation_result(response, deserialize_method)
342
+ # Waiting for response.
343
+ @client.get_long_running_operation_result(response, deserialize_method)
319
344
  end
320
345
 
321
346
  promise
@@ -370,12 +395,14 @@ module Azure::ARM::Network
370
395
  fail ArgumentError, 'virtual_network_gateway_name is nil' if virtual_network_gateway_name.nil?
371
396
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
372
397
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
398
+
399
+
373
400
  request_headers = {}
374
401
 
375
402
  # Set Headers
376
403
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
377
404
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
378
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworkgateways/{virtualNetworkGatewayName}'
405
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'
379
406
  options = {
380
407
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
381
408
  path_params: {'resourceGroupName' => resource_group_name,'virtualNetworkGatewayName' => virtual_network_gateway_name,'subscriptionId' => @client.subscription_id},
@@ -416,11 +443,33 @@ module Azure::ARM::Network
416
443
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
417
444
  # will be added to the HTTP request.
418
445
  #
419
- # @return [VirtualNetworkGatewayListResult] operation results.
446
+ # @return [VirtualNetworkGatewayListResult] which provide lazy access to pages
447
+ # of the response.
420
448
  #
421
- def list(resource_group_name, custom_headers = nil)
449
+ def list_as_lazy(resource_group_name, custom_headers = nil)
422
450
  response = list_async(resource_group_name, custom_headers).value!
423
- response.body unless response.nil?
451
+ unless response.nil?
452
+ page = response.body
453
+ page.next_method = Proc.new do |next_link|
454
+ list_next_async(next_link, custom_headers)
455
+ end
456
+ page
457
+ end
458
+ end
459
+
460
+ #
461
+ # The List VirtualNetworkGateways opertion retrieves all the virtual network
462
+ # gateways stored.
463
+ #
464
+ # @param resource_group_name [String] The name of the resource group.
465
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
466
+ # will be added to the HTTP request.
467
+ #
468
+ # @return [Array<VirtualNetworkGateway>] operation results.
469
+ #
470
+ def list(resource_group_name, custom_headers = nil)
471
+ first_page = list_as_lazy(resource_group_name, custom_headers)
472
+ first_page.get_all_items
424
473
  end
425
474
 
426
475
  #
@@ -451,6 +500,8 @@ module Azure::ARM::Network
451
500
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
452
501
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
453
502
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
503
+
504
+
454
505
  request_headers = {}
455
506
 
456
507
  # Set Headers
@@ -486,10 +537,8 @@ module Azure::ARM::Network
486
537
  if status_code == 200
487
538
  begin
488
539
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
489
- unless parsed_response.nil?
490
- parsed_response = VirtualNetworkGatewayListResult.deserialize_object(parsed_response)
491
- end
492
- result.body = parsed_response
540
+ result_mapper = VirtualNetworkGatewayListResult.mapper()
541
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
493
542
  rescue Exception => e
494
543
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
495
544
  end
@@ -511,23 +560,41 @@ module Azure::ARM::Network
511
560
  # gateway.
512
561
  # @param parameters [VirtualNetworkGateway] Parameters supplied to the Begin
513
562
  # Reset Virtual Network Gateway operation through Network resource provider.
563
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
564
+ # will be added to the HTTP request.
565
+ #
566
+ # @return [VirtualNetworkGateway] operation results.
567
+ #
568
+ def reset(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil)
569
+ response = reset_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers).value!
570
+ response.body unless response.nil?
571
+ end
572
+
573
+ #
574
+ # @param resource_group_name [String] The name of the resource group.
575
+ # @param virtual_network_gateway_name [String] The name of the virtual network
576
+ # gateway.
577
+ # @param parameters [VirtualNetworkGateway] Parameters supplied to the Begin
578
+ # Reset Virtual Network Gateway operation through Network resource provider.
579
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
580
+ # will be added to the HTTP request.
581
+ #
514
582
  # @return [Concurrent::Promise] promise which provides async access to http
515
583
  # response.
516
584
  #
517
- def reset(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil)
585
+ def reset_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers = nil)
518
586
  # Send request
519
587
  promise = begin_reset_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers)
520
588
 
521
589
  promise = promise.then do |response|
522
590
  # Defining deserialization method.
523
591
  deserialize_method = lambda do |parsed_response|
524
- unless parsed_response.nil?
525
- parsed_response = VirtualNetworkGateway.deserialize_object(parsed_response)
526
- end
592
+ result_mapper = VirtualNetworkGateway.mapper()
593
+ parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
527
594
  end
528
595
 
529
- # Waiting for response.
530
- @client.get_long_running_operation_result(response, deserialize_method)
596
+ # Waiting for response.
597
+ @client.get_long_running_operation_result(response, deserialize_method)
531
598
  end
532
599
 
533
600
  promise
@@ -591,22 +658,24 @@ module Azure::ARM::Network
591
658
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
592
659
  fail ArgumentError, 'virtual_network_gateway_name is nil' if virtual_network_gateway_name.nil?
593
660
  fail ArgumentError, 'parameters is nil' if parameters.nil?
594
- parameters.validate unless parameters.nil?
595
661
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
596
662
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
663
+
664
+
597
665
  request_headers = {}
598
666
 
599
667
  # Set Headers
600
668
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
601
669
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
602
670
 
603
- # Serialize Request
604
671
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
605
- unless parameters.nil?
606
- parameters = VirtualNetworkGateway.serialize_object(parameters)
607
- end
608
- request_content = parameters != nil ? JSON.generate(parameters, quirks_mode: true) : nil
609
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworkgateways/{virtualNetworkGatewayName}/reset'
672
+
673
+ # Serialize Request
674
+ request_mapper = VirtualNetworkGateway.mapper()
675
+ request_content = @client.serialize(request_mapper, parameters, 'parameters')
676
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
677
+
678
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset'
610
679
  options = {
611
680
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
612
681
  path_params: {'resourceGroupName' => resource_group_name,'virtualNetworkGatewayName' => virtual_network_gateway_name,'subscriptionId' => @client.subscription_id},
@@ -637,10 +706,8 @@ module Azure::ARM::Network
637
706
  if status_code == 200
638
707
  begin
639
708
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
640
- unless parsed_response.nil?
641
- parsed_response = VirtualNetworkGateway.deserialize_object(parsed_response)
642
- end
643
- result.body = parsed_response
709
+ result_mapper = VirtualNetworkGateway.mapper()
710
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
644
711
  rescue Exception => e
645
712
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
646
713
  end
@@ -713,22 +780,24 @@ module Azure::ARM::Network
713
780
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
714
781
  fail ArgumentError, 'virtual_network_gateway_name is nil' if virtual_network_gateway_name.nil?
715
782
  fail ArgumentError, 'parameters is nil' if parameters.nil?
716
- parameters.validate unless parameters.nil?
717
783
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
718
784
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
785
+
786
+
719
787
  request_headers = {}
720
788
 
721
789
  # Set Headers
722
790
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
723
791
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
724
792
 
725
- # Serialize Request
726
793
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
727
- unless parameters.nil?
728
- parameters = VpnClientParameters.serialize_object(parameters)
729
- end
730
- request_content = parameters != nil ? JSON.generate(parameters, quirks_mode: true) : nil
731
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworkgateways/{virtualNetworkGatewayName}/generatevpnclientpackage'
794
+
795
+ # Serialize Request
796
+ request_mapper = VpnClientParameters.mapper()
797
+ request_content = @client.serialize(request_mapper, parameters, 'parameters')
798
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
799
+
800
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage'
732
801
  options = {
733
802
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
734
803
  path_params: {'resourceGroupName' => resource_group_name,'virtualNetworkGatewayName' => virtual_network_gateway_name,'subscriptionId' => @client.subscription_id},
@@ -759,7 +828,14 @@ module Azure::ARM::Network
759
828
  if status_code == 202
760
829
  begin
761
830
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
762
- result.body = parsed_response
831
+ result_mapper = {
832
+ required: false,
833
+ serialized_name: 'parsed_response',
834
+ type: {
835
+ name: 'String'
836
+ }
837
+ }
838
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
763
839
  rescue Exception => e
764
840
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
765
841
  end
@@ -815,6 +891,8 @@ module Azure::ARM::Network
815
891
  #
816
892
  def list_next_async(next_page_link, custom_headers = nil)
817
893
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
894
+
895
+
818
896
  request_headers = {}
819
897
 
820
898
  # Set Headers
@@ -849,10 +927,8 @@ module Azure::ARM::Network
849
927
  if status_code == 200
850
928
  begin
851
929
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
852
- unless parsed_response.nil?
853
- parsed_response = VirtualNetworkGatewayListResult.deserialize_object(parsed_response)
854
- end
855
- result.body = parsed_response
930
+ result_mapper = VirtualNetworkGatewayListResult.mapper()
931
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
856
932
  rescue Exception => e
857
933
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
858
934
  end
@@ -0,0 +1,654 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ARM::Network
7
+ #
8
+ # The Microsoft Azure Network management API provides a RESTful set of web
9
+ # services that interact with Microsoft Azure Networks service to manage
10
+ # your network resrources. The API has entities that capture the
11
+ # relationship between an end user and the Microsoft Azure Networks service.
12
+ #
13
+ class VirtualNetworkPeerings
14
+ include Azure::ARM::Network::Models
15
+ include MsRestAzure
16
+
17
+ #
18
+ # Creates and initializes a new instance of the VirtualNetworkPeerings class.
19
+ # @param client service class for accessing basic functionality.
20
+ #
21
+ def initialize(client)
22
+ @client = client
23
+ end
24
+
25
+ # @return reference to the NetworkManagementClient
26
+ attr_reader :client
27
+
28
+ #
29
+ # The delete virtual network peering operation deletes the specified peering.
30
+ #
31
+ # @param resource_group_name [String] The name of the resource group.
32
+ # @param virtual_network_name [String] The name of the virtual network.
33
+ # @param virtual_network_peering_name [String] The name of the virtual network
34
+ # peering.
35
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
36
+ # will be added to the HTTP request.
37
+ #
38
+ def delete(resource_group_name, virtual_network_name, virtual_network_peering_name, custom_headers = nil)
39
+ response = delete_async(resource_group_name, virtual_network_name, virtual_network_peering_name, custom_headers).value!
40
+ nil
41
+ end
42
+
43
+ #
44
+ # @param resource_group_name [String] The name of the resource group.
45
+ # @param virtual_network_name [String] The name of the virtual network.
46
+ # @param virtual_network_peering_name [String] The name of the virtual network
47
+ # peering.
48
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
49
+ # will be added to the HTTP request.
50
+ #
51
+ # @return [Concurrent::Promise] promise which provides async access to http
52
+ # response.
53
+ #
54
+ def delete_async(resource_group_name, virtual_network_name, virtual_network_peering_name, custom_headers = nil)
55
+ # Send request
56
+ promise = begin_delete_async(resource_group_name, virtual_network_name, virtual_network_peering_name, custom_headers)
57
+
58
+ promise = promise.then do |response|
59
+ # Defining deserialization method.
60
+ deserialize_method = lambda do |parsed_response|
61
+ end
62
+
63
+ # Waiting for response.
64
+ @client.get_long_running_operation_result(response, deserialize_method)
65
+ end
66
+
67
+ promise
68
+ end
69
+
70
+ #
71
+ # The delete virtual network peering operation deletes the specified peering.
72
+ #
73
+ # @param resource_group_name [String] The name of the resource group.
74
+ # @param virtual_network_name [String] The name of the virtual network.
75
+ # @param virtual_network_peering_name [String] The name of the virtual network
76
+ # peering.
77
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
78
+ # will be added to the HTTP request.
79
+ #
80
+ #
81
+ def begin_delete(resource_group_name, virtual_network_name, virtual_network_peering_name, custom_headers = nil)
82
+ response = begin_delete_async(resource_group_name, virtual_network_name, virtual_network_peering_name, custom_headers).value!
83
+ nil
84
+ end
85
+
86
+ #
87
+ # The delete virtual network peering operation deletes the specified peering.
88
+ #
89
+ # @param resource_group_name [String] The name of the resource group.
90
+ # @param virtual_network_name [String] The name of the virtual network.
91
+ # @param virtual_network_peering_name [String] The name of the virtual network
92
+ # peering.
93
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
94
+ # will be added to the HTTP request.
95
+ #
96
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
97
+ #
98
+ def begin_delete_with_http_info(resource_group_name, virtual_network_name, virtual_network_peering_name, custom_headers = nil)
99
+ begin_delete_async(resource_group_name, virtual_network_name, virtual_network_peering_name, custom_headers).value!
100
+ end
101
+
102
+ #
103
+ # The delete virtual network peering operation deletes the specified peering.
104
+ #
105
+ # @param resource_group_name [String] The name of the resource group.
106
+ # @param virtual_network_name [String] The name of the virtual network.
107
+ # @param virtual_network_peering_name [String] The name of the virtual network
108
+ # peering.
109
+ # @param [Hash{String => String}] A hash of custom headers that will be added
110
+ # to the HTTP request.
111
+ #
112
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
113
+ #
114
+ def begin_delete_async(resource_group_name, virtual_network_name, virtual_network_peering_name, custom_headers = nil)
115
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
116
+ fail ArgumentError, 'virtual_network_name is nil' if virtual_network_name.nil?
117
+ fail ArgumentError, 'virtual_network_peering_name is nil' if virtual_network_peering_name.nil?
118
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
119
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
120
+
121
+
122
+ request_headers = {}
123
+
124
+ # Set Headers
125
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
126
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
127
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'
128
+ options = {
129
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
130
+ path_params: {'resourceGroupName' => resource_group_name,'virtualNetworkName' => virtual_network_name,'virtualNetworkPeeringName' => virtual_network_peering_name,'subscriptionId' => @client.subscription_id},
131
+ query_params: {'api-version' => @client.api_version},
132
+ headers: request_headers.merge(custom_headers || {})
133
+ }
134
+
135
+ request_url = @base_url || @client.base_url
136
+
137
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :delete, options)
138
+ promise = request.run_promise do |req|
139
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
140
+ end
141
+
142
+ promise = promise.then do |http_response|
143
+ status_code = http_response.status
144
+ response_content = http_response.body
145
+ unless status_code == 200 || status_code == 204 || status_code == 202
146
+ error_model = JSON.load(response_content)
147
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
148
+ end
149
+
150
+ # Create Result
151
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
152
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
153
+
154
+ result
155
+ end
156
+
157
+ promise.execute
158
+ end
159
+
160
+ #
161
+ # The Get virtual network peering operation retreives information about the
162
+ # specified virtual network peering.
163
+ #
164
+ # @param resource_group_name [String] The name of the resource group.
165
+ # @param virtual_network_name [String] The name of the virtual network.
166
+ # @param virtual_network_peering_name [String] The name of the virtual network
167
+ # peering.
168
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
169
+ # will be added to the HTTP request.
170
+ #
171
+ # @return [VirtualNetworkPeering] operation results.
172
+ #
173
+ def get(resource_group_name, virtual_network_name, virtual_network_peering_name, custom_headers = nil)
174
+ response = get_async(resource_group_name, virtual_network_name, virtual_network_peering_name, custom_headers).value!
175
+ response.body unless response.nil?
176
+ end
177
+
178
+ #
179
+ # The Get virtual network peering operation retreives information about the
180
+ # specified virtual network peering.
181
+ #
182
+ # @param resource_group_name [String] The name of the resource group.
183
+ # @param virtual_network_name [String] The name of the virtual network.
184
+ # @param virtual_network_peering_name [String] The name of the virtual network
185
+ # peering.
186
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
187
+ # will be added to the HTTP request.
188
+ #
189
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
190
+ #
191
+ def get_with_http_info(resource_group_name, virtual_network_name, virtual_network_peering_name, custom_headers = nil)
192
+ get_async(resource_group_name, virtual_network_name, virtual_network_peering_name, custom_headers).value!
193
+ end
194
+
195
+ #
196
+ # The Get virtual network peering operation retreives information about the
197
+ # specified virtual network peering.
198
+ #
199
+ # @param resource_group_name [String] The name of the resource group.
200
+ # @param virtual_network_name [String] The name of the virtual network.
201
+ # @param virtual_network_peering_name [String] The name of the virtual network
202
+ # peering.
203
+ # @param [Hash{String => String}] A hash of custom headers that will be added
204
+ # to the HTTP request.
205
+ #
206
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
207
+ #
208
+ def get_async(resource_group_name, virtual_network_name, virtual_network_peering_name, custom_headers = nil)
209
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
210
+ fail ArgumentError, 'virtual_network_name is nil' if virtual_network_name.nil?
211
+ fail ArgumentError, 'virtual_network_peering_name is nil' if virtual_network_peering_name.nil?
212
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
213
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
214
+
215
+
216
+ request_headers = {}
217
+
218
+ # Set Headers
219
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
220
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
221
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'
222
+ options = {
223
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
224
+ path_params: {'resourceGroupName' => resource_group_name,'virtualNetworkName' => virtual_network_name,'virtualNetworkPeeringName' => virtual_network_peering_name,'subscriptionId' => @client.subscription_id},
225
+ query_params: {'api-version' => @client.api_version},
226
+ headers: request_headers.merge(custom_headers || {})
227
+ }
228
+
229
+ request_url = @base_url || @client.base_url
230
+
231
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
232
+ promise = request.run_promise do |req|
233
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
234
+ end
235
+
236
+ promise = promise.then do |http_response|
237
+ status_code = http_response.status
238
+ response_content = http_response.body
239
+ unless status_code == 200
240
+ error_model = JSON.load(response_content)
241
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
242
+ end
243
+
244
+ # Create Result
245
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
246
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
247
+ # Deserialize Response
248
+ if status_code == 200
249
+ begin
250
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
251
+ result_mapper = VirtualNetworkPeering.mapper()
252
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
253
+ rescue Exception => e
254
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
255
+ end
256
+ end
257
+
258
+ result
259
+ end
260
+
261
+ promise.execute
262
+ end
263
+
264
+ #
265
+ # The Put virtual network peering operation creates/updates a peering in the
266
+ # specified virtual network
267
+ #
268
+ # @param resource_group_name [String] The name of the resource group.
269
+ # @param virtual_network_name [String] The name of the virtual network.
270
+ # @param virtual_network_peering_name [String] The name of the peering.
271
+ # @param virtual_network_peering_parameters [VirtualNetworkPeering] Parameters
272
+ # supplied to the create/update virtual network peering operation
273
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
274
+ # will be added to the HTTP request.
275
+ #
276
+ # @return [VirtualNetworkPeering] operation results.
277
+ #
278
+ def create_or_update(resource_group_name, virtual_network_name, virtual_network_peering_name, virtual_network_peering_parameters, custom_headers = nil)
279
+ response = create_or_update_async(resource_group_name, virtual_network_name, virtual_network_peering_name, virtual_network_peering_parameters, custom_headers).value!
280
+ response.body unless response.nil?
281
+ end
282
+
283
+ #
284
+ # @param resource_group_name [String] The name of the resource group.
285
+ # @param virtual_network_name [String] The name of the virtual network.
286
+ # @param virtual_network_peering_name [String] The name of the peering.
287
+ # @param virtual_network_peering_parameters [VirtualNetworkPeering] Parameters
288
+ # supplied to the create/update virtual network peering operation
289
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
290
+ # will be added to the HTTP request.
291
+ #
292
+ # @return [Concurrent::Promise] promise which provides async access to http
293
+ # response.
294
+ #
295
+ def create_or_update_async(resource_group_name, virtual_network_name, virtual_network_peering_name, virtual_network_peering_parameters, custom_headers = nil)
296
+ # Send request
297
+ promise = begin_create_or_update_async(resource_group_name, virtual_network_name, virtual_network_peering_name, virtual_network_peering_parameters, custom_headers)
298
+
299
+ promise = promise.then do |response|
300
+ # Defining deserialization method.
301
+ deserialize_method = lambda do |parsed_response|
302
+ result_mapper = VirtualNetworkPeering.mapper()
303
+ parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
304
+ end
305
+
306
+ # Waiting for response.
307
+ @client.get_long_running_operation_result(response, deserialize_method)
308
+ end
309
+
310
+ promise
311
+ end
312
+
313
+ #
314
+ # The Put virtual network peering operation creates/updates a peering in the
315
+ # specified virtual network
316
+ #
317
+ # @param resource_group_name [String] The name of the resource group.
318
+ # @param virtual_network_name [String] The name of the virtual network.
319
+ # @param virtual_network_peering_name [String] The name of the peering.
320
+ # @param virtual_network_peering_parameters [VirtualNetworkPeering] Parameters
321
+ # supplied to the create/update virtual network peering operation
322
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
323
+ # will be added to the HTTP request.
324
+ #
325
+ # @return [VirtualNetworkPeering] operation results.
326
+ #
327
+ def begin_create_or_update(resource_group_name, virtual_network_name, virtual_network_peering_name, virtual_network_peering_parameters, custom_headers = nil)
328
+ response = begin_create_or_update_async(resource_group_name, virtual_network_name, virtual_network_peering_name, virtual_network_peering_parameters, custom_headers).value!
329
+ response.body unless response.nil?
330
+ end
331
+
332
+ #
333
+ # The Put virtual network peering operation creates/updates a peering in the
334
+ # specified virtual network
335
+ #
336
+ # @param resource_group_name [String] The name of the resource group.
337
+ # @param virtual_network_name [String] The name of the virtual network.
338
+ # @param virtual_network_peering_name [String] The name of the peering.
339
+ # @param virtual_network_peering_parameters [VirtualNetworkPeering] Parameters
340
+ # supplied to the create/update virtual network peering operation
341
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
342
+ # will be added to the HTTP request.
343
+ #
344
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
345
+ #
346
+ def begin_create_or_update_with_http_info(resource_group_name, virtual_network_name, virtual_network_peering_name, virtual_network_peering_parameters, custom_headers = nil)
347
+ begin_create_or_update_async(resource_group_name, virtual_network_name, virtual_network_peering_name, virtual_network_peering_parameters, custom_headers).value!
348
+ end
349
+
350
+ #
351
+ # The Put virtual network peering operation creates/updates a peering in the
352
+ # specified virtual network
353
+ #
354
+ # @param resource_group_name [String] The name of the resource group.
355
+ # @param virtual_network_name [String] The name of the virtual network.
356
+ # @param virtual_network_peering_name [String] The name of the peering.
357
+ # @param virtual_network_peering_parameters [VirtualNetworkPeering] Parameters
358
+ # supplied to the create/update virtual network peering operation
359
+ # @param [Hash{String => String}] A hash of custom headers that will be added
360
+ # to the HTTP request.
361
+ #
362
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
363
+ #
364
+ def begin_create_or_update_async(resource_group_name, virtual_network_name, virtual_network_peering_name, virtual_network_peering_parameters, custom_headers = nil)
365
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
366
+ fail ArgumentError, 'virtual_network_name is nil' if virtual_network_name.nil?
367
+ fail ArgumentError, 'virtual_network_peering_name is nil' if virtual_network_peering_name.nil?
368
+ fail ArgumentError, 'virtual_network_peering_parameters is nil' if virtual_network_peering_parameters.nil?
369
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
370
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
371
+
372
+
373
+ request_headers = {}
374
+
375
+ # Set Headers
376
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
377
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
378
+
379
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
380
+
381
+ # Serialize Request
382
+ request_mapper = VirtualNetworkPeering.mapper()
383
+ request_content = @client.serialize(request_mapper, virtual_network_peering_parameters, 'virtual_network_peering_parameters')
384
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
385
+
386
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'
387
+ options = {
388
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
389
+ path_params: {'resourceGroupName' => resource_group_name,'virtualNetworkName' => virtual_network_name,'virtualNetworkPeeringName' => virtual_network_peering_name,'subscriptionId' => @client.subscription_id},
390
+ query_params: {'api-version' => @client.api_version},
391
+ body: request_content,
392
+ headers: request_headers.merge(custom_headers || {})
393
+ }
394
+
395
+ request_url = @base_url || @client.base_url
396
+
397
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :put, options)
398
+ promise = request.run_promise do |req|
399
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
400
+ end
401
+
402
+ promise = promise.then do |http_response|
403
+ status_code = http_response.status
404
+ response_content = http_response.body
405
+ unless status_code == 200 || status_code == 201
406
+ error_model = JSON.load(response_content)
407
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
408
+ end
409
+
410
+ # Create Result
411
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
412
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
413
+ # Deserialize Response
414
+ if status_code == 200
415
+ begin
416
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
417
+ result_mapper = VirtualNetworkPeering.mapper()
418
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
419
+ rescue Exception => e
420
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
421
+ end
422
+ end
423
+ # Deserialize Response
424
+ if status_code == 201
425
+ begin
426
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
427
+ result_mapper = VirtualNetworkPeering.mapper()
428
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
429
+ rescue Exception => e
430
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
431
+ end
432
+ end
433
+
434
+ result
435
+ end
436
+
437
+ promise.execute
438
+ end
439
+
440
+ #
441
+ # The List virtual network peerings opertion retrieves all the peerings in a
442
+ # virtual network.
443
+ #
444
+ # @param resource_group_name [String] The name of the resource group.
445
+ # @param virtual_network_name [String] The name of the virtual network.
446
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
447
+ # will be added to the HTTP request.
448
+ #
449
+ # @return [VirtualNetworkPeeringListResult] which provide lazy access to pages
450
+ # of the response.
451
+ #
452
+ def list_as_lazy(resource_group_name, virtual_network_name, custom_headers = nil)
453
+ response = list_async(resource_group_name, virtual_network_name, custom_headers).value!
454
+ unless response.nil?
455
+ page = response.body
456
+ page.next_method = Proc.new do |next_link|
457
+ list_next_async(next_link, custom_headers)
458
+ end
459
+ page
460
+ end
461
+ end
462
+
463
+ #
464
+ # The List virtual network peerings opertion retrieves all the peerings in a
465
+ # virtual network.
466
+ #
467
+ # @param resource_group_name [String] The name of the resource group.
468
+ # @param virtual_network_name [String] The name of the virtual network.
469
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
470
+ # will be added to the HTTP request.
471
+ #
472
+ # @return [Array<VirtualNetworkPeering>] operation results.
473
+ #
474
+ def list(resource_group_name, virtual_network_name, custom_headers = nil)
475
+ first_page = list_as_lazy(resource_group_name, virtual_network_name, custom_headers)
476
+ first_page.get_all_items
477
+ end
478
+
479
+ #
480
+ # The List virtual network peerings opertion retrieves all the peerings in a
481
+ # virtual network.
482
+ #
483
+ # @param resource_group_name [String] The name of the resource group.
484
+ # @param virtual_network_name [String] The name of the virtual network.
485
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
486
+ # will be added to the HTTP request.
487
+ #
488
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
489
+ #
490
+ def list_with_http_info(resource_group_name, virtual_network_name, custom_headers = nil)
491
+ list_async(resource_group_name, virtual_network_name, custom_headers).value!
492
+ end
493
+
494
+ #
495
+ # The List virtual network peerings opertion retrieves all the peerings in a
496
+ # virtual network.
497
+ #
498
+ # @param resource_group_name [String] The name of the resource group.
499
+ # @param virtual_network_name [String] The name of the virtual network.
500
+ # @param [Hash{String => String}] A hash of custom headers that will be added
501
+ # to the HTTP request.
502
+ #
503
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
504
+ #
505
+ def list_async(resource_group_name, virtual_network_name, custom_headers = nil)
506
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
507
+ fail ArgumentError, 'virtual_network_name is nil' if virtual_network_name.nil?
508
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
509
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
510
+
511
+
512
+ request_headers = {}
513
+
514
+ # Set Headers
515
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
516
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
517
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings'
518
+ options = {
519
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
520
+ path_params: {'resourceGroupName' => resource_group_name,'virtualNetworkName' => virtual_network_name,'subscriptionId' => @client.subscription_id},
521
+ query_params: {'api-version' => @client.api_version},
522
+ headers: request_headers.merge(custom_headers || {})
523
+ }
524
+
525
+ request_url = @base_url || @client.base_url
526
+
527
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
528
+ promise = request.run_promise do |req|
529
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
530
+ end
531
+
532
+ promise = promise.then do |http_response|
533
+ status_code = http_response.status
534
+ response_content = http_response.body
535
+ unless status_code == 200
536
+ error_model = JSON.load(response_content)
537
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
538
+ end
539
+
540
+ # Create Result
541
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
542
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
543
+ # Deserialize Response
544
+ if status_code == 200
545
+ begin
546
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
547
+ result_mapper = VirtualNetworkPeeringListResult.mapper()
548
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
549
+ rescue Exception => e
550
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
551
+ end
552
+ end
553
+
554
+ result
555
+ end
556
+
557
+ promise.execute
558
+ end
559
+
560
+ #
561
+ # The List virtual network peerings opertion retrieves all the peerings in a
562
+ # virtual network.
563
+ #
564
+ # @param next_page_link [String] The NextLink from the previous successful
565
+ # call to List operation.
566
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
567
+ # will be added to the HTTP request.
568
+ #
569
+ # @return [VirtualNetworkPeeringListResult] operation results.
570
+ #
571
+ def list_next(next_page_link, custom_headers = nil)
572
+ response = list_next_async(next_page_link, custom_headers).value!
573
+ response.body unless response.nil?
574
+ end
575
+
576
+ #
577
+ # The List virtual network peerings opertion retrieves all the peerings in a
578
+ # virtual network.
579
+ #
580
+ # @param next_page_link [String] The NextLink from the previous successful
581
+ # call to List operation.
582
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
583
+ # will be added to the HTTP request.
584
+ #
585
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
586
+ #
587
+ def list_next_with_http_info(next_page_link, custom_headers = nil)
588
+ list_next_async(next_page_link, custom_headers).value!
589
+ end
590
+
591
+ #
592
+ # The List virtual network peerings opertion retrieves all the peerings in a
593
+ # virtual network.
594
+ #
595
+ # @param next_page_link [String] The NextLink from the previous successful
596
+ # call to List operation.
597
+ # @param [Hash{String => String}] A hash of custom headers that will be added
598
+ # to the HTTP request.
599
+ #
600
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
601
+ #
602
+ def list_next_async(next_page_link, custom_headers = nil)
603
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
604
+
605
+
606
+ request_headers = {}
607
+
608
+ # Set Headers
609
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
610
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
611
+ path_template = '{nextLink}'
612
+ options = {
613
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
614
+ skip_encoding_path_params: {'nextLink' => next_page_link},
615
+ headers: request_headers.merge(custom_headers || {})
616
+ }
617
+
618
+ request_url = @base_url || @client.base_url
619
+
620
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
621
+ promise = request.run_promise do |req|
622
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
623
+ end
624
+
625
+ promise = promise.then do |http_response|
626
+ status_code = http_response.status
627
+ response_content = http_response.body
628
+ unless status_code == 200
629
+ error_model = JSON.load(response_content)
630
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
631
+ end
632
+
633
+ # Create Result
634
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
635
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
636
+ # Deserialize Response
637
+ if status_code == 200
638
+ begin
639
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
640
+ result_mapper = VirtualNetworkPeeringListResult.mapper()
641
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
642
+ rescue Exception => e
643
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
644
+ end
645
+ end
646
+
647
+ result
648
+ end
649
+
650
+ promise.execute
651
+ end
652
+
653
+ end
654
+ end