azure_mgmt_cdn 0.17.0 → 0.17.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (270) hide show
  1. checksums.yaml +5 -5
  2. data/lib/2015-06-01/generated/azure_mgmt_cdn/cdn_management_client.rb +1 -1
  3. data/lib/2015-06-01/generated/azure_mgmt_cdn/custom_domains.rb +10 -0
  4. data/lib/2015-06-01/generated/azure_mgmt_cdn/endpoints.rb +20 -0
  5. data/lib/2015-06-01/generated/azure_mgmt_cdn/models/resource.rb +9 -0
  6. data/lib/2015-06-01/generated/azure_mgmt_cdn/name_availability.rb +2 -0
  7. data/lib/2015-06-01/generated/azure_mgmt_cdn/operations.rb +2 -0
  8. data/lib/2015-06-01/generated/azure_mgmt_cdn/origins.rb +10 -0
  9. data/lib/2015-06-01/generated/azure_mgmt_cdn/profiles.rb +17 -3
  10. data/lib/2016-04-02/generated/azure_mgmt_cdn/cdn_management_client.rb +1 -1
  11. data/lib/2016-04-02/generated/azure_mgmt_cdn/custom_domains.rb +10 -0
  12. data/lib/2016-04-02/generated/azure_mgmt_cdn/endpoints.rb +20 -0
  13. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/resource.rb +9 -0
  14. data/lib/2016-04-02/generated/azure_mgmt_cdn/name_availability.rb +2 -0
  15. data/lib/2016-04-02/generated/azure_mgmt_cdn/operations.rb +2 -0
  16. data/lib/2016-04-02/generated/azure_mgmt_cdn/origins.rb +10 -0
  17. data/lib/2016-04-02/generated/azure_mgmt_cdn/profiles.rb +17 -3
  18. data/lib/2016-10-02/generated/azure_mgmt_cdn/cdn_management_client.rb +15 -1
  19. data/lib/2016-10-02/generated/azure_mgmt_cdn/custom_domains.rb +17 -3
  20. data/lib/2016-10-02/generated/azure_mgmt_cdn/edge_nodes.rb +4 -0
  21. data/lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb +31 -5
  22. data/lib/2016-10-02/generated/azure_mgmt_cdn/models/cidr_ip_address.rb +1 -1
  23. data/lib/2016-10-02/generated/azure_mgmt_cdn/models/custom_domain.rb +1 -1
  24. data/lib/2016-10-02/generated/azure_mgmt_cdn/models/custom_domain_list_result.rb +1 -1
  25. data/lib/2016-10-02/generated/azure_mgmt_cdn/models/edgenode_result.rb +1 -1
  26. data/lib/2016-10-02/generated/azure_mgmt_cdn/models/endpoint.rb +2 -2
  27. data/lib/2016-10-02/generated/azure_mgmt_cdn/models/endpoint_list_result.rb +2 -2
  28. data/lib/2016-10-02/generated/azure_mgmt_cdn/models/endpoint_update_parameters.rb +1 -1
  29. data/lib/2016-10-02/generated/azure_mgmt_cdn/models/error_response.rb +1 -1
  30. data/lib/2016-10-02/generated/azure_mgmt_cdn/models/operation_list_result.rb +1 -1
  31. data/lib/2016-10-02/generated/azure_mgmt_cdn/models/origin_list_result.rb +1 -1
  32. data/lib/2016-10-02/generated/azure_mgmt_cdn/models/profile_list_result.rb +2 -2
  33. data/lib/2016-10-02/generated/azure_mgmt_cdn/models/resource.rb +9 -0
  34. data/lib/2016-10-02/generated/azure_mgmt_cdn/models/resource_usage_list_result.rb +1 -1
  35. data/lib/2016-10-02/generated/azure_mgmt_cdn/origins.rb +8 -0
  36. data/lib/2016-10-02/generated/azure_mgmt_cdn/profiles.rb +27 -3
  37. data/lib/2017-04-02/generated/azure_mgmt_cdn/cdn_management_client.rb +5 -1
  38. data/lib/2017-04-02/generated/azure_mgmt_cdn/custom_domains.rb +17 -3
  39. data/lib/2017-04-02/generated/azure_mgmt_cdn/edge_nodes.rb +4 -0
  40. data/lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb +31 -5
  41. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/cidr_ip_address.rb +1 -1
  42. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/custom_domain.rb +1 -1
  43. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/custom_domain_list_result.rb +1 -1
  44. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/edgenode_result.rb +1 -1
  45. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/endpoint.rb +3 -3
  46. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/endpoint_list_result.rb +2 -2
  47. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/endpoint_update_parameters.rb +2 -2
  48. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/error_response.rb +1 -1
  49. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/operations_list_result.rb +1 -1
  50. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/origin_list_result.rb +1 -1
  51. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/profile_list_result.rb +2 -2
  52. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/resource.rb +9 -0
  53. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/resource_usage_list_result.rb +1 -1
  54. data/lib/2017-04-02/generated/azure_mgmt_cdn/operations.rb +4 -0
  55. data/lib/2017-04-02/generated/azure_mgmt_cdn/origins.rb +8 -0
  56. data/lib/2017-04-02/generated/azure_mgmt_cdn/profiles.rb +27 -3
  57. data/lib/2017-04-02/generated/azure_mgmt_cdn/resource_usage_operations.rb +4 -0
  58. data/lib/2017-10-12/generated/azure_mgmt_cdn.rb +23 -16
  59. data/lib/2017-10-12/generated/azure_mgmt_cdn/cdn_management_client.rb +7 -1
  60. data/lib/2017-10-12/generated/azure_mgmt_cdn/custom_domains.rb +41 -8
  61. data/lib/2017-10-12/generated/azure_mgmt_cdn/edge_nodes.rb +4 -0
  62. data/lib/2017-10-12/generated/azure_mgmt_cdn/endpoints.rb +31 -5
  63. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/cache_expiration_action_parameters.rb +2 -2
  64. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/cdn_certificate_source_parameters.rb +62 -0
  65. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/cdn_managed_https_parameters.rb +73 -0
  66. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/certificate_type.rb +16 -0
  67. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/cidr_ip_address.rb +1 -1
  68. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/custom_domain.rb +1 -1
  69. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/custom_domain_https_parameters.rb +60 -0
  70. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/custom_domain_list_result.rb +1 -1
  71. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/edgenode_result.rb +1 -1
  72. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/endpoint.rb +3 -3
  73. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/endpoint_list_result.rb +2 -2
  74. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/endpoint_update_parameters.rb +2 -2
  75. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/error_response.rb +1 -1
  76. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/key_vault_certificate_source_parameters.rb +137 -0
  77. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/operations_list_result.rb +1 -1
  78. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/origin_list_result.rb +1 -1
  79. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/profile_list_result.rb +2 -2
  80. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/protocol_type.rb +16 -0
  81. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/resource.rb +9 -0
  82. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/resource_usage_list_result.rb +1 -1
  83. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/sku.rb +1 -1
  84. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/sku_name.rb +1 -0
  85. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/user_managed_https_parameters.rb +73 -0
  86. data/lib/2017-10-12/generated/azure_mgmt_cdn/operations.rb +4 -0
  87. data/lib/2017-10-12/generated/azure_mgmt_cdn/origins.rb +8 -0
  88. data/lib/2017-10-12/generated/azure_mgmt_cdn/profiles.rb +27 -3
  89. data/lib/2017-10-12/generated/azure_mgmt_cdn/resource_usage_operations.rb +4 -0
  90. data/lib/2020-04-15/generated/azure_mgmt_cdn.rb +201 -0
  91. data/lib/2020-04-15/generated/azure_mgmt_cdn/cdn_management_client.rb +478 -0
  92. data/lib/2020-04-15/generated/azure_mgmt_cdn/custom_domains.rb +1001 -0
  93. data/lib/2020-04-15/generated/azure_mgmt_cdn/edge_nodes.rb +225 -0
  94. data/lib/2020-04-15/generated/azure_mgmt_cdn/endpoints.rb +1946 -0
  95. data/lib/2020-04-15/generated/azure_mgmt_cdn/managed_rule_sets.rb +221 -0
  96. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/action_type.rb +18 -0
  97. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/algorithm.rb +15 -0
  98. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/cache_behavior.rb +17 -0
  99. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/cache_expiration_action_parameters.rb +88 -0
  100. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/cache_key_query_string_action_parameters.rb +75 -0
  101. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/cdn_certificate_source_parameters.rb +62 -0
  102. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/cdn_endpoint.rb +46 -0
  103. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/cdn_managed_https_parameters.rb +82 -0
  104. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/cdn_web_application_firewall_policy.rb +210 -0
  105. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/cdn_web_application_firewall_policy_list.rb +103 -0
  106. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/cdn_web_application_firewall_policy_patch_parameters.rb +55 -0
  107. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/certificate_type.rb +16 -0
  108. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/check_name_availability_input.rb +60 -0
  109. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/check_name_availability_output.rb +72 -0
  110. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/cidr_ip_address.rb +57 -0
  111. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/cookies_match_condition_parameters.rb +123 -0
  112. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/cookies_operator.rb +23 -0
  113. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/custom_domain.rb +148 -0
  114. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/custom_domain_https_parameters.rb +73 -0
  115. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/custom_domain_list_result.rb +102 -0
  116. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/custom_domain_parameters.rb +48 -0
  117. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/custom_domain_resource_state.rb +17 -0
  118. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/custom_https_provisioning_state.rb +19 -0
  119. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/custom_https_provisioning_substate.rb +24 -0
  120. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/custom_rule.rb +108 -0
  121. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/custom_rule_enabled_state.rb +16 -0
  122. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/custom_rule_list.rb +55 -0
  123. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/deep_created_origin.rb +200 -0
  124. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/deep_created_origin_group.rb +114 -0
  125. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/delivery_rule.rb +107 -0
  126. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/delivery_rule_action.rb +51 -0
  127. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/delivery_rule_cache_expiration_action.rb +64 -0
  128. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/delivery_rule_cache_key_query_string_action.rb +64 -0
  129. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/delivery_rule_condition.rb +59 -0
  130. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/delivery_rule_cookies_condition.rb +64 -0
  131. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/delivery_rule_http_version_condition.rb +64 -0
  132. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/delivery_rule_is_device_condition.rb +64 -0
  133. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/delivery_rule_post_args_condition.rb +64 -0
  134. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/delivery_rule_query_string_condition.rb +64 -0
  135. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/delivery_rule_remote_address_condition.rb +64 -0
  136. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/delivery_rule_request_body_condition.rb +64 -0
  137. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/delivery_rule_request_header_action.rb +63 -0
  138. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/delivery_rule_request_header_condition.rb +64 -0
  139. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/delivery_rule_request_method_condition.rb +64 -0
  140. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/delivery_rule_request_scheme_condition.rb +64 -0
  141. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/delivery_rule_request_uri_condition.rb +64 -0
  142. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/delivery_rule_response_header_action.rb +63 -0
  143. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/delivery_rule_url_file_extension_condition.rb +64 -0
  144. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/delivery_rule_url_file_name_condition.rb +64 -0
  145. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/delivery_rule_url_path_condition.rb +64 -0
  146. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/destination_protocol.rb +17 -0
  147. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/edge_node.rb +83 -0
  148. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/edgenode_result.rb +101 -0
  149. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/endpoint.rb +391 -0
  150. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/endpoint_list_result.rb +101 -0
  151. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/endpoint_properties_update_parameters_delivery_policy.rb +67 -0
  152. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/endpoint_properties_update_parameters_web_application_firewall_policy_link.rb +49 -0
  153. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/endpoint_resource_state.rb +20 -0
  154. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/endpoint_update_parameters.rb +274 -0
  155. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/error_response.rb +60 -0
  156. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/geo_filter.rb +80 -0
  157. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/geo_filter_actions.rb +16 -0
  158. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/header_action.rb +17 -0
  159. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/header_action_parameters.rb +83 -0
  160. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/health_probe_parameters.rb +90 -0
  161. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/health_probe_request_type.rb +17 -0
  162. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/http_error_range_parameters.rb +65 -0
  163. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/http_version_match_condition_parameters.rb +95 -0
  164. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/ip_address_group.rb +86 -0
  165. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/is_device_match_condition_parameters.rb +113 -0
  166. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/key_vault_certificate_source_parameters.rb +137 -0
  167. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/key_vault_signing_key_parameters.rb +106 -0
  168. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/load_parameters.rb +55 -0
  169. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/managed_rule_definition.rb +59 -0
  170. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/managed_rule_enabled_state.rb +16 -0
  171. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/managed_rule_group_definition.rb +81 -0
  172. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/managed_rule_group_override.rb +68 -0
  173. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/managed_rule_override.rb +72 -0
  174. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/managed_rule_set.rb +94 -0
  175. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/managed_rule_set_definition.rb +133 -0
  176. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/managed_rule_set_definition_list.rb +101 -0
  177. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/managed_rule_set_list.rb +55 -0
  178. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/match_condition.rb +125 -0
  179. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/match_variable.rb +23 -0
  180. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/minimum_tls_version.rb +17 -0
  181. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/operation.rb +59 -0
  182. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/operation_display.rb +72 -0
  183. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/operations_list_result.rb +102 -0
  184. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/operator.rb +26 -0
  185. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/optimization_type.rb +19 -0
  186. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/origin.rb +256 -0
  187. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/origin_group.rb +153 -0
  188. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/origin_group_list_result.rb +102 -0
  189. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/origin_group_resource_state.rb +17 -0
  190. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/origin_group_update_parameters.rb +100 -0
  191. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/origin_list_result.rb +101 -0
  192. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/origin_resource_state.rb +17 -0
  193. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/origin_update_parameters.rb +187 -0
  194. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/param_indicator.rb +17 -0
  195. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/policy_enabled_state.rb +16 -0
  196. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/policy_mode.rb +16 -0
  197. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/policy_resource_state.rb +20 -0
  198. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/policy_settings.rb +99 -0
  199. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/post_args_match_condition_parameters.rb +123 -0
  200. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/post_args_operator.rb +23 -0
  201. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/private_endpoint_status.rb +19 -0
  202. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/probe_protocol.rb +17 -0
  203. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/profile.rb +125 -0
  204. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/profile_list_result.rb +101 -0
  205. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/profile_resource_state.rb +18 -0
  206. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/profile_update_parameters.rb +54 -0
  207. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/protocol_type.rb +16 -0
  208. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/provisioning_state.rb +17 -0
  209. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/proxy_resource.rb +63 -0
  210. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/purge_parameters.rb +55 -0
  211. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/query_string_behavior.rb +18 -0
  212. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/query_string_caching_behavior.rb +18 -0
  213. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/query_string_match_condition_parameters.rb +114 -0
  214. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/query_string_operator.rb +23 -0
  215. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/rate_limit_rule.rb +117 -0
  216. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/rate_limit_rule_list.rb +55 -0
  217. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/redirect_type.rb +18 -0
  218. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/remote_address_match_condition_parameters.rb +114 -0
  219. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/remote_address_operator.rb +17 -0
  220. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/request_body_match_condition_parameters.rb +114 -0
  221. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/request_body_operator.rb +23 -0
  222. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/request_header_match_condition_parameters.rb +125 -0
  223. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/request_header_operator.rb +23 -0
  224. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/request_method_match_condition_parameters.rb +95 -0
  225. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/request_scheme_match_condition_parameters.rb +95 -0
  226. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/request_uri_match_condition_parameters.rb +113 -0
  227. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/request_uri_operator.rb +23 -0
  228. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/resource.rb +80 -0
  229. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/resource_reference.rb +46 -0
  230. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/resource_type.rb +15 -0
  231. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/resource_usage.rb +83 -0
  232. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/resource_usage_list_result.rb +100 -0
  233. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/response_based_detected_error_types.rb +17 -0
  234. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/response_based_origin_error_detection_parameters.rb +89 -0
  235. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/sku.rb +50 -0
  236. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/sku_name.rb +21 -0
  237. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/sso_uri.rb +48 -0
  238. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/supported_optimization_types_list_result.rb +56 -0
  239. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/tracked_resource.rb +92 -0
  240. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/transform.rb +16 -0
  241. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/transform_type.rb +20 -0
  242. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/url_file_extension_match_condition_parameters.rb +114 -0
  243. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/url_file_extension_operator.rb +23 -0
  244. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/url_file_name_match_condition_parameters.rb +114 -0
  245. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/url_file_name_operator.rb +23 -0
  246. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/url_path_match_condition_parameters.rb +114 -0
  247. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/url_path_operator.rb +24 -0
  248. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/url_redirect_action.rb +64 -0
  249. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/url_redirect_action_parameters.rb +127 -0
  250. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/url_rewrite_action.rb +64 -0
  251. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/url_rewrite_action_parameters.rb +86 -0
  252. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/url_signing_action_parameters.rb +112 -0
  253. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/url_signing_key.rb +62 -0
  254. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/url_signing_param_identifier.rb +58 -0
  255. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/user_managed_https_parameters.rb +82 -0
  256. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/validate_custom_domain_input.rb +47 -0
  257. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/validate_custom_domain_output.rb +72 -0
  258. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/validate_probe_input.rb +46 -0
  259. data/lib/2020-04-15/generated/azure_mgmt_cdn/models/validate_probe_output.rb +73 -0
  260. data/lib/2020-04-15/generated/azure_mgmt_cdn/module_definition.rb +9 -0
  261. data/lib/2020-04-15/generated/azure_mgmt_cdn/operations.rb +219 -0
  262. data/lib/2020-04-15/generated/azure_mgmt_cdn/origin_groups.rb +927 -0
  263. data/lib/2020-04-15/generated/azure_mgmt_cdn/origins.rb +922 -0
  264. data/lib/2020-04-15/generated/azure_mgmt_cdn/policies.rb +789 -0
  265. data/lib/2020-04-15/generated/azure_mgmt_cdn/profiles.rb +1482 -0
  266. data/lib/2020-04-15/generated/azure_mgmt_cdn/resource_usage_operations.rb +228 -0
  267. data/lib/azure_mgmt_cdn.rb +2 -1
  268. data/lib/profiles/latest/modules/cdn_profile_module.rb +583 -157
  269. data/lib/version.rb +1 -1
  270. metadata +189 -5
