azure_mgmt_cdn 0.15.2 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (154) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2015-06-01/generated/azure_mgmt_cdn/cdn_management_client.rb +4 -1
  3. data/lib/2015-06-01/generated/azure_mgmt_cdn/custom_domains.rb +38 -37
  4. data/lib/2015-06-01/generated/azure_mgmt_cdn/endpoints.rb +88 -88
  5. data/lib/2015-06-01/generated/azure_mgmt_cdn/name_availability.rb +6 -7
  6. data/lib/2015-06-01/generated/azure_mgmt_cdn/operations.rb +6 -5
  7. data/lib/2015-06-01/generated/azure_mgmt_cdn/origins.rb +42 -41
  8. data/lib/2015-06-01/generated/azure_mgmt_cdn/profiles.rb +54 -51
  9. data/lib/2016-04-02/generated/azure_mgmt_cdn.rb +70 -0
  10. data/lib/2016-04-02/generated/azure_mgmt_cdn/cdn_management_client.rb +151 -0
  11. data/lib/2016-04-02/generated/azure_mgmt_cdn/custom_domains.rb +719 -0
  12. data/lib/2016-04-02/generated/azure_mgmt_cdn/endpoints.rb +1456 -0
  13. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/check_name_availability_input.rb +60 -0
  14. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/check_name_availability_output.rb +69 -0
  15. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/custom_domain.rb +103 -0
  16. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/custom_domain_list_result.rb +57 -0
  17. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/custom_domain_parameters.rb +47 -0
  18. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/custom_domain_resource_state.rb +17 -0
  19. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/deep_created_origin.rb +82 -0
  20. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/endpoint.rb +249 -0
  21. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/endpoint_create_parameters.rb +185 -0
  22. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/endpoint_list_result.rb +56 -0
  23. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/endpoint_resource_state.rb +20 -0
  24. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/endpoint_update_parameters.rb +152 -0
  25. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/error_response.rb +58 -0
  26. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/load_parameters.rb +55 -0
  27. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/operation.rb +58 -0
  28. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/operation_display.rb +70 -0
  29. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/operation_list_result.rb +57 -0
  30. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/origin.rb +128 -0
  31. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/origin_list_result.rb +56 -0
  32. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/origin_parameters.rb +71 -0
  33. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/origin_resource_state.rb +17 -0
  34. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/profile.rb +128 -0
  35. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/profile_create_parameters.rb +77 -0
  36. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/profile_list_result.rb +56 -0
  37. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/profile_resource_state.rb +18 -0
  38. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/profile_update_parameters.rb +54 -0
  39. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/provisioning_state.rb +17 -0
  40. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/purge_parameters.rb +55 -0
  41. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/query_string_caching_behavior.rb +18 -0
  42. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/resource.rb +72 -0
  43. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/resource_type.rb +15 -0
  44. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/sku.rb +49 -0
  45. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/sku_name.rb +18 -0
  46. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/sso_uri.rb +46 -0
  47. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/tracked_resource.rb +92 -0
  48. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/validate_custom_domain_input.rb +47 -0
  49. data/lib/2016-04-02/generated/azure_mgmt_cdn/models/validate_custom_domain_output.rb +70 -0
  50. data/lib/2016-04-02/generated/azure_mgmt_cdn/module_definition.rb +9 -0
  51. data/lib/2016-04-02/generated/azure_mgmt_cdn/name_availability.rb +130 -0
  52. data/lib/2016-04-02/generated/azure_mgmt_cdn/operations.rb +110 -0
  53. data/lib/2016-04-02/generated/azure_mgmt_cdn/origins.rb +778 -0
  54. data/lib/2016-04-02/generated/azure_mgmt_cdn/profiles.rb +899 -0
  55. data/lib/2016-10-02/generated/azure_mgmt_cdn/cdn_management_client.rb +46 -38
  56. data/lib/2016-10-02/generated/azure_mgmt_cdn/custom_domains.rb +53 -48
  57. data/lib/2016-10-02/generated/azure_mgmt_cdn/edge_nodes.rb +15 -13
  58. data/lib/2016-10-02/generated/azure_mgmt_cdn/endpoints.rb +112 -109
  59. data/lib/2016-10-02/generated/azure_mgmt_cdn/origins.rb +31 -29
  60. data/lib/2016-10-02/generated/azure_mgmt_cdn/profiles.rb +93 -85
  61. data/lib/2017-04-02/generated/azure_mgmt_cdn.rb +18 -16
  62. data/lib/2017-04-02/generated/azure_mgmt_cdn/cdn_management_client.rb +16 -15
  63. data/lib/2017-04-02/generated/azure_mgmt_cdn/custom_domains.rb +53 -48
  64. data/lib/2017-04-02/generated/azure_mgmt_cdn/edge_nodes.rb +15 -13
  65. data/lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb +136 -113
  66. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/custom_domain.rb +1 -25
  67. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/edge_node.rb +1 -25
  68. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/endpoint.rb +6 -3
  69. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/endpoint_update_parameters.rb +5 -2
  70. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/origin.rb +1 -1
  71. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/profile.rb +1 -1
  72. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/profile_update_parameters.rb +1 -1
  73. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/proxy_resource.rb +63 -0
  74. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/resource.rb +1 -31
  75. data/lib/2017-04-02/generated/azure_mgmt_cdn/models/tracked_resource.rb +92 -0
  76. data/lib/2017-04-02/generated/azure_mgmt_cdn/operations.rb +15 -13
  77. data/lib/2017-04-02/generated/azure_mgmt_cdn/origins.rb +31 -29
  78. data/lib/2017-04-02/generated/azure_mgmt_cdn/profiles.rb +93 -85
  79. data/lib/2017-04-02/generated/azure_mgmt_cdn/resource_usage_operations.rb +15 -13
  80. data/lib/2017-10-12/generated/azure_mgmt_cdn.rb +93 -0
  81. data/lib/2017-10-12/generated/azure_mgmt_cdn/cdn_management_client.rb +358 -0
  82. data/lib/2017-10-12/generated/azure_mgmt_cdn/custom_domains.rb +970 -0
  83. data/lib/2017-10-12/generated/azure_mgmt_cdn/edge_nodes.rb +223 -0
  84. data/lib/2017-10-12/generated/azure_mgmt_cdn/endpoints.rb +1922 -0
  85. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/cache_expiration_action_parameters.rb +89 -0
  86. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/check_name_availability_input.rb +60 -0
  87. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/check_name_availability_output.rb +72 -0
  88. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/cidr_ip_address.rb +57 -0
  89. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/custom_domain.rb +148 -0
  90. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/custom_domain_list_result.rb +102 -0
  91. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/custom_domain_parameters.rb +48 -0
  92. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/custom_domain_resource_state.rb +17 -0
  93. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/custom_https_provisioning_state.rb +19 -0
  94. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/custom_https_provisioning_substate.rb +24 -0
  95. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/deep_created_origin.rb +91 -0
  96. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/delivery_rule.rb +96 -0
  97. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/delivery_rule_action.rb +46 -0
  98. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/delivery_rule_cache_expiration_action.rb +64 -0
  99. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/delivery_rule_condition.rb +47 -0
  100. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/delivery_rule_url_file_extension_condition.rb +64 -0
  101. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/delivery_rule_url_path_condition.rb +64 -0
  102. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/edge_node.rb +83 -0
  103. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/edgenode_result.rb +101 -0
  104. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/endpoint.rb +318 -0
  105. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/endpoint_list_result.rb +101 -0
  106. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/endpoint_properties_update_parameters_delivery_policy.rb +67 -0
  107. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/endpoint_resource_state.rb +20 -0
  108. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/endpoint_update_parameters.rb +223 -0
  109. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/error_response.rb +60 -0
  110. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/geo_filter.rb +80 -0
  111. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/geo_filter_actions.rb +16 -0
  112. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/ip_address_group.rb +86 -0
  113. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/load_parameters.rb +55 -0
  114. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/operation.rb +59 -0
  115. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/operation_display.rb +72 -0
  116. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/operations_list_result.rb +102 -0
  117. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/optimization_type.rb +19 -0
  118. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/origin.rb +158 -0
  119. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/origin_list_result.rb +101 -0
  120. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/origin_resource_state.rb +17 -0
  121. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/origin_update_parameters.rb +79 -0
  122. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/profile.rb +125 -0
  123. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/profile_list_result.rb +101 -0
  124. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/profile_resource_state.rb +18 -0
  125. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/profile_update_parameters.rb +54 -0
  126. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/proxy_resource.rb +63 -0
  127. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/purge_parameters.rb +55 -0
  128. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/query_string_caching_behavior.rb +18 -0
  129. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/resource.rb +71 -0
  130. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/resource_type.rb +15 -0
  131. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/resource_usage.rb +83 -0
  132. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/resource_usage_list_result.rb +100 -0
  133. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/sku.rb +49 -0
  134. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/sku_name.rb +19 -0
  135. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/sso_uri.rb +48 -0
  136. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/supported_optimization_types_list_result.rb +56 -0
  137. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/tracked_resource.rb +92 -0
  138. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/url_file_extension_condition_parameters.rb +70 -0
  139. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/url_path_condition_parameters.rb +72 -0
  140. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/validate_custom_domain_input.rb +47 -0
  141. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/validate_custom_domain_output.rb +72 -0
  142. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/validate_probe_input.rb +46 -0
  143. data/lib/2017-10-12/generated/azure_mgmt_cdn/models/validate_probe_output.rb +73 -0
  144. data/lib/2017-10-12/generated/azure_mgmt_cdn/module_definition.rb +9 -0
  145. data/lib/2017-10-12/generated/azure_mgmt_cdn/operations.rb +217 -0
  146. data/lib/2017-10-12/generated/azure_mgmt_cdn/origins.rb +556 -0
  147. data/lib/2017-10-12/generated/azure_mgmt_cdn/profiles.rb +1460 -0
  148. data/lib/2017-10-12/generated/azure_mgmt_cdn/resource_usage_operations.rb +226 -0
  149. data/lib/azure_mgmt_cdn.rb +2 -0
  150. data/lib/profiles/latest/cdn_latest_profile_client.rb +28 -9
  151. data/lib/profiles/latest/cdn_module_definition.rb +0 -1
  152. data/lib/profiles/latest/modules/cdn_profile_module.rb +277 -210
  153. data/lib/version.rb +1 -1
  154. metadata +119 -2
