azure_mgmt_cdn 0.14.0 → 0.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (168) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2015-06-01/generated/azure_mgmt_cdn.rb +70 -0
  3. data/lib/2015-06-01/generated/azure_mgmt_cdn/cdn_management_client.rb +150 -0
  4. data/lib/2015-06-01/generated/azure_mgmt_cdn/custom_domains.rb +718 -0
  5. data/lib/2015-06-01/generated/azure_mgmt_cdn/endpoints.rb +1456 -0
  6. data/lib/{generated → 2015-06-01/generated}/azure_mgmt_cdn/models/check_name_availability_input.rb +1 -1
  7. data/lib/2015-06-01/generated/azure_mgmt_cdn/models/check_name_availability_output.rb +65 -0
  8. data/lib/2015-06-01/generated/azure_mgmt_cdn/models/custom_domain.rb +96 -0
  9. data/lib/2015-06-01/generated/azure_mgmt_cdn/models/custom_domain_list_result.rb +54 -0
  10. data/lib/2015-06-01/generated/azure_mgmt_cdn/models/custom_domain_parameters.rb +45 -0
  11. data/lib/{generated → 2015-06-01/generated}/azure_mgmt_cdn/models/custom_domain_resource_state.rb +1 -1
  12. data/lib/2015-06-01/generated/azure_mgmt_cdn/models/deep_created_origin.rb +77 -0
  13. data/lib/2015-06-01/generated/azure_mgmt_cdn/models/endpoint.rb +229 -0
  14. data/lib/2015-06-01/generated/azure_mgmt_cdn/models/endpoint_create_parameters.rb +171 -0
  15. data/lib/2015-06-01/generated/azure_mgmt_cdn/models/endpoint_list_result.rb +53 -0
  16. data/lib/{generated → 2015-06-01/generated}/azure_mgmt_cdn/models/endpoint_resource_state.rb +1 -1
  17. data/lib/2015-06-01/generated/azure_mgmt_cdn/models/endpoint_update_parameters.rb +141 -0
  18. data/lib/2015-06-01/generated/azure_mgmt_cdn/models/error_response.rb +55 -0
  19. data/lib/2015-06-01/generated/azure_mgmt_cdn/models/load_parameters.rb +52 -0
  20. data/lib/2015-06-01/generated/azure_mgmt_cdn/models/operation.rb +55 -0
  21. data/lib/2015-06-01/generated/azure_mgmt_cdn/models/operation_display.rb +66 -0
  22. data/lib/2015-06-01/generated/azure_mgmt_cdn/models/operation_list_result.rb +54 -0
  23. data/lib/2015-06-01/generated/azure_mgmt_cdn/models/origin.rb +119 -0
  24. data/lib/2015-06-01/generated/azure_mgmt_cdn/models/origin_list_result.rb +53 -0
  25. data/lib/2015-06-01/generated/azure_mgmt_cdn/models/origin_parameters.rb +67 -0
  26. data/lib/{generated → 2015-06-01/generated}/azure_mgmt_cdn/models/origin_resource_state.rb +1 -1
  27. data/lib/2015-06-01/generated/azure_mgmt_cdn/models/profile.rb +118 -0
  28. data/lib/2015-06-01/generated/azure_mgmt_cdn/models/profile_create_parameters.rb +72 -0
  29. data/lib/2015-06-01/generated/azure_mgmt_cdn/models/profile_list_result.rb +53 -0
  30. data/lib/{generated → 2015-06-01/generated}/azure_mgmt_cdn/models/profile_resource_state.rb +1 -1
  31. data/lib/2015-06-01/generated/azure_mgmt_cdn/models/profile_update_parameters.rb +51 -0
  32. data/lib/2015-06-01/generated/azure_mgmt_cdn/models/provisioning_state.rb +17 -0
  33. data/lib/2015-06-01/generated/azure_mgmt_cdn/models/purge_parameters.rb +52 -0
  34. data/lib/{generated → 2015-06-01/generated}/azure_mgmt_cdn/models/query_string_caching_behavior.rb +1 -1
  35. data/lib/2015-06-01/generated/azure_mgmt_cdn/models/resource.rb +68 -0
  36. data/lib/{generated → 2015-06-01/generated}/azure_mgmt_cdn/models/resource_type.rb +1 -1
  37. data/lib/2015-06-01/generated/azure_mgmt_cdn/models/sku.rb +46 -0
  38. data/lib/2015-06-01/generated/azure_mgmt_cdn/models/sku_name.rb +16 -0
  39. data/lib/2015-06-01/generated/azure_mgmt_cdn/models/sso_uri.rb +44 -0
  40. data/lib/2015-06-01/generated/azure_mgmt_cdn/models/tracked_resource.rb +85 -0
  41. data/lib/2015-06-01/generated/azure_mgmt_cdn/models/validate_custom_domain_input.rb +45 -0
  42. data/lib/2015-06-01/generated/azure_mgmt_cdn/models/validate_custom_domain_output.rb +66 -0
  43. data/lib/2015-06-01/generated/azure_mgmt_cdn/module_definition.rb +9 -0
  44. data/lib/2015-06-01/generated/azure_mgmt_cdn/name_availability.rb +131 -0
  45. data/lib/2015-06-01/generated/azure_mgmt_cdn/operations.rb +109 -0
  46. data/lib/2015-06-01/generated/azure_mgmt_cdn/origins.rb +777 -0
  47. data/lib/2015-06-01/generated/azure_mgmt_cdn/profiles.rb +896 -0
  48. data/lib/{generated → 2015-06-01/generated}/azure_mgmt_cdn/version.rb +2 -2
  49. data/lib/2016-10-02/generated/azure_mgmt_cdn.rb +76 -0
  50. data/lib/2016-10-02/generated/azure_mgmt_cdn/cdn_management_client.rb +743 -0
  51. data/lib/2016-10-02/generated/azure_mgmt_cdn/custom_domains.rb +947 -0
  52. data/lib/2016-10-02/generated/azure_mgmt_cdn/edge_nodes.rb +214 -0
  53. data/lib/{generated → 2016-10-02/generated}/azure_mgmt_cdn/endpoints.rb +23 -23
  54. data/lib/2016-10-02/generated/azure_mgmt_cdn/models/check_name_availability_input.rb +57 -0
  55. data/lib/2016-10-02/generated/azure_mgmt_cdn/models/check_name_availability_output.rb +65 -0
  56. data/lib/{generated → 2016-10-02/generated}/azure_mgmt_cdn/models/cidr_ip_address.rb +1 -1
  57. data/lib/2016-10-02/generated/azure_mgmt_cdn/models/custom_domain.rb +139 -0
  58. data/lib/2016-10-02/generated/azure_mgmt_cdn/models/custom_domain_list_result.rb +97 -0
  59. data/lib/{generated → 2016-10-02/generated}/azure_mgmt_cdn/models/custom_domain_parameters.rb +1 -1
  60. data/lib/2016-10-02/generated/azure_mgmt_cdn/models/custom_domain_resource_state.rb +17 -0
  61. data/lib/{generated → 2016-10-02/generated}/azure_mgmt_cdn/models/custom_https_provisioning_state.rb +1 -1
  62. data/lib/2016-10-02/generated/azure_mgmt_cdn/models/deep_created_origin.rb +85 -0
  63. data/lib/2016-10-02/generated/azure_mgmt_cdn/models/edge_node.rb +97 -0
  64. data/lib/2016-10-02/generated/azure_mgmt_cdn/models/edgenode_result.rb +96 -0
  65. data/lib/2016-10-02/generated/azure_mgmt_cdn/models/endpoint.rb +262 -0
  66. data/lib/2016-10-02/generated/azure_mgmt_cdn/models/endpoint_list_result.rb +96 -0
  67. data/lib/2016-10-02/generated/azure_mgmt_cdn/models/endpoint_resource_state.rb +20 -0
  68. data/lib/2016-10-02/generated/azure_mgmt_cdn/models/endpoint_update_parameters.rb +176 -0
  69. data/lib/2016-10-02/generated/azure_mgmt_cdn/models/error_response.rb +55 -0
  70. data/lib/2016-10-02/generated/azure_mgmt_cdn/models/geo_filter.rb +75 -0
  71. data/lib/{generated → 2016-10-02/generated}/azure_mgmt_cdn/models/geo_filter_actions.rb +1 -1
  72. data/lib/{generated → 2016-10-02/generated}/azure_mgmt_cdn/models/ip_address_group.rb +1 -1
  73. data/lib/{generated → 2016-10-02/generated}/azure_mgmt_cdn/models/load_parameters.rb +1 -1
  74. data/lib/2016-10-02/generated/azure_mgmt_cdn/models/operation.rb +55 -0
  75. data/lib/2016-10-02/generated/azure_mgmt_cdn/models/operation_display.rb +65 -0
  76. data/lib/2016-10-02/generated/azure_mgmt_cdn/models/operation_list_result.rb +97 -0
  77. data/lib/{generated → 2016-10-02/generated}/azure_mgmt_cdn/models/optimization_type.rb +1 -1
  78. data/lib/{generated → 2016-10-02/generated}/azure_mgmt_cdn/models/origin.rb +1 -1
  79. data/lib/2016-10-02/generated/azure_mgmt_cdn/models/origin_list_result.rb +96 -0
  80. data/lib/2016-10-02/generated/azure_mgmt_cdn/models/origin_resource_state.rb +17 -0
  81. data/lib/{generated → 2016-10-02/generated}/azure_mgmt_cdn/models/origin_update_parameters.rb +1 -1
  82. data/lib/2016-10-02/generated/azure_mgmt_cdn/models/profile.rb +117 -0
  83. data/lib/2016-10-02/generated/azure_mgmt_cdn/models/profile_list_result.rb +96 -0
  84. data/lib/2016-10-02/generated/azure_mgmt_cdn/models/profile_resource_state.rb +18 -0
  85. data/lib/{generated → 2016-10-02/generated}/azure_mgmt_cdn/models/profile_update_parameters.rb +1 -1
  86. data/lib/{generated → 2016-10-02/generated}/azure_mgmt_cdn/models/purge_parameters.rb +1 -1
  87. data/lib/2016-10-02/generated/azure_mgmt_cdn/models/query_string_caching_behavior.rb +18 -0
  88. data/lib/{generated → 2016-10-02/generated}/azure_mgmt_cdn/models/resource.rb +1 -1
  89. data/lib/2016-10-02/generated/azure_mgmt_cdn/models/resource_type.rb +15 -0
  90. data/lib/2016-10-02/generated/azure_mgmt_cdn/models/resource_usage.rb +74 -0
  91. data/lib/2016-10-02/generated/azure_mgmt_cdn/models/resource_usage_list_result.rb +95 -0
  92. data/lib/{generated → 2016-10-02/generated}/azure_mgmt_cdn/models/sku.rb +1 -1
  93. data/lib/{generated → 2016-10-02/generated}/azure_mgmt_cdn/models/sku_name.rb +1 -1
  94. data/lib/2016-10-02/generated/azure_mgmt_cdn/models/sso_uri.rb +44 -0
  95. data/lib/2016-10-02/generated/azure_mgmt_cdn/models/supported_optimization_types_result.rb +52 -0
  96. data/lib/{generated → 2016-10-02/generated}/azure_mgmt_cdn/models/validate_custom_domain_input.rb +1 -1
  97. data/lib/2016-10-02/generated/azure_mgmt_cdn/models/validate_custom_domain_output.rb +66 -0
  98. data/lib/2016-10-02/generated/azure_mgmt_cdn/module_definition.rb +9 -0
  99. data/lib/{generated → 2016-10-02/generated}/azure_mgmt_cdn/origins.rb +8 -8
  100. data/lib/2016-10-02/generated/azure_mgmt_cdn/profiles.rb +1428 -0
  101. data/lib/{generated/azure_mgmt_cdn/module_definition.rb → 2016-10-02/generated/azure_mgmt_cdn/version.rb} +3 -3
  102. data/lib/{generated → 2017-04-02/generated}/azure_mgmt_cdn.rb +57 -57
  103. data/lib/{generated → 2017-04-02/generated}/azure_mgmt_cdn/cdn_management_client.rb +7 -7
  104. data/lib/{generated → 2017-04-02/generated}/azure_mgmt_cdn/custom_domains.rb +13 -13
  105. data/lib/{generated → 2017-04-02/generated}/azure_mgmt_cdn/edge_nodes.rb +3 -3
  106. data/lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb +1866 -0
  107. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/check_name_availability_input.rb +57 -0
  108. data/lib/{generated → 2017-04-02/generated}/azure_mgmt_cdn/models/check_name_availability_output.rb +1 -1
  109. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/cidr_ip_address.rb +54 -0
  110. data/lib/{generated → 2017-04-02/generated}/azure_mgmt_cdn/models/custom_domain.rb +1 -1
  111. data/lib/{generated → 2017-04-02/generated}/azure_mgmt_cdn/models/custom_domain_list_result.rb +1 -1
  112. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/custom_domain_parameters.rb +46 -0
  113. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/custom_domain_resource_state.rb +17 -0
  114. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/custom_https_provisioning_state.rb +19 -0
  115. data/lib/{generated → 2017-04-02/generated}/azure_mgmt_cdn/models/custom_https_provisioning_substate.rb +1 -1
  116. data/lib/{generated → 2017-04-02/generated}/azure_mgmt_cdn/models/deep_created_origin.rb +1 -1
  117. data/lib/{generated → 2017-04-02/generated}/azure_mgmt_cdn/models/edge_node.rb +1 -1
  118. data/lib/{generated → 2017-04-02/generated}/azure_mgmt_cdn/models/edgenode_result.rb +1 -1
  119. data/lib/{generated → 2017-04-02/generated}/azure_mgmt_cdn/models/endpoint.rb +1 -1
  120. data/lib/{generated → 2017-04-02/generated}/azure_mgmt_cdn/models/endpoint_list_result.rb +1 -1
  121. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/endpoint_resource_state.rb +20 -0
  122. data/lib/{generated → 2017-04-02/generated}/azure_mgmt_cdn/models/endpoint_update_parameters.rb +1 -1
  123. data/lib/{generated → 2017-04-02/generated}/azure_mgmt_cdn/models/error_response.rb +1 -1
  124. data/lib/{generated → 2017-04-02/generated}/azure_mgmt_cdn/models/geo_filter.rb +1 -1
  125. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/geo_filter_actions.rb +16 -0
  126. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/ip_address_group.rb +80 -0
  127. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/load_parameters.rb +52 -0
  128. data/lib/{generated → 2017-04-02/generated}/azure_mgmt_cdn/models/operation.rb +1 -1
  129. data/lib/{generated → 2017-04-02/generated}/azure_mgmt_cdn/models/operation_display.rb +1 -1
  130. data/lib/{generated → 2017-04-02/generated}/azure_mgmt_cdn/models/operations_list_result.rb +1 -1
  131. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/optimization_type.rb +19 -0
  132. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/origin.rb +146 -0
  133. data/lib/{generated → 2017-04-02/generated}/azure_mgmt_cdn/models/origin_list_result.rb +1 -1
  134. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/origin_resource_state.rb +17 -0
  135. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/origin_update_parameters.rb +75 -0
  136. data/lib/{generated → 2017-04-02/generated}/azure_mgmt_cdn/models/profile.rb +1 -1
  137. data/lib/{generated → 2017-04-02/generated}/azure_mgmt_cdn/models/profile_list_result.rb +1 -1
  138. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/profile_resource_state.rb +18 -0
  139. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/profile_update_parameters.rb +51 -0
  140. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/purge_parameters.rb +52 -0
  141. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/query_string_caching_behavior.rb +18 -0
  142. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/resource.rb +94 -0
  143. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/resource_type.rb +15 -0
  144. data/lib/{generated → 2017-04-02/generated}/azure_mgmt_cdn/models/resource_usage.rb +1 -1
  145. data/lib/{generated → 2017-04-02/generated}/azure_mgmt_cdn/models/resource_usage_list_result.rb +1 -1
  146. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/sku.rb +47 -0
  147. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/sku_name.rb +19 -0
  148. data/lib/{generated → 2017-04-02/generated}/azure_mgmt_cdn/models/sso_uri.rb +1 -1
  149. data/lib/{generated → 2017-04-02/generated}/azure_mgmt_cdn/models/supported_optimization_types_list_result.rb +1 -1
  150. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/validate_custom_domain_input.rb +45 -0
  151. data/lib/{generated → 2017-04-02/generated}/azure_mgmt_cdn/models/validate_custom_domain_output.rb +1 -1
  152. data/lib/{generated → 2017-04-02/generated}/azure_mgmt_cdn/models/validate_probe_input.rb +1 -1
  153. data/lib/{generated → 2017-04-02/generated}/azure_mgmt_cdn/models/validate_probe_output.rb +1 -1
  154. data/lib/2017-04-02/generated/azure_mgmt_cdn/module_definition.rb +9 -0
  155. data/lib/{generated → 2017-04-02/generated}/azure_mgmt_cdn/operations.rb +3 -3
  156. data/lib/2017-04-02/generated/azure_mgmt_cdn/origins.rb +545 -0
  157. data/lib/{generated → 2017-04-02/generated}/azure_mgmt_cdn/profiles.rb +19 -19
  158. data/lib/{generated → 2017-04-02/generated}/azure_mgmt_cdn/resource_usage_operations.rb +3 -3
  159. data/lib/2017-04-02/generated/azure_mgmt_cdn/version.rb +8 -0
  160. data/lib/azure_mgmt_cdn.rb +4 -1
  161. data/lib/module_definition.rb +7 -0
  162. data/lib/profiles/common/configurable.rb +73 -0
  163. data/lib/profiles/common/default.rb +68 -0
  164. data/lib/profiles/latest/cdn_latest_profile_client.rb +33 -0
  165. data/lib/profiles/latest/cdn_module_definition.rb +9 -0
  166. data/lib/profiles/latest/modules/cdn_profile_module.rb +242 -0
  167. data/lib/version.rb +7 -0
  168. metadata +167 -60
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6eb901b6dfbc7a69d9a33ec2d8cdd90fe2ea6a0a
4
- data.tar.gz: 0ff8b237bda9f95837a48d490b764711e1ff6260
3
+ metadata.gz: 7aff07b88b87848bdb4b40f6c9b96e2eaa7befab
4
+ data.tar.gz: 0c4e59b198a000cc0a3eb13cdd4ccdab6555055b
5
5
  SHA512:
6
- metadata.gz: a494f0e80a2ff3df3203c7129597fa3f3e07089c53e7f9ee4c65f220b9ce2f35886b78979f7759f55d3d953d29ff3a074f31def0a2c24269ffc17485f6859d2c
7
- data.tar.gz: 84d629e151fa0c83dffc79b4b98f088083f082a50eb8c65484d75517f3586ceaf9b0b4a27acab6a9801ada1985dad9f83fde9f51e8ea3bb81912dcbbe0ed404b
6
+ metadata.gz: 5c25faebcc6e69b013c7f31cf718158df83a82d4daf9161c146c44c96e13ee50b01caee81e48ffd0429ac7ebf891a88e22674ce3bdb873483406de963ccaa286
7
+ data.tar.gz: 4b36557017eb82af950a9af35e3f4755e9b311c0bc97e01b2e66e07da784c9f7ef5e75447e53e0429b2d25ebe1c77bd6530c5b0ac4b8ba4dff9c1606a0f0e613
@@ -0,0 +1,70 @@
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
+ require 'uri'
7
+ require 'cgi'
8
+ require 'date'
9
+ require 'json'
10
+ require 'base64'
11
+ require 'erb'
12
+ require 'securerandom'
13
+ require 'time'
14
+ require 'timeliness'
15
+ require 'faraday'
16
+ require 'faraday-cookie_jar'
17
+ require 'concurrent'
18
+ require 'ms_rest'
19
+ require '2015-06-01/generated/azure_mgmt_cdn/module_definition'
20
+ require 'ms_rest_azure'
21
+
22
+ module Azure::CDN::Mgmt::V2015_06_01
23
+ autoload :Profiles, '2015-06-01/generated/azure_mgmt_cdn/profiles.rb'
24
+ autoload :Endpoints, '2015-06-01/generated/azure_mgmt_cdn/endpoints.rb'
25
+ autoload :Origins, '2015-06-01/generated/azure_mgmt_cdn/origins.rb'
26
+ autoload :CustomDomains, '2015-06-01/generated/azure_mgmt_cdn/custom_domains.rb'
27
+ autoload :NameAvailability, '2015-06-01/generated/azure_mgmt_cdn/name_availability.rb'
28
+ autoload :Operations, '2015-06-01/generated/azure_mgmt_cdn/operations.rb'
29
+ autoload :CdnManagementClient, '2015-06-01/generated/azure_mgmt_cdn/cdn_management_client.rb'
30
+
31
+ module Models
32
+ autoload :OriginParameters, '2015-06-01/generated/azure_mgmt_cdn/models/origin_parameters.rb'
33
+ autoload :OriginListResult, '2015-06-01/generated/azure_mgmt_cdn/models/origin_list_result.rb'
34
+ autoload :ErrorResponse, '2015-06-01/generated/azure_mgmt_cdn/models/error_response.rb'
35
+ autoload :Sku, '2015-06-01/generated/azure_mgmt_cdn/models/sku.rb'
36
+ autoload :ProfileCreateParameters, '2015-06-01/generated/azure_mgmt_cdn/models/profile_create_parameters.rb'
37
+ autoload :Resource, '2015-06-01/generated/azure_mgmt_cdn/models/resource.rb'
38
+ autoload :SsoUri, '2015-06-01/generated/azure_mgmt_cdn/models/sso_uri.rb'
39
+ autoload :DeepCreatedOrigin, '2015-06-01/generated/azure_mgmt_cdn/models/deep_created_origin.rb'
40
+ autoload :OperationListResult, '2015-06-01/generated/azure_mgmt_cdn/models/operation_list_result.rb'
41
+ autoload :EndpointListResult, '2015-06-01/generated/azure_mgmt_cdn/models/endpoint_list_result.rb'
42
+ autoload :CustomDomainParameters, '2015-06-01/generated/azure_mgmt_cdn/models/custom_domain_parameters.rb'
43
+ autoload :EndpointUpdateParameters, '2015-06-01/generated/azure_mgmt_cdn/models/endpoint_update_parameters.rb'
44
+ autoload :CustomDomainListResult, '2015-06-01/generated/azure_mgmt_cdn/models/custom_domain_list_result.rb'
45
+ autoload :LoadParameters, '2015-06-01/generated/azure_mgmt_cdn/models/load_parameters.rb'
46
+ autoload :ValidateCustomDomainInput, '2015-06-01/generated/azure_mgmt_cdn/models/validate_custom_domain_input.rb'
47
+ autoload :ProfileUpdateParameters, '2015-06-01/generated/azure_mgmt_cdn/models/profile_update_parameters.rb'
48
+ autoload :ValidateCustomDomainOutput, '2015-06-01/generated/azure_mgmt_cdn/models/validate_custom_domain_output.rb'
49
+ autoload :EndpointCreateParameters, '2015-06-01/generated/azure_mgmt_cdn/models/endpoint_create_parameters.rb'
50
+ autoload :CheckNameAvailabilityInput, '2015-06-01/generated/azure_mgmt_cdn/models/check_name_availability_input.rb'
51
+ autoload :ProfileListResult, '2015-06-01/generated/azure_mgmt_cdn/models/profile_list_result.rb'
52
+ autoload :CheckNameAvailabilityOutput, '2015-06-01/generated/azure_mgmt_cdn/models/check_name_availability_output.rb'
53
+ autoload :PurgeParameters, '2015-06-01/generated/azure_mgmt_cdn/models/purge_parameters.rb'
54
+ autoload :OperationDisplay, '2015-06-01/generated/azure_mgmt_cdn/models/operation_display.rb'
55
+ autoload :Operation, '2015-06-01/generated/azure_mgmt_cdn/models/operation.rb'
56
+ autoload :TrackedResource, '2015-06-01/generated/azure_mgmt_cdn/models/tracked_resource.rb'
57
+ autoload :Profile, '2015-06-01/generated/azure_mgmt_cdn/models/profile.rb'
58
+ autoload :Endpoint, '2015-06-01/generated/azure_mgmt_cdn/models/endpoint.rb'
59
+ autoload :Origin, '2015-06-01/generated/azure_mgmt_cdn/models/origin.rb'
60
+ autoload :CustomDomain, '2015-06-01/generated/azure_mgmt_cdn/models/custom_domain.rb'
61
+ autoload :SkuName, '2015-06-01/generated/azure_mgmt_cdn/models/sku_name.rb'
62
+ autoload :ProfileResourceState, '2015-06-01/generated/azure_mgmt_cdn/models/profile_resource_state.rb'
63
+ autoload :ProvisioningState, '2015-06-01/generated/azure_mgmt_cdn/models/provisioning_state.rb'
64
+ autoload :QueryStringCachingBehavior, '2015-06-01/generated/azure_mgmt_cdn/models/query_string_caching_behavior.rb'
65
+ autoload :EndpointResourceState, '2015-06-01/generated/azure_mgmt_cdn/models/endpoint_resource_state.rb'
66
+ autoload :OriginResourceState, '2015-06-01/generated/azure_mgmt_cdn/models/origin_resource_state.rb'
67
+ autoload :CustomDomainResourceState, '2015-06-01/generated/azure_mgmt_cdn/models/custom_domain_resource_state.rb'
68
+ autoload :ResourceType, '2015-06-01/generated/azure_mgmt_cdn/models/resource_type.rb'
69
+ end
70
+ end
@@ -0,0 +1,150 @@
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::V2015_06_01
7
+ #
8
+ # A service client - single point of access to the REST API.
9
+ #
10
+ class CdnManagementClient < MsRestAzure::AzureServiceClient
11
+ include MsRestAzure
12
+ include MsRestAzure::Serialization
13
+
14
+ # @return [String] the base URI of the service.
15
+ attr_accessor :base_url
16
+
17
+ # @return Credentials needed for the client to connect to Azure.
18
+ attr_reader :credentials
19
+
20
+ # @return [String] Azure Subscription ID.
21
+ attr_accessor :subscription_id
22
+
23
+ # @return [String] Version of the API to be used with the client request.
24
+ # Current version is 2015-06-01
25
+ attr_reader :api_version
26
+
27
+ # @return [String] Gets or sets the preferred language for the response.
28
+ attr_accessor :accept_language
29
+
30
+ # @return [Integer] Gets or sets the retry timeout in seconds for Long
31
+ # Running Operations. Default value is 30.
32
+ attr_accessor :long_running_operation_retry_timeout
33
+
34
+ # @return [Boolean] When set to true a unique x-ms-client-request-id value
35
+ # is generated and included in each request. Default is true.
36
+ attr_accessor :generate_client_request_id
37
+
38
+ # @return [Profiles] profiles
39
+ attr_reader :profiles
40
+
41
+ # @return [Endpoints] endpoints
42
+ attr_reader :endpoints
43
+
44
+ # @return [Origins] origins
45
+ attr_reader :origins
46
+
47
+ # @return [CustomDomains] custom_domains
48
+ attr_reader :custom_domains
49
+
50
+ # @return [NameAvailability] name_availability
51
+ attr_reader :name_availability
52
+
53
+ # @return [Operations] operations
54
+ attr_reader :operations
55
+
56
+ #
57
+ # Creates initializes a new instance of the CdnManagementClient class.
58
+ # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
59
+ # @param base_url [String] the base URI of the service.
60
+ # @param options [Array] filters to be applied to the HTTP requests.
61
+ #
62
+ def initialize(credentials = nil, base_url = nil, options = nil)
63
+ super(credentials, options)
64
+ @base_url = base_url || 'https://management.azure.com'
65
+
66
+ fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
67
+ @credentials = credentials
68
+
69
+ @profiles = Profiles.new(self)
70
+ @endpoints = Endpoints.new(self)
71
+ @origins = Origins.new(self)
72
+ @custom_domains = CustomDomains.new(self)
73
+ @name_availability = NameAvailability.new(self)
74
+ @operations = Operations.new(self)
75
+ @api_version = '2015-06-01'
76
+ @accept_language = 'en-US'
77
+ @long_running_operation_retry_timeout = 30
78
+ @generate_client_request_id = true
79
+ add_telemetry
80
+ end
81
+
82
+ #
83
+ # Makes a request and returns the body of the response.
84
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
85
+ # @param path [String] the path, relative to {base_url}.
86
+ # @param options [Hash{String=>String}] specifying any request options like :body.
87
+ # @return [Hash{String=>String}] containing the body of the response.
88
+ # Example:
89
+ #
90
+ # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
91
+ # path = "/path"
92
+ # options = {
93
+ # body: request_content,
94
+ # query_params: {'api-version' => '2016-02-01'}
95
+ # }
96
+ # result = @client.make_request(:put, path, options)
97
+ #
98
+ def make_request(method, path, options = {})
99
+ result = make_request_with_http_info(method, path, options)
100
+ result.body unless result.nil?
101
+ end
102
+
103
+ #
104
+ # Makes a request and returns the operation response.
105
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
106
+ # @param path [String] the path, relative to {base_url}.
107
+ # @param options [Hash{String=>String}] specifying any request options like :body.
108
+ # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
109
+ #
110
+ def make_request_with_http_info(method, path, options = {})
111
+ result = make_request_async(method, path, options).value!
112
+ result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
113
+ result
114
+ end
115
+
116
+ #
117
+ # Makes a request asynchronously.
118
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
119
+ # @param path [String] the path, relative to {base_url}.
120
+ # @param options [Hash{String=>String}] specifying any request options like :body.
121
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
122
+ #
123
+ def make_request_async(method, path, options = {})
124
+ fail ArgumentError, 'method is nil' if method.nil?
125
+ fail ArgumentError, 'path is nil' if path.nil?
126
+
127
+ request_url = options[:base_url] || @base_url
128
+
129
+ request_headers = @request_headers
130
+ request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
131
+ options.merge!({headers: request_headers.merge(options[:headers] || {})})
132
+ options.merge!({credentials: @credentials}) unless @credentials.nil?
133
+
134
+ super(request_url, method, path, options)
135
+ end
136
+
137
+
138
+ private
139
+ #
140
+ # Adds telemetry information.
141
+ #
142
+ def add_telemetry
143
+ sdk_information = 'azure_mgmt_cdn'
144
+ if defined? Azure::CDN::Mgmt::V2015_06_01::VERSION
145
+ sdk_information = "#{sdk_information}/#{Azure::CDN::Mgmt::V2015_06_01::VERSION}"
146
+ end
147
+ add_user_agent_information(sdk_information)
148
+ end
149
+ end
150
+ end
@@ -0,0 +1,718 @@
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::V2015_06_01
7
+ #
8
+ # Use these APIs to manage Azure CDN resources through the Azure Resource
9
+ # Manager. You must make sure that requests made to these resources are
10
+ # secure. For more information, see
11
+ # https://msdn.microsoft.com/en-us/library/azure/dn790557.aspx.
12
+ #
13
+ class CustomDomains
14
+ include MsRestAzure
15
+
16
+ #
17
+ # Creates and initializes a new instance of the CustomDomains class.
18
+ # @param client service class for accessing basic functionality.
19
+ #
20
+ def initialize(client)
21
+ @client = client
22
+ end
23
+
24
+ # @return [CdnManagementClient] reference to the CdnManagementClient
25
+ attr_reader :client
26
+
27
+ #
28
+ # Lists the existing CDN custom domains within an endpoint.
29
+ #
30
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
31
+ # @param profile_name [String] Name of the CDN profile within the resource
32
+ # group.
33
+ # @param resource_group_name [String] Name of the resource group within the
34
+ # Azure subscription.
35
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
36
+ # will be added to the HTTP request.
37
+ #
38
+ # @return [CustomDomainListResult] operation results.
39
+ #
40
+ def list_by_endpoint(endpoint_name, profile_name, resource_group_name, custom_headers = nil)
41
+ response = list_by_endpoint_async(endpoint_name, profile_name, resource_group_name, custom_headers).value!
42
+ response.body unless response.nil?
43
+ end
44
+
45
+ #
46
+ # Lists the existing CDN custom domains within an endpoint.
47
+ #
48
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
49
+ # @param profile_name [String] Name of the CDN profile within the resource
50
+ # group.
51
+ # @param resource_group_name [String] Name of the resource group within the
52
+ # Azure subscription.
53
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
54
+ # will be added to the HTTP request.
55
+ #
56
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
57
+ #
58
+ def list_by_endpoint_with_http_info(endpoint_name, profile_name, resource_group_name, custom_headers = nil)
59
+ list_by_endpoint_async(endpoint_name, profile_name, resource_group_name, custom_headers).value!
60
+ end
61
+
62
+ #
63
+ # Lists the existing CDN custom domains within an endpoint.
64
+ #
65
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
66
+ # @param profile_name [String] Name of the CDN profile within the resource
67
+ # group.
68
+ # @param resource_group_name [String] Name of the resource group within the
69
+ # Azure subscription.
70
+ # @param [Hash{String => String}] A hash of custom headers that will be added
71
+ # to the HTTP request.
72
+ #
73
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
74
+ #
75
+ def list_by_endpoint_async(endpoint_name, profile_name, resource_group_name, custom_headers = nil)
76
+ fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
77
+ fail ArgumentError, 'profile_name is nil' if profile_name.nil?
78
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
79
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
80
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
81
+
82
+
83
+ request_headers = {}
84
+
85
+ # Set Headers
86
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
87
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
88
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains'
89
+
90
+ request_url = @base_url || @client.base_url
91
+
92
+ options = {
93
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
94
+ path_params: {'endpointName' => endpoint_name,'profileName' => profile_name,'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
95
+ query_params: {'api-version' => @client.api_version},
96
+ headers: request_headers.merge(custom_headers || {}),
97
+ base_url: request_url
98
+ }
99
+ promise = @client.make_request_async(:get, path_template, options)
100
+
101
+ promise = promise.then do |result|
102
+ http_response = result.response
103
+ status_code = http_response.status
104
+ response_content = http_response.body
105
+ unless status_code == 200
106
+ error_model = JSON.load(response_content)
107
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
108
+ end
109
+
110
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
111
+ # Deserialize Response
112
+ if status_code == 200
113
+ begin
114
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
115
+ result_mapper = Azure::CDN::Mgmt::V2015_06_01::Models::CustomDomainListResult.mapper()
116
+ result.body = @client.deserialize(result_mapper, parsed_response)
117
+ rescue Exception => e
118
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
119
+ end
120
+ end
121
+
122
+ result
123
+ end
124
+
125
+ promise.execute
126
+ end
127
+
128
+ #
129
+ # Gets an existing CDN custom domain within an endpoint.
130
+ #
131
+ # @param custom_domain_name [String] Name of the custom domain within an
132
+ # endpoint.
133
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
134
+ # @param profile_name [String] Name of the CDN profile within the resource
135
+ # group.
136
+ # @param resource_group_name [String] Name of the resource group within the
137
+ # Azure subscription.
138
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
139
+ # will be added to the HTTP request.
140
+ #
141
+ # @return [CustomDomain] operation results.
142
+ #
143
+ def get(custom_domain_name, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
144
+ response = get_async(custom_domain_name, endpoint_name, profile_name, resource_group_name, custom_headers).value!
145
+ response.body unless response.nil?
146
+ end
147
+
148
+ #
149
+ # Gets an existing CDN custom domain within an endpoint.
150
+ #
151
+ # @param custom_domain_name [String] Name of the custom domain within an
152
+ # endpoint.
153
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
154
+ # @param profile_name [String] Name of the CDN profile within the resource
155
+ # group.
156
+ # @param resource_group_name [String] Name of the resource group within the
157
+ # Azure subscription.
158
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
159
+ # will be added to the HTTP request.
160
+ #
161
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
162
+ #
163
+ def get_with_http_info(custom_domain_name, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
164
+ get_async(custom_domain_name, endpoint_name, profile_name, resource_group_name, custom_headers).value!
165
+ end
166
+
167
+ #
168
+ # Gets an existing CDN custom domain within an endpoint.
169
+ #
170
+ # @param custom_domain_name [String] Name of the custom domain within an
171
+ # endpoint.
172
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
173
+ # @param profile_name [String] Name of the CDN profile within the resource
174
+ # group.
175
+ # @param resource_group_name [String] Name of the resource group within the
176
+ # Azure subscription.
177
+ # @param [Hash{String => String}] A hash of custom headers that will be added
178
+ # to the HTTP request.
179
+ #
180
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
181
+ #
182
+ def get_async(custom_domain_name, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
183
+ fail ArgumentError, 'custom_domain_name is nil' if custom_domain_name.nil?
184
+ fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
185
+ fail ArgumentError, 'profile_name is nil' if profile_name.nil?
186
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
187
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
188
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
189
+
190
+
191
+ request_headers = {}
192
+
193
+ # Set Headers
194
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
195
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
196
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}'
197
+
198
+ request_url = @base_url || @client.base_url
199
+
200
+ options = {
201
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
202
+ path_params: {'customDomainName' => custom_domain_name,'endpointName' => endpoint_name,'profileName' => profile_name,'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
203
+ query_params: {'api-version' => @client.api_version},
204
+ headers: request_headers.merge(custom_headers || {}),
205
+ base_url: request_url
206
+ }
207
+ promise = @client.make_request_async(:get, path_template, options)
208
+
209
+ promise = promise.then do |result|
210
+ http_response = result.response
211
+ status_code = http_response.status
212
+ response_content = http_response.body
213
+ unless status_code == 200
214
+ error_model = JSON.load(response_content)
215
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
216
+ end
217
+
218
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
219
+ # Deserialize Response
220
+ if status_code == 200
221
+ begin
222
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
223
+ result_mapper = Azure::CDN::Mgmt::V2015_06_01::Models::CustomDomain.mapper()
224
+ result.body = @client.deserialize(result_mapper, parsed_response)
225
+ rescue Exception => e
226
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
227
+ end
228
+ end
229
+
230
+ result
231
+ end
232
+
233
+ promise.execute
234
+ end
235
+
236
+ #
237
+ # Creates a new CDN custom domain within an endpoint.
238
+ #
239
+ # @param custom_domain_name [String] Name of the custom domain within an
240
+ # endpoint.
241
+ # @param custom_domain_properties [CustomDomainParameters] Custom domain
242
+ # properties required for creation.
243
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
244
+ # @param profile_name [String] Name of the CDN profile within the resource
245
+ # group.
246
+ # @param resource_group_name [String] Name of the resource group within the
247
+ # Azure subscription.
248
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
249
+ # will be added to the HTTP request.
250
+ #
251
+ # @return [CustomDomain] operation results.
252
+ #
253
+ def create(custom_domain_name, custom_domain_properties, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
254
+ response = create_async(custom_domain_name, custom_domain_properties, endpoint_name, profile_name, resource_group_name, custom_headers).value!
255
+ response.body unless response.nil?
256
+ end
257
+
258
+ #
259
+ # @param custom_domain_name [String] Name of the custom domain within an
260
+ # endpoint.
261
+ # @param custom_domain_properties [CustomDomainParameters] Custom domain
262
+ # properties required for creation.
263
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
264
+ # @param profile_name [String] Name of the CDN profile within the resource
265
+ # group.
266
+ # @param resource_group_name [String] Name of the resource group within the
267
+ # Azure subscription.
268
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
269
+ # will be added to the HTTP request.
270
+ #
271
+ # @return [Concurrent::Promise] promise which provides async access to http
272
+ # response.
273
+ #
274
+ def create_async(custom_domain_name, custom_domain_properties, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
275
+ # Send request
276
+ promise = begin_create_async(custom_domain_name, custom_domain_properties, endpoint_name, profile_name, resource_group_name, custom_headers)
277
+
278
+ promise = promise.then do |response|
279
+ # Defining deserialization method.
280
+ deserialize_method = lambda do |parsed_response|
281
+ result_mapper = Azure::CDN::Mgmt::V2015_06_01::Models::CustomDomain.mapper()
282
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
283
+ end
284
+
285
+ # Waiting for response.
286
+ @client.get_long_running_operation_result(response, deserialize_method)
287
+ end
288
+
289
+ promise
290
+ end
291
+
292
+ #
293
+ # Updates an existing CDN custom domain within an endpoint.
294
+ #
295
+ # @param custom_domain_name [String] Name of the custom domain within an
296
+ # endpoint.
297
+ # @param custom_domain_properties [CustomDomainParameters] Custom domain
298
+ # properties to update.
299
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
300
+ # @param profile_name [String] Name of the CDN profile within the resource
301
+ # group.
302
+ # @param resource_group_name [String] Name of the resource group within the
303
+ # Azure subscription.
304
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
305
+ # will be added to the HTTP request.
306
+ #
307
+ # @return [ErrorResponse] operation results.
308
+ #
309
+ def update(custom_domain_name, custom_domain_properties, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
310
+ response = update_async(custom_domain_name, custom_domain_properties, endpoint_name, profile_name, resource_group_name, custom_headers).value!
311
+ response.body unless response.nil?
312
+ end
313
+
314
+ #
315
+ # Updates an existing CDN custom domain within an endpoint.
316
+ #
317
+ # @param custom_domain_name [String] Name of the custom domain within an
318
+ # endpoint.
319
+ # @param custom_domain_properties [CustomDomainParameters] Custom domain
320
+ # properties to update.
321
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
322
+ # @param profile_name [String] Name of the CDN profile within the resource
323
+ # group.
324
+ # @param resource_group_name [String] Name of the resource group within the
325
+ # Azure subscription.
326
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
327
+ # will be added to the HTTP request.
328
+ #
329
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
330
+ #
331
+ def update_with_http_info(custom_domain_name, custom_domain_properties, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
332
+ update_async(custom_domain_name, custom_domain_properties, endpoint_name, profile_name, resource_group_name, custom_headers).value!
333
+ end
334
+
335
+ #
336
+ # Updates an existing CDN custom domain within an endpoint.
337
+ #
338
+ # @param custom_domain_name [String] Name of the custom domain within an
339
+ # endpoint.
340
+ # @param custom_domain_properties [CustomDomainParameters] Custom domain
341
+ # properties to update.
342
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
343
+ # @param profile_name [String] Name of the CDN profile within the resource
344
+ # group.
345
+ # @param resource_group_name [String] Name of the resource group within the
346
+ # Azure subscription.
347
+ # @param [Hash{String => String}] A hash of custom headers that will be added
348
+ # to the HTTP request.
349
+ #
350
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
351
+ #
352
+ def update_async(custom_domain_name, custom_domain_properties, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
353
+ fail ArgumentError, 'custom_domain_name is nil' if custom_domain_name.nil?
354
+ fail ArgumentError, 'custom_domain_properties is nil' if custom_domain_properties.nil?
355
+ fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
356
+ fail ArgumentError, 'profile_name is nil' if profile_name.nil?
357
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
358
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
359
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
360
+
361
+
362
+ request_headers = {}
363
+
364
+ # Set Headers
365
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
366
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
367
+
368
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
369
+
370
+ # Serialize Request
371
+ request_mapper = Azure::CDN::Mgmt::V2015_06_01::Models::CustomDomainParameters.mapper()
372
+ request_content = @client.serialize(request_mapper, custom_domain_properties)
373
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
374
+
375
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}'
376
+
377
+ request_url = @base_url || @client.base_url
378
+
379
+ options = {
380
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
381
+ path_params: {'customDomainName' => custom_domain_name,'endpointName' => endpoint_name,'profileName' => profile_name,'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
382
+ query_params: {'api-version' => @client.api_version},
383
+ body: request_content,
384
+ headers: request_headers.merge(custom_headers || {}),
385
+ base_url: request_url
386
+ }
387
+ promise = @client.make_request_async(:patch, path_template, options)
388
+
389
+ promise = promise.then do |result|
390
+ http_response = result.response
391
+ status_code = http_response.status
392
+ response_content = http_response.body
393
+ unless status_code >= 200 && status_code < 300
394
+ error_model = JSON.load(response_content)
395
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
396
+ end
397
+
398
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
399
+ begin
400
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
401
+ result_mapper = Azure::CDN::Mgmt::V2015_06_01::Models::ErrorResponse.mapper()
402
+ result.body = @client.deserialize(result_mapper, parsed_response)
403
+ rescue Exception => e
404
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
405
+ end
406
+
407
+ result
408
+ end
409
+
410
+ promise.execute
411
+ end
412
+
413
+ #
414
+ # Deletes an existing CDN custom domain within an endpoint.
415
+ #
416
+ # @param custom_domain_name [String] Name of the custom domain within an
417
+ # endpoint.
418
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
419
+ # @param profile_name [String] Name of the CDN profile within the resource
420
+ # group.
421
+ # @param resource_group_name [String] Name of the resource group within the
422
+ # Azure subscription.
423
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
424
+ # will be added to the HTTP request.
425
+ #
426
+ # @return [CustomDomain] operation results.
427
+ #
428
+ def delete_if_exists(custom_domain_name, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
429
+ response = delete_if_exists_async(custom_domain_name, endpoint_name, profile_name, resource_group_name, custom_headers).value!
430
+ response.body unless response.nil?
431
+ end
432
+
433
+ #
434
+ # @param custom_domain_name [String] Name of the custom domain within an
435
+ # endpoint.
436
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
437
+ # @param profile_name [String] Name of the CDN profile within the resource
438
+ # group.
439
+ # @param resource_group_name [String] Name of the resource group within the
440
+ # Azure subscription.
441
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
442
+ # will be added to the HTTP request.
443
+ #
444
+ # @return [Concurrent::Promise] promise which provides async access to http
445
+ # response.
446
+ #
447
+ def delete_if_exists_async(custom_domain_name, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
448
+ # Send request
449
+ promise = begin_delete_if_exists_async(custom_domain_name, endpoint_name, profile_name, resource_group_name, custom_headers)
450
+
451
+ promise = promise.then do |response|
452
+ # Defining deserialization method.
453
+ deserialize_method = lambda do |parsed_response|
454
+ result_mapper = Azure::CDN::Mgmt::V2015_06_01::Models::CustomDomain.mapper()
455
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
456
+ end
457
+
458
+ # Waiting for response.
459
+ @client.get_long_running_operation_result(response, deserialize_method)
460
+ end
461
+
462
+ promise
463
+ end
464
+
465
+ #
466
+ # Creates a new CDN custom domain within an endpoint.
467
+ #
468
+ # @param custom_domain_name [String] Name of the custom domain within an
469
+ # endpoint.
470
+ # @param custom_domain_properties [CustomDomainParameters] Custom domain
471
+ # properties required for creation.
472
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
473
+ # @param profile_name [String] Name of the CDN profile within the resource
474
+ # group.
475
+ # @param resource_group_name [String] Name of the resource group within the
476
+ # Azure subscription.
477
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
478
+ # will be added to the HTTP request.
479
+ #
480
+ # @return [CustomDomain] operation results.
481
+ #
482
+ def begin_create(custom_domain_name, custom_domain_properties, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
483
+ response = begin_create_async(custom_domain_name, custom_domain_properties, endpoint_name, profile_name, resource_group_name, custom_headers).value!
484
+ response.body unless response.nil?
485
+ end
486
+
487
+ #
488
+ # Creates a new CDN custom domain within an endpoint.
489
+ #
490
+ # @param custom_domain_name [String] Name of the custom domain within an
491
+ # endpoint.
492
+ # @param custom_domain_properties [CustomDomainParameters] Custom domain
493
+ # properties required for creation.
494
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
495
+ # @param profile_name [String] Name of the CDN profile within the resource
496
+ # group.
497
+ # @param resource_group_name [String] Name of the resource group within the
498
+ # Azure subscription.
499
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
500
+ # will be added to the HTTP request.
501
+ #
502
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
503
+ #
504
+ def begin_create_with_http_info(custom_domain_name, custom_domain_properties, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
505
+ begin_create_async(custom_domain_name, custom_domain_properties, endpoint_name, profile_name, resource_group_name, custom_headers).value!
506
+ end
507
+
508
+ #
509
+ # Creates a new CDN custom domain within an endpoint.
510
+ #
511
+ # @param custom_domain_name [String] Name of the custom domain within an
512
+ # endpoint.
513
+ # @param custom_domain_properties [CustomDomainParameters] Custom domain
514
+ # properties required for creation.
515
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
516
+ # @param profile_name [String] Name of the CDN profile within the resource
517
+ # group.
518
+ # @param resource_group_name [String] Name of the resource group within the
519
+ # Azure subscription.
520
+ # @param [Hash{String => String}] A hash of custom headers that will be added
521
+ # to the HTTP request.
522
+ #
523
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
524
+ #
525
+ def begin_create_async(custom_domain_name, custom_domain_properties, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
526
+ fail ArgumentError, 'custom_domain_name is nil' if custom_domain_name.nil?
527
+ fail ArgumentError, 'custom_domain_properties is nil' if custom_domain_properties.nil?
528
+ fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
529
+ fail ArgumentError, 'profile_name is nil' if profile_name.nil?
530
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
531
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
532
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
533
+
534
+
535
+ request_headers = {}
536
+
537
+ # Set Headers
538
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
539
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
540
+
541
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
542
+
543
+ # Serialize Request
544
+ request_mapper = Azure::CDN::Mgmt::V2015_06_01::Models::CustomDomainParameters.mapper()
545
+ request_content = @client.serialize(request_mapper, custom_domain_properties)
546
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
547
+
548
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}'
549
+
550
+ request_url = @base_url || @client.base_url
551
+
552
+ options = {
553
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
554
+ path_params: {'customDomainName' => custom_domain_name,'endpointName' => endpoint_name,'profileName' => profile_name,'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
555
+ query_params: {'api-version' => @client.api_version},
556
+ body: request_content,
557
+ headers: request_headers.merge(custom_headers || {}),
558
+ base_url: request_url
559
+ }
560
+ promise = @client.make_request_async(:put, path_template, options)
561
+
562
+ promise = promise.then do |result|
563
+ http_response = result.response
564
+ status_code = http_response.status
565
+ response_content = http_response.body
566
+ unless status_code == 200 || status_code == 201 || status_code == 202
567
+ error_model = JSON.load(response_content)
568
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
569
+ end
570
+
571
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
572
+ # Deserialize Response
573
+ if status_code == 200
574
+ begin
575
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
576
+ result_mapper = Azure::CDN::Mgmt::V2015_06_01::Models::CustomDomain.mapper()
577
+ result.body = @client.deserialize(result_mapper, parsed_response)
578
+ rescue Exception => e
579
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
580
+ end
581
+ end
582
+ # Deserialize Response
583
+ if status_code == 201
584
+ begin
585
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
586
+ result_mapper = Azure::CDN::Mgmt::V2015_06_01::Models::CustomDomain.mapper()
587
+ result.body = @client.deserialize(result_mapper, parsed_response)
588
+ rescue Exception => e
589
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
590
+ end
591
+ end
592
+ # Deserialize Response
593
+ if status_code == 202
594
+ begin
595
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
596
+ result_mapper = Azure::CDN::Mgmt::V2015_06_01::Models::CustomDomain.mapper()
597
+ result.body = @client.deserialize(result_mapper, parsed_response)
598
+ rescue Exception => e
599
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
600
+ end
601
+ end
602
+
603
+ result
604
+ end
605
+
606
+ promise.execute
607
+ end
608
+
609
+ #
610
+ # Deletes an existing CDN custom domain within an endpoint.
611
+ #
612
+ # @param custom_domain_name [String] Name of the custom domain within an
613
+ # endpoint.
614
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
615
+ # @param profile_name [String] Name of the CDN profile within the resource
616
+ # group.
617
+ # @param resource_group_name [String] Name of the resource group within the
618
+ # Azure subscription.
619
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
620
+ # will be added to the HTTP request.
621
+ #
622
+ # @return [CustomDomain] operation results.
623
+ #
624
+ def begin_delete_if_exists(custom_domain_name, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
625
+ response = begin_delete_if_exists_async(custom_domain_name, endpoint_name, profile_name, resource_group_name, custom_headers).value!
626
+ response.body unless response.nil?
627
+ end
628
+
629
+ #
630
+ # Deletes an existing CDN custom domain within an endpoint.
631
+ #
632
+ # @param custom_domain_name [String] Name of the custom domain within an
633
+ # endpoint.
634
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
635
+ # @param profile_name [String] Name of the CDN profile within the resource
636
+ # group.
637
+ # @param resource_group_name [String] Name of the resource group within the
638
+ # Azure subscription.
639
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
640
+ # will be added to the HTTP request.
641
+ #
642
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
643
+ #
644
+ def begin_delete_if_exists_with_http_info(custom_domain_name, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
645
+ begin_delete_if_exists_async(custom_domain_name, endpoint_name, profile_name, resource_group_name, custom_headers).value!
646
+ end
647
+
648
+ #
649
+ # Deletes an existing CDN custom domain within an endpoint.
650
+ #
651
+ # @param custom_domain_name [String] Name of the custom domain within an
652
+ # endpoint.
653
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
654
+ # @param profile_name [String] Name of the CDN profile within the resource
655
+ # group.
656
+ # @param resource_group_name [String] Name of the resource group within the
657
+ # Azure subscription.
658
+ # @param [Hash{String => String}] A hash of custom headers that will be added
659
+ # to the HTTP request.
660
+ #
661
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
662
+ #
663
+ def begin_delete_if_exists_async(custom_domain_name, endpoint_name, profile_name, resource_group_name, custom_headers = nil)
664
+ fail ArgumentError, 'custom_domain_name is nil' if custom_domain_name.nil?
665
+ fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
666
+ fail ArgumentError, 'profile_name is nil' if profile_name.nil?
667
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
668
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
669
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
670
+
671
+
672
+ request_headers = {}
673
+
674
+ # Set Headers
675
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
676
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
677
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}'
678
+
679
+ request_url = @base_url || @client.base_url
680
+
681
+ options = {
682
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
683
+ path_params: {'customDomainName' => custom_domain_name,'endpointName' => endpoint_name,'profileName' => profile_name,'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
684
+ query_params: {'api-version' => @client.api_version},
685
+ headers: request_headers.merge(custom_headers || {}),
686
+ base_url: request_url
687
+ }
688
+ promise = @client.make_request_async(:delete, path_template, options)
689
+
690
+ promise = promise.then do |result|
691
+ http_response = result.response
692
+ status_code = http_response.status
693
+ response_content = http_response.body
694
+ unless status_code == 200 || status_code == 202 || status_code == 204
695
+ error_model = JSON.load(response_content)
696
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
697
+ end
698
+
699
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
700
+ # Deserialize Response
701
+ if status_code == 202
702
+ begin
703
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
704
+ result_mapper = Azure::CDN::Mgmt::V2015_06_01::Models::CustomDomain.mapper()
705
+ result.body = @client.deserialize(result_mapper, parsed_response)
706
+ rescue Exception => e
707
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
708
+ end
709
+ end
710
+
711
+ result
712
+ end
713
+
714
+ promise.execute
715
+ end
716
+
717
+ end
718
+ end