@@ -0,0 +1,1482 @@
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::CDN::Mgmt::V2020_04_15
7
+ #
8
+ # Cdn Management Client
9
+ #
10
+ class Profiles
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Profiles class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [CdnManagementClient] reference to the CdnManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Lists all of the CDN profiles within an Azure subscription.
26
+ #
27
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
28
+ # will be added to the HTTP request.
29
+ #
30
+ # @return [Array<Profile>] operation results.
31
+ #
32
+ def list(custom_headers:nil)
33
+ first_page = list_as_lazy(custom_headers:custom_headers)
34
+ first_page.get_all_items
35
+ end
36
+
37
+ #
38
+ # Lists all of the CDN profiles within an Azure subscription.
39
+ #
40
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
41
+ # will be added to the HTTP request.
42
+ #
43
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
44
+ #
45
+ def list_with_http_info(custom_headers:nil)
46
+ list_async(custom_headers:custom_headers).value!
47
+ end
48
+
49
+ #
50
+ # Lists all of the CDN profiles within an Azure subscription.
51
+ #
52
+ # @param [Hash{String => String}] A hash of custom headers that will be added
53
+ # to the HTTP request.
54
+ #
55
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
56
+ #
57
+ def list_async(custom_headers:nil)
58
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
59
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
60
+
61
+
62
+ request_headers = {}
63
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
64
+
65
+ # Set Headers
66
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
67
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
68
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Cdn/profiles'
69
+
70
+ request_url = @base_url || @client.base_url
71
+
72
+ options = {
73
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
74
+ path_params: {'subscriptionId' => @client.subscription_id},
75
+ query_params: {'api-version' => @client.api_version},
76
+ headers: request_headers.merge(custom_headers || {}),
77
+ base_url: request_url
78
+ }
79
+ promise = @client.make_request_async(:get, path_template, options)
80
+
81
+ promise = promise.then do |result|
82
+ http_response = result.response
83
+ status_code = http_response.status
84
+ response_content = http_response.body
85
+ unless status_code == 200
86
+ error_model = JSON.load(response_content)
87
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
88
+ end
89
+
90
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
91
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
92
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
93
+ # Deserialize Response
94
+ if status_code == 200
95
+ begin
96
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
97
+ result_mapper = Azure::CDN::Mgmt::V2020_04_15::Models::ProfileListResult.mapper()
98
+ result.body = @client.deserialize(result_mapper, parsed_response)
99
+ rescue Exception => e
100
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
101
+ end
102
+ end
103
+
104
+ result
105
+ end
106
+
107
+ promise.execute
108
+ end
109
+
110
+ #
111
+ # Lists all of the CDN profiles within a resource group.
112
+ #
113
+ # @param resource_group_name [String] Name of the Resource group within the
114
+ # Azure subscription.
115
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
116
+ # will be added to the HTTP request.
117
+ #
118
+ # @return [Array<Profile>] operation results.
119
+ #
120
+ def list_by_resource_group(resource_group_name, custom_headers:nil)
121
+ first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers:custom_headers)
122
+ first_page.get_all_items
123
+ end
124
+
125
+ #
126
+ # Lists all of the CDN profiles within a resource group.
127
+ #
128
+ # @param resource_group_name [String] Name of the Resource group within the
129
+ # Azure subscription.
130
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
131
+ # will be added to the HTTP request.
132
+ #
133
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
134
+ #
135
+ def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil)
136
+ list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
137
+ end
138
+
139
+ #
140
+ # Lists all of the CDN profiles within a resource group.
141
+ #
142
+ # @param resource_group_name [String] Name of the Resource group within the
143
+ # Azure subscription.
144
+ # @param [Hash{String => String}] A hash of custom headers that will be added
145
+ # to the HTTP request.
146
+ #
147
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
148
+ #
149
+ def list_by_resource_group_async(resource_group_name, custom_headers:nil)
150
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
151
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
152
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
153
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
154
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
155
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
156
+
157
+
158
+ request_headers = {}
159
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
160
+
161
+ # Set Headers
162
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
163
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
164
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles'
165
+
166
+ request_url = @base_url || @client.base_url
167
+
168
+ options = {
169
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
170
+ path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
171
+ query_params: {'api-version' => @client.api_version},
172
+ headers: request_headers.merge(custom_headers || {}),
173
+ base_url: request_url
174
+ }
175
+ promise = @client.make_request_async(:get, path_template, options)
176
+
177
+ promise = promise.then do |result|
178
+ http_response = result.response
179
+ status_code = http_response.status
180
+ response_content = http_response.body
181
+ unless status_code == 200
182
+ error_model = JSON.load(response_content)
183
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
184
+ end
185
+
186
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
187
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
188
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
189
+ # Deserialize Response
190
+ if status_code == 200
191
+ begin
192
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
193
+ result_mapper = Azure::CDN::Mgmt::V2020_04_15::Models::ProfileListResult.mapper()
194
+ result.body = @client.deserialize(result_mapper, parsed_response)
195
+ rescue Exception => e
196
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
197
+ end
198
+ end
199
+
200
+ result
201
+ end
202
+
203
+ promise.execute
204
+ end
205
+
206
+ #
207
+ # Gets a CDN profile with the specified profile name under the specified
208
+ # subscription and resource group.
209
+ #
210
+ # @param resource_group_name [String] Name of the Resource group within the
211
+ # Azure subscription.
212
+ # @param profile_name [String] Name of the CDN profile which is unique within
213
+ # the resource group.
214
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
215
+ # will be added to the HTTP request.
216
+ #
217
+ # @return [Profile] operation results.
218
+ #
219
+ def get(resource_group_name, profile_name, custom_headers:nil)
220
+ response = get_async(resource_group_name, profile_name, custom_headers:custom_headers).value!
221
+ response.body unless response.nil?
222
+ end
223
+
224
+ #
225
+ # Gets a CDN profile with the specified profile name under the specified
226
+ # subscription and resource group.
227
+ #
228
+ # @param resource_group_name [String] Name of the Resource group within the
229
+ # Azure subscription.
230
+ # @param profile_name [String] Name of the CDN profile which is unique within
231
+ # the resource group.
232
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
233
+ # will be added to the HTTP request.
234
+ #
235
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
236
+ #
237
+ def get_with_http_info(resource_group_name, profile_name, custom_headers:nil)
238
+ get_async(resource_group_name, profile_name, custom_headers:custom_headers).value!
239
+ end
240
+
241
+ #
242
+ # Gets a CDN profile with the specified profile name under the specified
243
+ # subscription and resource group.
244
+ #
245
+ # @param resource_group_name [String] Name of the Resource group within the
246
+ # Azure subscription.
247
+ # @param profile_name [String] Name of the CDN profile which is unique within
248
+ # the resource group.
249
+ # @param [Hash{String => String}] A hash of custom headers that will be added
250
+ # to the HTTP request.
251
+ #
252
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
253
+ #
254
+ def get_async(resource_group_name, profile_name, custom_headers:nil)
255
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
256
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
257
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
258
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
259
+ fail ArgumentError, 'profile_name is nil' if profile_name.nil?
260
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
261
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
262
+
263
+
264
+ request_headers = {}
265
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
266
+
267
+ # Set Headers
268
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
269
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
270
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}'
271
+
272
+ request_url = @base_url || @client.base_url
273
+
274
+ options = {
275
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
276
+ path_params: {'resourceGroupName' => resource_group_name,'profileName' => profile_name,'subscriptionId' => @client.subscription_id},
277
+ query_params: {'api-version' => @client.api_version},
278
+ headers: request_headers.merge(custom_headers || {}),
279
+ base_url: request_url
280
+ }
281
+ promise = @client.make_request_async(:get, path_template, options)
282
+
283
+ promise = promise.then do |result|
284
+ http_response = result.response
285
+ status_code = http_response.status
286
+ response_content = http_response.body
287
+ unless status_code == 200
288
+ error_model = JSON.load(response_content)
289
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
290
+ end
291
+
292
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
293
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
294
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
295
+ # Deserialize Response
296
+ if status_code == 200
297
+ begin
298
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
299
+ result_mapper = Azure::CDN::Mgmt::V2020_04_15::Models::Profile.mapper()
300
+ result.body = @client.deserialize(result_mapper, parsed_response)
301
+ rescue Exception => e
302
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
303
+ end
304
+ end
305
+
306
+ result
307
+ end
308
+
309
+ promise.execute
310
+ end
311
+
312
+ #
313
+ # Creates a new CDN profile with a profile name under the specified
314
+ # subscription and resource group.
315
+ #
316
+ # @param resource_group_name [String] Name of the Resource group within the
317
+ # Azure subscription.
318
+ # @param profile_name [String] Name of the CDN profile which is unique within
319
+ # the resource group.
320
+ # @param profile [Profile] Profile properties needed to create a new profile.
321
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
322
+ # will be added to the HTTP request.
323
+ #
324
+ # @return [Profile] operation results.
325
+ #
326
+ def create(resource_group_name, profile_name, profile, custom_headers:nil)
327
+ response = create_async(resource_group_name, profile_name, profile, custom_headers:custom_headers).value!
328
+ response.body unless response.nil?
329
+ end
330
+
331
+ #
332
+ # @param resource_group_name [String] Name of the Resource group within the
333
+ # Azure subscription.
334
+ # @param profile_name [String] Name of the CDN profile which is unique within
335
+ # the resource group.
336
+ # @param profile [Profile] Profile properties needed to create a new profile.
337
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
338
+ # will be added to the HTTP request.
339
+ #
340
+ # @return [Concurrent::Promise] promise which provides async access to http
341
+ # response.
342
+ #
343
+ def create_async(resource_group_name, profile_name, profile, custom_headers:nil)
344
+ # Send request
345
+ promise = begin_create_async(resource_group_name, profile_name, profile, custom_headers:custom_headers)
346
+
347
+ promise = promise.then do |response|
348
+ # Defining deserialization method.
349
+ deserialize_method = lambda do |parsed_response|
350
+ result_mapper = Azure::CDN::Mgmt::V2020_04_15::Models::Profile.mapper()
351
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
352
+ end
353
+
354
+ # Waiting for response.
355
+ @client.get_long_running_operation_result(response, deserialize_method)
356
+ end
357
+
358
+ promise
359
+ end
360
+
361
+ #
362
+ # Updates an existing CDN profile with the specified profile name under the
363
+ # specified subscription and resource group.
364
+ #
365
+ # @param resource_group_name [String] Name of the Resource group within the
366
+ # Azure subscription.
367
+ # @param profile_name [String] Name of the CDN profile which is unique within
368
+ # the resource group.
369
+ # @param profile_update_parameters [ProfileUpdateParameters] Profile properties
370
+ # needed to update an existing profile.
371
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
372
+ # will be added to the HTTP request.
373
+ #
374
+ # @return [Profile] operation results.
375
+ #
376
+ def update(resource_group_name, profile_name, profile_update_parameters, custom_headers:nil)
377
+ response = update_async(resource_group_name, profile_name, profile_update_parameters, custom_headers:custom_headers).value!
378
+ response.body unless response.nil?
379
+ end
380
+
381
+ #
382
+ # @param resource_group_name [String] Name of the Resource group within the
383
+ # Azure subscription.
384
+ # @param profile_name [String] Name of the CDN profile which is unique within
385
+ # the resource group.
386
+ # @param profile_update_parameters [ProfileUpdateParameters] Profile properties
387
+ # needed to update an existing profile.
388
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
389
+ # will be added to the HTTP request.
390
+ #
391
+ # @return [Concurrent::Promise] promise which provides async access to http
392
+ # response.
393
+ #
394
+ def update_async(resource_group_name, profile_name, profile_update_parameters, custom_headers:nil)
395
+ # Send request
396
+ promise = begin_update_async(resource_group_name, profile_name, profile_update_parameters, custom_headers:custom_headers)
397
+
398
+ promise = promise.then do |response|
399
+ # Defining deserialization method.
400
+ deserialize_method = lambda do |parsed_response|
401
+ result_mapper = Azure::CDN::Mgmt::V2020_04_15::Models::Profile.mapper()
402
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
403
+ end
404
+
405
+ # Waiting for response.
406
+ @client.get_long_running_operation_result(response, deserialize_method)
407
+ end
408
+
409
+ promise
410
+ end
411
+
412
+ #
413
+ # Deletes an existing CDN profile with the specified parameters. Deleting a
414
+ # profile will result in the deletion of all of the sub-resources including
415
+ # endpoints, origins and custom domains.
416
+ #
417
+ # @param resource_group_name [String] Name of the Resource group within the
418
+ # Azure subscription.
419
+ # @param profile_name [String] Name of the CDN profile which is unique within
420
+ # the resource group.
421
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
422
+ # will be added to the HTTP request.
423
+ #
424
+ def delete(resource_group_name, profile_name, custom_headers:nil)
425
+ response = delete_async(resource_group_name, profile_name, custom_headers:custom_headers).value!
426
+ nil
427
+ end
428
+
429
+ #
430
+ # @param resource_group_name [String] Name of the Resource group within the
431
+ # Azure subscription.
432
+ # @param profile_name [String] Name of the CDN profile which is unique within
433
+ # the resource group.
434
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
435
+ # will be added to the HTTP request.
436
+ #
437
+ # @return [Concurrent::Promise] promise which provides async access to http
438
+ # response.
439
+ #
440
+ def delete_async(resource_group_name, profile_name, custom_headers:nil)
441
+ # Send request
442
+ promise = begin_delete_async(resource_group_name, profile_name, custom_headers:custom_headers)
443
+
444
+ promise = promise.then do |response|
445
+ # Defining deserialization method.
446
+ deserialize_method = lambda do |parsed_response|
447
+ end
448
+
449
+ # Waiting for response.
450
+ @client.get_long_running_operation_result(response, deserialize_method)
451
+ end
452
+
453
+ promise
454
+ end
455
+
456
+ #
457
+ # Generates a dynamic SSO URI used to sign in to the CDN supplemental portal.
458
+ # Supplemental portal is used to configure advanced feature capabilities that
459
+ # are not yet available in the Azure portal, such as core reports in a standard
460
+ # profile; rules engine, advanced HTTP reports, and real-time stats and alerts
461
+ # in a premium profile. The SSO URI changes approximately every 10 minutes.
462
+ #
463
+ # @param resource_group_name [String] Name of the Resource group within the
464
+ # Azure subscription.
465
+ # @param profile_name [String] Name of the CDN profile which is unique within
466
+ # the resource group.
467
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
468
+ # will be added to the HTTP request.
469
+ #
470
+ # @return [SsoUri] operation results.
471
+ #
472
+ def generate_sso_uri(resource_group_name, profile_name, custom_headers:nil)
473
+ response = generate_sso_uri_async(resource_group_name, profile_name, custom_headers:custom_headers).value!
474
+ response.body unless response.nil?
475
+ end
476
+
477
+ #
478
+ # Generates a dynamic SSO URI used to sign in to the CDN supplemental portal.
479
+ # Supplemental portal is used to configure advanced feature capabilities that
480
+ # are not yet available in the Azure portal, such as core reports in a standard
481
+ # profile; rules engine, advanced HTTP reports, and real-time stats and alerts
482
+ # in a premium profile. The SSO URI changes approximately every 10 minutes.
483
+ #
484
+ # @param resource_group_name [String] Name of the Resource group within the
485
+ # Azure subscription.
486
+ # @param profile_name [String] Name of the CDN profile which is unique within
487
+ # the resource group.
488
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
489
+ # will be added to the HTTP request.
490
+ #
491
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
492
+ #
493
+ def generate_sso_uri_with_http_info(resource_group_name, profile_name, custom_headers:nil)
494
+ generate_sso_uri_async(resource_group_name, profile_name, custom_headers:custom_headers).value!
495
+ end
496
+
497
+ #
498
+ # Generates a dynamic SSO URI used to sign in to the CDN supplemental portal.
499
+ # Supplemental portal is used to configure advanced feature capabilities that
500
+ # are not yet available in the Azure portal, such as core reports in a standard
501
+ # profile; rules engine, advanced HTTP reports, and real-time stats and alerts
502
+ # in a premium profile. The SSO URI changes approximately every 10 minutes.
503
+ #
504
+ # @param resource_group_name [String] Name of the Resource group within the
505
+ # Azure subscription.
506
+ # @param profile_name [String] Name of the CDN profile which is unique within
507
+ # the resource group.
508
+ # @param [Hash{String => String}] A hash of custom headers that will be added
509
+ # to the HTTP request.
510
+ #
511
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
512
+ #
513
+ def generate_sso_uri_async(resource_group_name, profile_name, custom_headers:nil)
514
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
515
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
516
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
517
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
518
+ fail ArgumentError, 'profile_name is nil' if profile_name.nil?
519
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
520
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
521
+
522
+
523
+ request_headers = {}
524
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
525
+
526
+ # Set Headers
527
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
528
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
529
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/generateSsoUri'
530
+
531
+ request_url = @base_url || @client.base_url
532
+
533
+ options = {
534
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
535
+ path_params: {'resourceGroupName' => resource_group_name,'profileName' => profile_name,'subscriptionId' => @client.subscription_id},
536
+ query_params: {'api-version' => @client.api_version},
537
+ headers: request_headers.merge(custom_headers || {}),
538
+ base_url: request_url
539
+ }
540
+ promise = @client.make_request_async(:post, path_template, options)
541
+
542
+ promise = promise.then do |result|
543
+ http_response = result.response
544
+ status_code = http_response.status
545
+ response_content = http_response.body
546
+ unless status_code == 200
547
+ error_model = JSON.load(response_content)
548
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
549
+ end
550
+
551
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
552
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
553
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
554
+ # Deserialize Response
555
+ if status_code == 200
556
+ begin
557
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
558
+ result_mapper = Azure::CDN::Mgmt::V2020_04_15::Models::SsoUri.mapper()
559
+ result.body = @client.deserialize(result_mapper, parsed_response)
560
+ rescue Exception => e
561
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
562
+ end
563
+ end
564
+
565
+ result
566
+ end
567
+
568
+ promise.execute
569
+ end
570
+
571
+ #
572
+ # Gets the supported optimization types for the current profile. A user can
573
+ # create an endpoint with an optimization type from the listed values.
574
+ #
575
+ # @param resource_group_name [String] Name of the Resource group within the
576
+ # Azure subscription.
577
+ # @param profile_name [String] Name of the CDN profile which is unique within
578
+ # the resource group.
579
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
580
+ # will be added to the HTTP request.
581
+ #
582
+ # @return [SupportedOptimizationTypesListResult] operation results.
583
+ #
584
+ def list_supported_optimization_types(resource_group_name, profile_name, custom_headers:nil)
585
+ response = list_supported_optimization_types_async(resource_group_name, profile_name, custom_headers:custom_headers).value!
586
+ response.body unless response.nil?
587
+ end
588
+
589
+ #
590
+ # Gets the supported optimization types for the current profile. A user can
591
+ # create an endpoint with an optimization type from the listed values.
592
+ #
593
+ # @param resource_group_name [String] Name of the Resource group within the
594
+ # Azure subscription.
595
+ # @param profile_name [String] Name of the CDN profile which is unique within
596
+ # the resource group.
597
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
598
+ # will be added to the HTTP request.
599
+ #
600
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
601
+ #
602
+ def list_supported_optimization_types_with_http_info(resource_group_name, profile_name, custom_headers:nil)
603
+ list_supported_optimization_types_async(resource_group_name, profile_name, custom_headers:custom_headers).value!
604
+ end
605
+
606
+ #
607
+ # Gets the supported optimization types for the current profile. A user can
608
+ # create an endpoint with an optimization type from the listed values.
609
+ #
610
+ # @param resource_group_name [String] Name of the Resource group within the
611
+ # Azure subscription.
612
+ # @param profile_name [String] Name of the CDN profile which is unique within
613
+ # the resource group.
614
+ # @param [Hash{String => String}] A hash of custom headers that will be added
615
+ # to the HTTP request.
616
+ #
617
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
618
+ #
619
+ def list_supported_optimization_types_async(resource_group_name, profile_name, custom_headers:nil)
620
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
621
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
622
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
623
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
624
+ fail ArgumentError, 'profile_name is nil' if profile_name.nil?
625
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
626
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.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.Cdn/profiles/{profileName}/getSupportedOptimizationTypes'
636
+
637
+ request_url = @base_url || @client.base_url
638
+
639
+ options = {
640
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
641
+ path_params: {'resourceGroupName' => resource_group_name,'profileName' => profile_name,'subscriptionId' => @client.subscription_id},
642
+ query_params: {'api-version' => @client.api_version},
643
+ headers: request_headers.merge(custom_headers || {}),
644
+ base_url: request_url
645
+ }
646
+ promise = @client.make_request_async(:post, 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 MsRest::HttpOperationError.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::CDN::Mgmt::V2020_04_15::Models::SupportedOptimizationTypesListResult.mapper()
665
+ result.body = @client.deserialize(result_mapper, parsed_response)
666
+ rescue Exception => e
667
+ fail MsRest::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
+ # Checks the quota and actual usage of endpoints under the given CDN profile.
679
+ #
680
+ # @param resource_group_name [String] Name of the Resource group within the
681
+ # Azure subscription.
682
+ # @param profile_name [String] Name of the CDN profile which is unique within
683
+ # the resource group.
684
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
685
+ # will be added to the HTTP request.
686
+ #
687
+ # @return [Array<ResourceUsage>] operation results.
688
+ #
689
+ def list_resource_usage(resource_group_name, profile_name, custom_headers:nil)
690
+ first_page = list_resource_usage_as_lazy(resource_group_name, profile_name, custom_headers:custom_headers)
691
+ first_page.get_all_items
692
+ end
693
+
694
+ #
695
+ # Checks the quota and actual usage of endpoints under the given CDN profile.
696
+ #
697
+ # @param resource_group_name [String] Name of the Resource group within the
698
+ # Azure subscription.
699
+ # @param profile_name [String] Name of the CDN profile which is unique within
700
+ # the resource group.
701
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
702
+ # will be added to the HTTP request.
703
+ #
704
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
705
+ #
706
+ def list_resource_usage_with_http_info(resource_group_name, profile_name, custom_headers:nil)
707
+ list_resource_usage_async(resource_group_name, profile_name, custom_headers:custom_headers).value!
708
+ end
709
+
710
+ #
711
+ # Checks the quota and actual usage of endpoints under the given CDN profile.
712
+ #
713
+ # @param resource_group_name [String] Name of the Resource group within the
714
+ # Azure subscription.
715
+ # @param profile_name [String] Name of the CDN profile which is unique within
716
+ # the resource group.
717
+ # @param [Hash{String => String}] A hash of custom headers that will be added
718
+ # to the HTTP request.
719
+ #
720
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
721
+ #
722
+ def list_resource_usage_async(resource_group_name, profile_name, custom_headers:nil)
723
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
724
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
725
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
726
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
727
+ fail ArgumentError, 'profile_name is nil' if profile_name.nil?
728
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
729
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
730
+
731
+
732
+ request_headers = {}
733
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
734
+
735
+ # Set Headers
736
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
737
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
738
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/checkResourceUsage'
739
+
740
+ request_url = @base_url || @client.base_url
741
+
742
+ options = {
743
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
744
+ path_params: {'resourceGroupName' => resource_group_name,'profileName' => profile_name,'subscriptionId' => @client.subscription_id},
745
+ query_params: {'api-version' => @client.api_version},
746
+ headers: request_headers.merge(custom_headers || {}),
747
+ base_url: request_url
748
+ }
749
+ promise = @client.make_request_async(:post, path_template, options)
750
+
751
+ promise = promise.then do |result|
752
+ http_response = result.response
753
+ status_code = http_response.status
754
+ response_content = http_response.body
755
+ unless status_code == 200
756
+ error_model = JSON.load(response_content)
757
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
758
+ end
759
+
760
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
761
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
762
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
763
+ # Deserialize Response
764
+ if status_code == 200
765
+ begin
766
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
767
+ result_mapper = Azure::CDN::Mgmt::V2020_04_15::Models::ResourceUsageListResult.mapper()
768
+ result.body = @client.deserialize(result_mapper, parsed_response)
769
+ rescue Exception => e
770
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
771
+ end
772
+ end
773
+
774
+ result
775
+ end
776
+
777
+ promise.execute
778
+ end
779
+
780
+ #
781
+ # Creates a new CDN profile with a profile name under the specified
782
+ # subscription and resource group.
783
+ #
784
+ # @param resource_group_name [String] Name of the Resource group within the
785
+ # Azure subscription.
786
+ # @param profile_name [String] Name of the CDN profile which is unique within
787
+ # the resource group.
788
+ # @param profile [Profile] Profile properties needed to create a new profile.
789
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
790
+ # will be added to the HTTP request.
791
+ #
792
+ # @return [Profile] operation results.
793
+ #
794
+ def begin_create(resource_group_name, profile_name, profile, custom_headers:nil)
795
+ response = begin_create_async(resource_group_name, profile_name, profile, custom_headers:custom_headers).value!
796
+ response.body unless response.nil?
797
+ end
798
+
799
+ #
800
+ # Creates a new CDN profile with a profile name under the specified
801
+ # subscription and resource group.
802
+ #
803
+ # @param resource_group_name [String] Name of the Resource group within the
804
+ # Azure subscription.
805
+ # @param profile_name [String] Name of the CDN profile which is unique within
806
+ # the resource group.
807
+ # @param profile [Profile] Profile properties needed to create a new profile.
808
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
809
+ # will be added to the HTTP request.
810
+ #
811
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
812
+ #
813
+ def begin_create_with_http_info(resource_group_name, profile_name, profile, custom_headers:nil)
814
+ begin_create_async(resource_group_name, profile_name, profile, custom_headers:custom_headers).value!
815
+ end
816
+
817
+ #
818
+ # Creates a new CDN profile with a profile name under the specified
819
+ # subscription and resource group.
820
+ #
821
+ # @param resource_group_name [String] Name of the Resource group within the
822
+ # Azure subscription.
823
+ # @param profile_name [String] Name of the CDN profile which is unique within
824
+ # the resource group.
825
+ # @param profile [Profile] Profile properties needed to create a new profile.
826
+ # @param [Hash{String => String}] A hash of custom headers that will be added
827
+ # to the HTTP request.
828
+ #
829
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
830
+ #
831
+ def begin_create_async(resource_group_name, profile_name, profile, custom_headers:nil)
832
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
833
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
834
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
835
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
836
+ fail ArgumentError, 'profile_name is nil' if profile_name.nil?
837
+ fail ArgumentError, 'profile is nil' if profile.nil?
838
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
839
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
840
+
841
+
842
+ request_headers = {}
843
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
844
+
845
+ # Set Headers
846
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
847
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
848
+
849
+ # Serialize Request
850
+ request_mapper = Azure::CDN::Mgmt::V2020_04_15::Models::Profile.mapper()
851
+ request_content = @client.serialize(request_mapper, profile)
852
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
853
+
854
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}'
855
+
856
+ request_url = @base_url || @client.base_url
857
+
858
+ options = {
859
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
860
+ path_params: {'resourceGroupName' => resource_group_name,'profileName' => profile_name,'subscriptionId' => @client.subscription_id},
861
+ query_params: {'api-version' => @client.api_version},
862
+ body: request_content,
863
+ headers: request_headers.merge(custom_headers || {}),
864
+ base_url: request_url
865
+ }
866
+ promise = @client.make_request_async(:put, path_template, options)
867
+
868
+ promise = promise.then do |result|
869
+ http_response = result.response
870
+ status_code = http_response.status
871
+ response_content = http_response.body
872
+ unless status_code == 200 || status_code == 201 || status_code == 202
873
+ error_model = JSON.load(response_content)
874
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
875
+ end
876
+
877
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
878
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
879
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
880
+ # Deserialize Response
881
+ if status_code == 200
882
+ begin
883
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
884
+ result_mapper = Azure::CDN::Mgmt::V2020_04_15::Models::Profile.mapper()
885
+ result.body = @client.deserialize(result_mapper, parsed_response)
886
+ rescue Exception => e
887
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
888
+ end
889
+ end
890
+ # Deserialize Response
891
+ if status_code == 201
892
+ begin
893
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
894
+ result_mapper = Azure::CDN::Mgmt::V2020_04_15::Models::Profile.mapper()
895
+ result.body = @client.deserialize(result_mapper, parsed_response)
896
+ rescue Exception => e
897
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
898
+ end
899
+ end
900
+ # Deserialize Response
901
+ if status_code == 202
902
+ begin
903
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
904
+ result_mapper = Azure::CDN::Mgmt::V2020_04_15::Models::Profile.mapper()
905
+ result.body = @client.deserialize(result_mapper, parsed_response)
906
+ rescue Exception => e
907
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
908
+ end
909
+ end
910
+
911
+ result
912
+ end
913
+
914
+ promise.execute
915
+ end
916
+
917
+ #
918
+ # Updates an existing CDN profile with the specified profile name under the
919
+ # specified subscription and resource group.
920
+ #
921
+ # @param resource_group_name [String] Name of the Resource group within the
922
+ # Azure subscription.
923
+ # @param profile_name [String] Name of the CDN profile which is unique within
924
+ # the resource group.
925
+ # @param profile_update_parameters [ProfileUpdateParameters] Profile properties
926
+ # needed to update an existing profile.
927
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
928
+ # will be added to the HTTP request.
929
+ #
930
+ # @return [Profile] operation results.
931
+ #
932
+ def begin_update(resource_group_name, profile_name, profile_update_parameters, custom_headers:nil)
933
+ response = begin_update_async(resource_group_name, profile_name, profile_update_parameters, custom_headers:custom_headers).value!
934
+ response.body unless response.nil?
935
+ end
936
+
937
+ #
938
+ # Updates an existing CDN profile with the specified profile name under the
939
+ # specified subscription and resource group.
940
+ #
941
+ # @param resource_group_name [String] Name of the Resource group within the
942
+ # Azure subscription.
943
+ # @param profile_name [String] Name of the CDN profile which is unique within
944
+ # the resource group.
945
+ # @param profile_update_parameters [ProfileUpdateParameters] Profile properties
946
+ # needed to update an existing profile.
947
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
948
+ # will be added to the HTTP request.
949
+ #
950
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
951
+ #
952
+ def begin_update_with_http_info(resource_group_name, profile_name, profile_update_parameters, custom_headers:nil)
953
+ begin_update_async(resource_group_name, profile_name, profile_update_parameters, custom_headers:custom_headers).value!
954
+ end
955
+
956
+ #
957
+ # Updates an existing CDN profile with the specified profile name under the
958
+ # specified subscription and resource group.
959
+ #
960
+ # @param resource_group_name [String] Name of the Resource group within the
961
+ # Azure subscription.
962
+ # @param profile_name [String] Name of the CDN profile which is unique within
963
+ # the resource group.
964
+ # @param profile_update_parameters [ProfileUpdateParameters] Profile properties
965
+ # needed to update an existing profile.
966
+ # @param [Hash{String => String}] A hash of custom headers that will be added
967
+ # to the HTTP request.
968
+ #
969
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
970
+ #
971
+ def begin_update_async(resource_group_name, profile_name, profile_update_parameters, custom_headers:nil)
972
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
973
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
974
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
975
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
976
+ fail ArgumentError, 'profile_name is nil' if profile_name.nil?
977
+ fail ArgumentError, 'profile_update_parameters is nil' if profile_update_parameters.nil?
978
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
979
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
980
+
981
+
982
+ request_headers = {}
983
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
984
+
985
+ # Set Headers
986
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
987
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
988
+
989
+ # Serialize Request
990
+ request_mapper = Azure::CDN::Mgmt::V2020_04_15::Models::ProfileUpdateParameters.mapper()
991
+ request_content = @client.serialize(request_mapper, profile_update_parameters)
992
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
993
+
994
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}'
995
+
996
+ request_url = @base_url || @client.base_url
997
+
998
+ options = {
999
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1000
+ path_params: {'resourceGroupName' => resource_group_name,'profileName' => profile_name,'subscriptionId' => @client.subscription_id},
1001
+ query_params: {'api-version' => @client.api_version},
1002
+ body: request_content,
1003
+ headers: request_headers.merge(custom_headers || {}),
1004
+ base_url: request_url
1005
+ }
1006
+ promise = @client.make_request_async(:patch, path_template, options)
1007
+
1008
+ promise = promise.then do |result|
1009
+ http_response = result.response
1010
+ status_code = http_response.status
1011
+ response_content = http_response.body
1012
+ unless status_code == 200 || status_code == 202
1013
+ error_model = JSON.load(response_content)
1014
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1015
+ end
1016
+
1017
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1018
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1019
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1020
+ # Deserialize Response
1021
+ if status_code == 200
1022
+ begin
1023
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1024
+ result_mapper = Azure::CDN::Mgmt::V2020_04_15::Models::Profile.mapper()
1025
+ result.body = @client.deserialize(result_mapper, parsed_response)
1026
+ rescue Exception => e
1027
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1028
+ end
1029
+ end
1030
+ # Deserialize Response
1031
+ if status_code == 202
1032
+ begin
1033
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1034
+ result_mapper = Azure::CDN::Mgmt::V2020_04_15::Models::Profile.mapper()
1035
+ result.body = @client.deserialize(result_mapper, parsed_response)
1036
+ rescue Exception => e
1037
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1038
+ end
1039
+ end
1040
+
1041
+ result
1042
+ end
1043
+
1044
+ promise.execute
1045
+ end
1046
+
1047
+ #
1048
+ # Deletes an existing CDN profile with the specified parameters. Deleting a
1049
+ # profile will result in the deletion of all of the sub-resources including
1050
+ # endpoints, origins and custom domains.
1051
+ #
1052
+ # @param resource_group_name [String] Name of the Resource group within the
1053
+ # Azure subscription.
1054
+ # @param profile_name [String] Name of the CDN profile which is unique within
1055
+ # the resource group.
1056
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1057
+ # will be added to the HTTP request.
1058
+ #
1059
+ #
1060
+ def begin_delete(resource_group_name, profile_name, custom_headers:nil)
1061
+ response = begin_delete_async(resource_group_name, profile_name, custom_headers:custom_headers).value!
1062
+ nil
1063
+ end
1064
+
1065
+ #
1066
+ # Deletes an existing CDN profile with the specified parameters. Deleting a
1067
+ # profile will result in the deletion of all of the sub-resources including
1068
+ # endpoints, origins and custom domains.
1069
+ #
1070
+ # @param resource_group_name [String] Name of the Resource group within the
1071
+ # Azure subscription.
1072
+ # @param profile_name [String] Name of the CDN profile which is unique within
1073
+ # the resource group.
1074
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1075
+ # will be added to the HTTP request.
1076
+ #
1077
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1078
+ #
1079
+ def begin_delete_with_http_info(resource_group_name, profile_name, custom_headers:nil)
1080
+ begin_delete_async(resource_group_name, profile_name, custom_headers:custom_headers).value!
1081
+ end
1082
+
1083
+ #
1084
+ # Deletes an existing CDN profile with the specified parameters. Deleting a
1085
+ # profile will result in the deletion of all of the sub-resources including
1086
+ # endpoints, origins and custom domains.
1087
+ #
1088
+ # @param resource_group_name [String] Name of the Resource group within the
1089
+ # Azure subscription.
1090
+ # @param profile_name [String] Name of the CDN profile which is unique within
1091
+ # the resource group.
1092
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1093
+ # to the HTTP request.
1094
+ #
1095
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1096
+ #
1097
+ def begin_delete_async(resource_group_name, profile_name, custom_headers:nil)
1098
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1099
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1100
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1101
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1102
+ fail ArgumentError, 'profile_name is nil' if profile_name.nil?
1103
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1104
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1105
+
1106
+
1107
+ request_headers = {}
1108
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1109
+
1110
+ # Set Headers
1111
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1112
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1113
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}'
1114
+
1115
+ request_url = @base_url || @client.base_url
1116
+
1117
+ options = {
1118
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1119
+ path_params: {'resourceGroupName' => resource_group_name,'profileName' => profile_name,'subscriptionId' => @client.subscription_id},
1120
+ query_params: {'api-version' => @client.api_version},
1121
+ headers: request_headers.merge(custom_headers || {}),
1122
+ base_url: request_url
1123
+ }
1124
+ promise = @client.make_request_async(:delete, path_template, options)
1125
+
1126
+ promise = promise.then do |result|
1127
+ http_response = result.response
1128
+ status_code = http_response.status
1129
+ response_content = http_response.body
1130
+ unless status_code == 202 || status_code == 204
1131
+ error_model = JSON.load(response_content)
1132
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1133
+ end
1134
+
1135
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1136
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1137
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1138
+
1139
+ result
1140
+ end
1141
+
1142
+ promise.execute
1143
+ end
1144
+
1145
+ #
1146
+ # Lists all of the CDN profiles within an Azure subscription.
1147
+ #
1148
+ # @param next_page_link [String] The NextLink from the previous successful call
1149
+ # to List operation.
1150
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1151
+ # will be added to the HTTP request.
1152
+ #
1153
+ # @return [ProfileListResult] operation results.
1154
+ #
1155
+ def list_next(next_page_link, custom_headers:nil)
1156
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
1157
+ response.body unless response.nil?
1158
+ end
1159
+
1160
+ #
1161
+ # Lists all of the CDN profiles within an Azure subscription.
1162
+ #
1163
+ # @param next_page_link [String] The NextLink from the previous successful call
1164
+ # to List operation.
1165
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1166
+ # will be added to the HTTP request.
1167
+ #
1168
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1169
+ #
1170
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
1171
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
1172
+ end
1173
+
1174
+ #
1175
+ # Lists all of the CDN profiles within an Azure subscription.
1176
+ #
1177
+ # @param next_page_link [String] The NextLink from the previous successful call
1178
+ # to List operation.
1179
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1180
+ # to the HTTP request.
1181
+ #
1182
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1183
+ #
1184
+ def list_next_async(next_page_link, custom_headers:nil)
1185
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1186
+
1187
+
1188
+ request_headers = {}
1189
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1190
+
1191
+ # Set Headers
1192
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1193
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1194
+ path_template = '{nextLink}'
1195
+
1196
+ request_url = @base_url || @client.base_url
1197
+
1198
+ options = {
1199
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1200
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1201
+ headers: request_headers.merge(custom_headers || {}),
1202
+ base_url: request_url
1203
+ }
1204
+ promise = @client.make_request_async(:get, path_template, options)
1205
+
1206
+ promise = promise.then do |result|
1207
+ http_response = result.response
1208
+ status_code = http_response.status
1209
+ response_content = http_response.body
1210
+ unless status_code == 200
1211
+ error_model = JSON.load(response_content)
1212
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1213
+ end
1214
+
1215
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1216
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1217
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1218
+ # Deserialize Response
1219
+ if status_code == 200
1220
+ begin
1221
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1222
+ result_mapper = Azure::CDN::Mgmt::V2020_04_15::Models::ProfileListResult.mapper()
1223
+ result.body = @client.deserialize(result_mapper, parsed_response)
1224
+ rescue Exception => e
1225
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1226
+ end
1227
+ end
1228
+
1229
+ result
1230
+ end
1231
+
1232
+ promise.execute
1233
+ end
1234
+
1235
+ #
1236
+ # Lists all of the CDN profiles within a resource group.
1237
+ #
1238
+ # @param next_page_link [String] The NextLink from the previous successful call
1239
+ # to List operation.
1240
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1241
+ # will be added to the HTTP request.
1242
+ #
1243
+ # @return [ProfileListResult] operation results.
1244
+ #
1245
+ def list_by_resource_group_next(next_page_link, custom_headers:nil)
1246
+ response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
1247
+ response.body unless response.nil?
1248
+ end
1249
+
1250
+ #
1251
+ # Lists all of the CDN profiles within a resource group.
1252
+ #
1253
+ # @param next_page_link [String] The NextLink from the previous successful call
1254
+ # to List operation.
1255
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1256
+ # will be added to the HTTP request.
1257
+ #
1258
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1259
+ #
1260
+ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
1261
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
1262
+ end
1263
+
1264
+ #
1265
+ # Lists all of the CDN profiles within a resource group.
1266
+ #
1267
+ # @param next_page_link [String] The NextLink from the previous successful call
1268
+ # to List operation.
1269
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1270
+ # to the HTTP request.
1271
+ #
1272
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1273
+ #
1274
+ def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
1275
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1276
+
1277
+
1278
+ request_headers = {}
1279
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1280
+
1281
+ # Set Headers
1282
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1283
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1284
+ path_template = '{nextLink}'
1285
+
1286
+ request_url = @base_url || @client.base_url
1287
+
1288
+ options = {
1289
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1290
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1291
+ headers: request_headers.merge(custom_headers || {}),
1292
+ base_url: request_url
1293
+ }
1294
+ promise = @client.make_request_async(:get, path_template, options)
1295
+
1296
+ promise = promise.then do |result|
1297
+ http_response = result.response
1298
+ status_code = http_response.status
1299
+ response_content = http_response.body
1300
+ unless status_code == 200
1301
+ error_model = JSON.load(response_content)
1302
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1303
+ end
1304
+
1305
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1306
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1307
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1308
+ # Deserialize Response
1309
+ if status_code == 200
1310
+ begin
1311
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1312
+ result_mapper = Azure::CDN::Mgmt::V2020_04_15::Models::ProfileListResult.mapper()
1313
+ result.body = @client.deserialize(result_mapper, parsed_response)
1314
+ rescue Exception => e
1315
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1316
+ end
1317
+ end
1318
+
1319
+ result
1320
+ end
1321
+
1322
+ promise.execute
1323
+ end
1324
+
1325
+ #
1326
+ # Checks the quota and actual usage of endpoints under the given CDN profile.
1327
+ #
1328
+ # @param next_page_link [String] The NextLink from the previous successful call
1329
+ # to List operation.
1330
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1331
+ # will be added to the HTTP request.
1332
+ #
1333
+ # @return [ResourceUsageListResult] operation results.
1334
+ #
1335
+ def list_resource_usage_next(next_page_link, custom_headers:nil)
1336
+ response = list_resource_usage_next_async(next_page_link, custom_headers:custom_headers).value!
1337
+ response.body unless response.nil?
1338
+ end
1339
+
1340
+ #
1341
+ # Checks the quota and actual usage of endpoints under the given CDN profile.
1342
+ #
1343
+ # @param next_page_link [String] The NextLink from the previous successful call
1344
+ # to List operation.
1345
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1346
+ # will be added to the HTTP request.
1347
+ #
1348
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1349
+ #
1350
+ def list_resource_usage_next_with_http_info(next_page_link, custom_headers:nil)
1351
+ list_resource_usage_next_async(next_page_link, custom_headers:custom_headers).value!
1352
+ end
1353
+
1354
+ #
1355
+ # Checks the quota and actual usage of endpoints under the given CDN profile.
1356
+ #
1357
+ # @param next_page_link [String] The NextLink from the previous successful call
1358
+ # to List operation.
1359
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1360
+ # to the HTTP request.
1361
+ #
1362
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1363
+ #
1364
+ def list_resource_usage_next_async(next_page_link, custom_headers:nil)
1365
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1366
+
1367
+
1368
+ request_headers = {}
1369
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1370
+
1371
+ # Set Headers
1372
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1373
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1374
+ path_template = '{nextLink}'
1375
+
1376
+ request_url = @base_url || @client.base_url
1377
+
1378
+ options = {
1379
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1380
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1381
+ headers: request_headers.merge(custom_headers || {}),
1382
+ base_url: request_url
1383
+ }
1384
+ promise = @client.make_request_async(:post, path_template, options)
1385
+
1386
+ promise = promise.then do |result|
1387
+ http_response = result.response
1388
+ status_code = http_response.status
1389
+ response_content = http_response.body
1390
+ unless status_code == 200
1391
+ error_model = JSON.load(response_content)
1392
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1393
+ end
1394
+
1395
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1396
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1397
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1398
+ # Deserialize Response
1399
+ if status_code == 200
1400
+ begin
1401
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1402
+ result_mapper = Azure::CDN::Mgmt::V2020_04_15::Models::ResourceUsageListResult.mapper()
1403
+ result.body = @client.deserialize(result_mapper, parsed_response)
1404
+ rescue Exception => e
1405
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1406
+ end
1407
+ end
1408
+
1409
+ result
1410
+ end
1411
+
1412
+ promise.execute
1413
+ end
1414
+
1415
+ #
1416
+ # Lists all of the CDN profiles within an Azure subscription.
1417
+ #
1418
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1419
+ # will be added to the HTTP request.
1420
+ #
1421
+ # @return [ProfileListResult] which provide lazy access to pages of the
1422
+ # response.
1423
+ #
1424
+ def list_as_lazy(custom_headers:nil)
1425
+ response = list_async(custom_headers:custom_headers).value!
1426
+ unless response.nil?
1427
+ page = response.body
1428
+ page.next_method = Proc.new do |next_page_link|
1429
+ list_next_async(next_page_link, custom_headers:custom_headers)
1430
+ end
1431
+ page
1432
+ end
1433
+ end
1434
+
1435
+ #
1436
+ # Lists all of the CDN profiles within a resource group.
1437
+ #
1438
+ # @param resource_group_name [String] Name of the Resource group within the
1439
+ # Azure subscription.
1440
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1441
+ # will be added to the HTTP request.
1442
+ #
1443
+ # @return [ProfileListResult] which provide lazy access to pages of the
1444
+ # response.
1445
+ #
1446
+ def list_by_resource_group_as_lazy(resource_group_name, custom_headers:nil)
1447
+ response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
1448
+ unless response.nil?
1449
+ page = response.body
1450
+ page.next_method = Proc.new do |next_page_link|
1451
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
1452
+ end
1453
+ page
1454
+ end
1455
+ end
1456
+
1457
+ #
1458
+ # Checks the quota and actual usage of endpoints under the given CDN profile.
1459
+ #
1460
+ # @param resource_group_name [String] Name of the Resource group within the
1461
+ # Azure subscription.
1462
+ # @param profile_name [String] Name of the CDN profile which is unique within
1463
+ # the resource group.
1464
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1465
+ # will be added to the HTTP request.
1466
+ #
1467
+ # @return [ResourceUsageListResult] which provide lazy access to pages of the
1468
+ # response.
1469
+ #
1470
+ def list_resource_usage_as_lazy(resource_group_name, profile_name, custom_headers:nil)
1471
+ response = list_resource_usage_async(resource_group_name, profile_name, custom_headers:custom_headers).value!
1472
+ unless response.nil?
1473
+ page = response.body
1474
+ page.next_method = Proc.new do |next_page_link|
1475
+ list_resource_usage_next_async(next_page_link, custom_headers:custom_headers)
1476
+ end
1477
+ page
1478
+ end
1479
+ end
1480
+
1481
+ end
1482
+ end