@@ -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 '2016-04-02/generated/azure_mgmt_cdn/module_definition'
20
+ require 'ms_rest_azure'
21
+
22
+ module Azure::CDN::Mgmt::V2016_04_02
23
+ autoload :Profiles, '2016-04-02/generated/azure_mgmt_cdn/profiles.rb'
24
+ autoload :Endpoints, '2016-04-02/generated/azure_mgmt_cdn/endpoints.rb'
25
+ autoload :Origins, '2016-04-02/generated/azure_mgmt_cdn/origins.rb'
26
+ autoload :CustomDomains, '2016-04-02/generated/azure_mgmt_cdn/custom_domains.rb'
27
+ autoload :NameAvailability, '2016-04-02/generated/azure_mgmt_cdn/name_availability.rb'
28
+ autoload :Operations, '2016-04-02/generated/azure_mgmt_cdn/operations.rb'
29
+ autoload :CdnManagementClient, '2016-04-02/generated/azure_mgmt_cdn/cdn_management_client.rb'
30
+
31
+ module Models
32
+ autoload :OriginParameters, '2016-04-02/generated/azure_mgmt_cdn/models/origin_parameters.rb'
33
+ autoload :OriginListResult, '2016-04-02/generated/azure_mgmt_cdn/models/origin_list_result.rb'
34
+ autoload :ErrorResponse, '2016-04-02/generated/azure_mgmt_cdn/models/error_response.rb'
35
+ autoload :Sku, '2016-04-02/generated/azure_mgmt_cdn/models/sku.rb'
36
+ autoload :ProfileCreateParameters, '2016-04-02/generated/azure_mgmt_cdn/models/profile_create_parameters.rb'
37
+ autoload :Resource, '2016-04-02/generated/azure_mgmt_cdn/models/resource.rb'
38
+ autoload :SsoUri, '2016-04-02/generated/azure_mgmt_cdn/models/sso_uri.rb'
39
+ autoload :DeepCreatedOrigin, '2016-04-02/generated/azure_mgmt_cdn/models/deep_created_origin.rb'
40
+ autoload :OperationListResult, '2016-04-02/generated/azure_mgmt_cdn/models/operation_list_result.rb'
41
+ autoload :EndpointListResult, '2016-04-02/generated/azure_mgmt_cdn/models/endpoint_list_result.rb'
42
+ autoload :CustomDomainParameters, '2016-04-02/generated/azure_mgmt_cdn/models/custom_domain_parameters.rb'
43
+ autoload :EndpointUpdateParameters, '2016-04-02/generated/azure_mgmt_cdn/models/endpoint_update_parameters.rb'
44
+ autoload :CustomDomainListResult, '2016-04-02/generated/azure_mgmt_cdn/models/custom_domain_list_result.rb'
45
+ autoload :LoadParameters, '2016-04-02/generated/azure_mgmt_cdn/models/load_parameters.rb'
46
+ autoload :ValidateCustomDomainInput, '2016-04-02/generated/azure_mgmt_cdn/models/validate_custom_domain_input.rb'
47
+ autoload :ProfileUpdateParameters, '2016-04-02/generated/azure_mgmt_cdn/models/profile_update_parameters.rb'
48
+ autoload :ValidateCustomDomainOutput, '2016-04-02/generated/azure_mgmt_cdn/models/validate_custom_domain_output.rb'
49
+ autoload :EndpointCreateParameters, '2016-04-02/generated/azure_mgmt_cdn/models/endpoint_create_parameters.rb'
50
+ autoload :CheckNameAvailabilityInput, '2016-04-02/generated/azure_mgmt_cdn/models/check_name_availability_input.rb'
51
+ autoload :ProfileListResult, '2016-04-02/generated/azure_mgmt_cdn/models/profile_list_result.rb'
52
+ autoload :CheckNameAvailabilityOutput, '2016-04-02/generated/azure_mgmt_cdn/models/check_name_availability_output.rb'
53
+ autoload :PurgeParameters, '2016-04-02/generated/azure_mgmt_cdn/models/purge_parameters.rb'
54
+ autoload :OperationDisplay, '2016-04-02/generated/azure_mgmt_cdn/models/operation_display.rb'
55
+ autoload :Operation, '2016-04-02/generated/azure_mgmt_cdn/models/operation.rb'
56
+ autoload :TrackedResource, '2016-04-02/generated/azure_mgmt_cdn/models/tracked_resource.rb'
57
+ autoload :Profile, '2016-04-02/generated/azure_mgmt_cdn/models/profile.rb'
58
+ autoload :Endpoint, '2016-04-02/generated/azure_mgmt_cdn/models/endpoint.rb'
59
+ autoload :Origin, '2016-04-02/generated/azure_mgmt_cdn/models/origin.rb'
60
+ autoload :CustomDomain, '2016-04-02/generated/azure_mgmt_cdn/models/custom_domain.rb'
61
+ autoload :SkuName, '2016-04-02/generated/azure_mgmt_cdn/models/sku_name.rb'
62
+ autoload :ProfileResourceState, '2016-04-02/generated/azure_mgmt_cdn/models/profile_resource_state.rb'
63
+ autoload :ProvisioningState, '2016-04-02/generated/azure_mgmt_cdn/models/provisioning_state.rb'
64
+ autoload :QueryStringCachingBehavior, '2016-04-02/generated/azure_mgmt_cdn/models/query_string_caching_behavior.rb'
65
+ autoload :EndpointResourceState, '2016-04-02/generated/azure_mgmt_cdn/models/endpoint_resource_state.rb'
66
+ autoload :OriginResourceState, '2016-04-02/generated/azure_mgmt_cdn/models/origin_resource_state.rb'
67
+ autoload :CustomDomainResourceState, '2016-04-02/generated/azure_mgmt_cdn/models/custom_domain_resource_state.rb'
68
+ autoload :ResourceType, '2016-04-02/generated/azure_mgmt_cdn/models/resource_type.rb'
69
+ end
70
+ end
@@ -0,0 +1,151 @@
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::V2016_04_02
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 2016-04-02
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 = '2016-04-02'
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
+ if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
129
+ @request_headers['Content-Type'] = options[:headers]['Content-Type']
130
+ end
131
+
132
+ request_headers = @request_headers
133
+ request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
134
+ options.merge!({headers: request_headers.merge(options[:headers] || {})})
135
+ options.merge!({credentials: @credentials}) unless @credentials.nil?
136
+
137
+ super(request_url, method, path, options)
138
+ end
139
+
140
+
141
+ private
142
+ #
143
+ # Adds telemetry information.
144
+ #
145
+ def add_telemetry
146
+ sdk_information = 'azure_mgmt_cdn'
147
+ sdk_information = "#{sdk_information}/0.16.0"
148
+ add_user_agent_information(sdk_information)
149
+ end
150
+ end
151
+ end
@@ -0,0 +1,719 @@
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::V2016_04_02
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: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: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
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
85
+
86
+ # Set Headers
87
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
88
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
89
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains'
90
+
91
+ request_url = @base_url || @client.base_url
92
+
93
+ options = {
94
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
95
+ path_params: {'endpointName' => endpoint_name,'profileName' => profile_name,'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
96
+ query_params: {'api-version' => @client.api_version},
97
+ headers: request_headers.merge(custom_headers || {}),
98
+ base_url: request_url
99
+ }
100
+ promise = @client.make_request_async(:get, path_template, options)
101
+
102
+ promise = promise.then do |result|
103
+ http_response = result.response
104
+ status_code = http_response.status
105
+ response_content = http_response.body
106
+ unless status_code == 200
107
+ error_model = JSON.load(response_content)
108
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
109
+ end
110
+
111
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
112
+ # Deserialize Response
113
+ if status_code == 200
114
+ begin
115
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
116
+ result_mapper = Azure::CDN::Mgmt::V2016_04_02::Models::CustomDomainListResult.mapper()
117
+ result.body = @client.deserialize(result_mapper, parsed_response)
118
+ rescue Exception => e
119
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
120
+ end
121
+ end
122
+
123
+ result
124
+ end
125
+
126
+ promise.execute
127
+ end
128
+
129
+ #
130
+ # Gets an existing CDN custom domain within an endpoint.
131
+ #
132
+ # @param custom_domain_name [String] Name of the custom domain within an
133
+ # endpoint.
134
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
135
+ # @param profile_name [String] Name of the CDN profile within the resource
136
+ # group.
137
+ # @param resource_group_name [String] Name of the resource group within the
138
+ # Azure subscription.
139
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
140
+ # will be added to the HTTP request.
141
+ #
142
+ # @return [CustomDomain] operation results.
143
+ #
144
+ def get(custom_domain_name, endpoint_name, profile_name, resource_group_name, custom_headers:nil)
145
+ response = get_async(custom_domain_name, endpoint_name, profile_name, resource_group_name, custom_headers:custom_headers).value!
146
+ response.body unless response.nil?
147
+ end
148
+
149
+ #
150
+ # Gets an existing CDN custom domain within an endpoint.
151
+ #
152
+ # @param custom_domain_name [String] Name of the custom domain within an
153
+ # endpoint.
154
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
155
+ # @param profile_name [String] Name of the CDN profile within the resource
156
+ # group.
157
+ # @param resource_group_name [String] Name of the resource group within the
158
+ # Azure subscription.
159
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
160
+ # will be added to the HTTP request.
161
+ #
162
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
163
+ #
164
+ def get_with_http_info(custom_domain_name, endpoint_name, profile_name, resource_group_name, custom_headers:nil)
165
+ get_async(custom_domain_name, endpoint_name, profile_name, resource_group_name, custom_headers:custom_headers).value!
166
+ end
167
+
168
+ #
169
+ # Gets an existing CDN custom domain within an endpoint.
170
+ #
171
+ # @param custom_domain_name [String] Name of the custom domain within an
172
+ # endpoint.
173
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
174
+ # @param profile_name [String] Name of the CDN profile within the resource
175
+ # group.
176
+ # @param resource_group_name [String] Name of the resource group within the
177
+ # Azure subscription.
178
+ # @param [Hash{String => String}] A hash of custom headers that will be added
179
+ # to the HTTP request.
180
+ #
181
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
182
+ #
183
+ def get_async(custom_domain_name, endpoint_name, profile_name, resource_group_name, custom_headers:nil)
184
+ fail ArgumentError, 'custom_domain_name is nil' if custom_domain_name.nil?
185
+ fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
186
+ fail ArgumentError, 'profile_name is nil' if profile_name.nil?
187
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
188
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
189
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
190
+
191
+
192
+ request_headers = {}
193
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
194
+
195
+ # Set Headers
196
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
197
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
198
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}'
199
+
200
+ request_url = @base_url || @client.base_url
201
+
202
+ options = {
203
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
204
+ path_params: {'customDomainName' => custom_domain_name,'endpointName' => endpoint_name,'profileName' => profile_name,'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
205
+ query_params: {'api-version' => @client.api_version},
206
+ headers: request_headers.merge(custom_headers || {}),
207
+ base_url: request_url
208
+ }
209
+ promise = @client.make_request_async(:get, path_template, options)
210
+
211
+ promise = promise.then do |result|
212
+ http_response = result.response
213
+ status_code = http_response.status
214
+ response_content = http_response.body
215
+ unless status_code == 200
216
+ error_model = JSON.load(response_content)
217
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
218
+ end
219
+
220
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
221
+ # Deserialize Response
222
+ if status_code == 200
223
+ begin
224
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
225
+ result_mapper = Azure::CDN::Mgmt::V2016_04_02::Models::CustomDomain.mapper()
226
+ result.body = @client.deserialize(result_mapper, parsed_response)
227
+ rescue Exception => e
228
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
229
+ end
230
+ end
231
+
232
+ result
233
+ end
234
+
235
+ promise.execute
236
+ end
237
+
238
+ #
239
+ # Creates a new CDN custom domain within an endpoint.
240
+ #
241
+ # @param custom_domain_name [String] Name of the custom domain within an
242
+ # endpoint.
243
+ # @param custom_domain_properties [CustomDomainParameters] Custom domain
244
+ # properties required for creation.
245
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
246
+ # @param profile_name [String] Name of the CDN profile within the resource
247
+ # group.
248
+ # @param resource_group_name [String] Name of the resource group within the
249
+ # Azure subscription.
250
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
251
+ # will be added to the HTTP request.
252
+ #
253
+ # @return [CustomDomain] operation results.
254
+ #
255
+ def create(custom_domain_name, custom_domain_properties, endpoint_name, profile_name, resource_group_name, custom_headers:nil)
256
+ response = create_async(custom_domain_name, custom_domain_properties, endpoint_name, profile_name, resource_group_name, custom_headers:custom_headers).value!
257
+ response.body unless response.nil?
258
+ end
259
+
260
+ #
261
+ # @param custom_domain_name [String] Name of the custom domain within an
262
+ # endpoint.
263
+ # @param custom_domain_properties [CustomDomainParameters] Custom domain
264
+ # properties required for creation.
265
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
266
+ # @param profile_name [String] Name of the CDN profile within the resource
267
+ # group.
268
+ # @param resource_group_name [String] Name of the resource group within the
269
+ # Azure subscription.
270
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
271
+ # will be added to the HTTP request.
272
+ #
273
+ # @return [Concurrent::Promise] promise which provides async access to http
274
+ # response.
275
+ #
276
+ def create_async(custom_domain_name, custom_domain_properties, endpoint_name, profile_name, resource_group_name, custom_headers:nil)
277
+ # Send request
278
+ promise = begin_create_async(custom_domain_name, custom_domain_properties, endpoint_name, profile_name, resource_group_name, custom_headers:custom_headers)
279
+
280
+ promise = promise.then do |response|
281
+ # Defining deserialization method.
282
+ deserialize_method = lambda do |parsed_response|
283
+ result_mapper = Azure::CDN::Mgmt::V2016_04_02::Models::CustomDomain.mapper()
284
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
285
+ end
286
+
287
+ # Waiting for response.
288
+ @client.get_long_running_operation_result(response, deserialize_method)
289
+ end
290
+
291
+ promise
292
+ end
293
+
294
+ #
295
+ # Updates an existing CDN custom domain within an endpoint.
296
+ #
297
+ # @param custom_domain_name [String] Name of the custom domain within an
298
+ # endpoint.
299
+ # @param custom_domain_properties [CustomDomainParameters] Custom domain
300
+ # properties to update.
301
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
302
+ # @param profile_name [String] Name of the CDN profile within the resource
303
+ # group.
304
+ # @param resource_group_name [String] Name of the resource group within the
305
+ # Azure subscription.
306
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
307
+ # will be added to the HTTP request.
308
+ #
309
+ # @return [ErrorResponse] operation results.
310
+ #
311
+ def update(custom_domain_name, custom_domain_properties, endpoint_name, profile_name, resource_group_name, custom_headers:nil)
312
+ response = update_async(custom_domain_name, custom_domain_properties, endpoint_name, profile_name, resource_group_name, custom_headers:custom_headers).value!
313
+ response.body unless response.nil?
314
+ end
315
+
316
+ #
317
+ # Updates an existing CDN custom domain within an endpoint.
318
+ #
319
+ # @param custom_domain_name [String] Name of the custom domain within an
320
+ # endpoint.
321
+ # @param custom_domain_properties [CustomDomainParameters] Custom domain
322
+ # properties to update.
323
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
324
+ # @param profile_name [String] Name of the CDN profile within the resource
325
+ # group.
326
+ # @param resource_group_name [String] Name of the resource group within the
327
+ # Azure subscription.
328
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
329
+ # will be added to the HTTP request.
330
+ #
331
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
332
+ #
333
+ def update_with_http_info(custom_domain_name, custom_domain_properties, endpoint_name, profile_name, resource_group_name, custom_headers:nil)
334
+ update_async(custom_domain_name, custom_domain_properties, endpoint_name, profile_name, resource_group_name, custom_headers:custom_headers).value!
335
+ end
336
+
337
+ #
338
+ # Updates an existing CDN custom domain within an endpoint.
339
+ #
340
+ # @param custom_domain_name [String] Name of the custom domain within an
341
+ # endpoint.
342
+ # @param custom_domain_properties [CustomDomainParameters] Custom domain
343
+ # properties to update.
344
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
345
+ # @param profile_name [String] Name of the CDN profile within the resource
346
+ # group.
347
+ # @param resource_group_name [String] Name of the resource group within the
348
+ # Azure subscription.
349
+ # @param [Hash{String => String}] A hash of custom headers that will be added
350
+ # to the HTTP request.
351
+ #
352
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
353
+ #
354
+ def update_async(custom_domain_name, custom_domain_properties, endpoint_name, profile_name, resource_group_name, custom_headers:nil)
355
+ fail ArgumentError, 'custom_domain_name is nil' if custom_domain_name.nil?
356
+ fail ArgumentError, 'custom_domain_properties is nil' if custom_domain_properties.nil?
357
+ fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
358
+ fail ArgumentError, 'profile_name is nil' if profile_name.nil?
359
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
360
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
361
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
362
+
363
+
364
+ request_headers = {}
365
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
366
+
367
+ # Set Headers
368
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
369
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
370
+
371
+ # Serialize Request
372
+ request_mapper = Azure::CDN::Mgmt::V2016_04_02::Models::CustomDomainParameters.mapper()
373
+ request_content = @client.serialize(request_mapper, custom_domain_properties)
374
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
375
+
376
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}'
377
+
378
+ request_url = @base_url || @client.base_url
379
+
380
+ options = {
381
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
382
+ path_params: {'customDomainName' => custom_domain_name,'endpointName' => endpoint_name,'profileName' => profile_name,'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
383
+ query_params: {'api-version' => @client.api_version},
384
+ body: request_content,
385
+ headers: request_headers.merge(custom_headers || {}),
386
+ base_url: request_url
387
+ }
388
+ promise = @client.make_request_async(:patch, path_template, options)
389
+
390
+ promise = promise.then do |result|
391
+ http_response = result.response
392
+ status_code = http_response.status
393
+ response_content = http_response.body
394
+ unless status_code >= 200 && status_code < 300
395
+ error_model = JSON.load(response_content)
396
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
397
+ end
398
+
399
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
400
+ begin
401
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
402
+ result_mapper = Azure::CDN::Mgmt::V2016_04_02::Models::ErrorResponse.mapper()
403
+ result.body = @client.deserialize(result_mapper, parsed_response)
404
+ rescue Exception => e
405
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
406
+ end
407
+
408
+ result
409
+ end
410
+
411
+ promise.execute
412
+ end
413
+
414
+ #
415
+ # Deletes an existing CDN custom domain within an endpoint.
416
+ #
417
+ # @param custom_domain_name [String] Name of the custom domain within an
418
+ # endpoint.
419
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
420
+ # @param profile_name [String] Name of the CDN profile within the resource
421
+ # group.
422
+ # @param resource_group_name [String] Name of the resource group within the
423
+ # Azure subscription.
424
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
425
+ # will be added to the HTTP request.
426
+ #
427
+ # @return [CustomDomain] operation results.
428
+ #
429
+ def delete_if_exists(custom_domain_name, endpoint_name, profile_name, resource_group_name, custom_headers:nil)
430
+ response = delete_if_exists_async(custom_domain_name, endpoint_name, profile_name, resource_group_name, custom_headers:custom_headers).value!
431
+ response.body unless response.nil?
432
+ end
433
+
434
+ #
435
+ # @param custom_domain_name [String] Name of the custom domain within an
436
+ # endpoint.
437
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
438
+ # @param profile_name [String] Name of the CDN profile within the resource
439
+ # group.
440
+ # @param resource_group_name [String] Name of the resource group within the
441
+ # Azure subscription.
442
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
443
+ # will be added to the HTTP request.
444
+ #
445
+ # @return [Concurrent::Promise] promise which provides async access to http
446
+ # response.
447
+ #
448
+ def delete_if_exists_async(custom_domain_name, endpoint_name, profile_name, resource_group_name, custom_headers:nil)
449
+ # Send request
450
+ promise = begin_delete_if_exists_async(custom_domain_name, endpoint_name, profile_name, resource_group_name, custom_headers:custom_headers)
451
+
452
+ promise = promise.then do |response|
453
+ # Defining deserialization method.
454
+ deserialize_method = lambda do |parsed_response|
455
+ result_mapper = Azure::CDN::Mgmt::V2016_04_02::Models::CustomDomain.mapper()
456
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
457
+ end
458
+
459
+ # Waiting for response.
460
+ @client.get_long_running_operation_result(response, deserialize_method)
461
+ end
462
+
463
+ promise
464
+ end
465
+
466
+ #
467
+ # Creates a new CDN custom domain within an endpoint.
468
+ #
469
+ # @param custom_domain_name [String] Name of the custom domain within an
470
+ # endpoint.
471
+ # @param custom_domain_properties [CustomDomainParameters] Custom domain
472
+ # properties required for creation.
473
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
474
+ # @param profile_name [String] Name of the CDN profile within the resource
475
+ # group.
476
+ # @param resource_group_name [String] Name of the resource group within the
477
+ # Azure subscription.
478
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
479
+ # will be added to the HTTP request.
480
+ #
481
+ # @return [CustomDomain] operation results.
482
+ #
483
+ def begin_create(custom_domain_name, custom_domain_properties, endpoint_name, profile_name, resource_group_name, custom_headers:nil)
484
+ response = begin_create_async(custom_domain_name, custom_domain_properties, endpoint_name, profile_name, resource_group_name, custom_headers:custom_headers).value!
485
+ response.body unless response.nil?
486
+ end
487
+
488
+ #
489
+ # Creates a new CDN custom domain within an endpoint.
490
+ #
491
+ # @param custom_domain_name [String] Name of the custom domain within an
492
+ # endpoint.
493
+ # @param custom_domain_properties [CustomDomainParameters] Custom domain
494
+ # properties required for creation.
495
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
496
+ # @param profile_name [String] Name of the CDN profile within the resource
497
+ # group.
498
+ # @param resource_group_name [String] Name of the resource group within the
499
+ # Azure subscription.
500
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
501
+ # will be added to the HTTP request.
502
+ #
503
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
504
+ #
505
+ def begin_create_with_http_info(custom_domain_name, custom_domain_properties, endpoint_name, profile_name, resource_group_name, custom_headers:nil)
506
+ begin_create_async(custom_domain_name, custom_domain_properties, endpoint_name, profile_name, resource_group_name, custom_headers:custom_headers).value!
507
+ end
508
+
509
+ #
510
+ # Creates a new CDN custom domain within an endpoint.
511
+ #
512
+ # @param custom_domain_name [String] Name of the custom domain within an
513
+ # endpoint.
514
+ # @param custom_domain_properties [CustomDomainParameters] Custom domain
515
+ # properties required for creation.
516
+ # @param endpoint_name [String] Name of the endpoint within the CDN profile.
517
+ # @param profile_name [String] Name of the CDN profile within the resource
518
+ # group.
519
+ # @param resource_group_name [String] Name of the resource group within the
520
+ # Azure subscription.
521
+ # @param [Hash{String => String}] A hash of custom headers that will be added
522
+ # to the HTTP request.
523
+ #
524
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
525
+ #
526
+ def begin_create_async(custom_domain_name, custom_domain_properties, endpoint_name, profile_name, resource_group_name, custom_headers:nil)
527
+ fail ArgumentError, 'custom_domain_name is nil' if custom_domain_name.nil?
528
+ fail ArgumentError, 'custom_domain_properties is nil' if custom_domain_properties.nil?
529
+ fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil?
530
+ fail ArgumentError, 'profile_name is nil' if profile_name.nil?
531
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
532
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
533
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
534
+
535
+
536
+ request_headers = {}
537
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
538
+
539
+ # Set Headers
540
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
541
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
542
+
543
+ # Serialize Request
544
+ request_mapper = Azure::CDN::Mgmt::V2016_04_02::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::V2016_04_02::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::V2016_04_02::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::V2016_04_02::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: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: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
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
674
+
675
+ # Set Headers
676
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
677
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
678
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}'
679
+
680
+ request_url = @base_url || @client.base_url
681
+
682
+ options = {
683
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
684
+ path_params: {'customDomainName' => custom_domain_name,'endpointName' => endpoint_name,'profileName' => profile_name,'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
685
+ query_params: {'api-version' => @client.api_version},
686
+ headers: request_headers.merge(custom_headers || {}),
687
+ base_url: request_url
688
+ }
689
+ promise = @client.make_request_async(:delete, path_template, options)
690
+
691
+ promise = promise.then do |result|
692
+ http_response = result.response
693
+ status_code = http_response.status
694
+ response_content = http_response.body
695
+ unless status_code == 200 || status_code == 202 || status_code == 204
696
+ error_model = JSON.load(response_content)
697
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
698
+ end
699
+
700
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
701
+ # Deserialize Response
702
+ if status_code == 202
703
+ begin
704
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
705
+ result_mapper = Azure::CDN::Mgmt::V2016_04_02::Models::CustomDomain.mapper()
706
+ result.body = @client.deserialize(result_mapper, parsed_response)
707
+ rescue Exception => e
708
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
709
+ end
710
+ end
711
+
712
+ result
713
+ end
714
+
715
+ promise.execute
716
+ end
717
+
718
+ end
719
+ end