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,899 @@
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 Profiles
14
+ include MsRestAzure
15
+
16
+ #
17
+ # Creates and initializes a new instance of the Profiles 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 CDN profiles within an Azure subscitption.
29
+ #
30
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
31
+ # will be added to the HTTP request.
32
+ #
33
+ # @return [ProfileListResult] operation results.
34
+ #
35
+ def list_by_subscription_id(custom_headers:nil)
36
+ response = list_by_subscription_id_async(custom_headers:custom_headers).value!
37
+ response.body unless response.nil?
38
+ end
39
+
40
+ #
41
+ # Lists the CDN profiles within an Azure subscitption.
42
+ #
43
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
44
+ # will be added to the HTTP request.
45
+ #
46
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
47
+ #
48
+ def list_by_subscription_id_with_http_info(custom_headers:nil)
49
+ list_by_subscription_id_async(custom_headers:custom_headers).value!
50
+ end
51
+
52
+ #
53
+ # Lists the CDN profiles within an Azure subscitption.
54
+ #
55
+ # @param [Hash{String => String}] A hash of custom headers that will be added
56
+ # to the HTTP request.
57
+ #
58
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
59
+ #
60
+ def list_by_subscription_id_async(custom_headers:nil)
61
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
62
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
63
+
64
+
65
+ request_headers = {}
66
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
67
+
68
+ # Set Headers
69
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
70
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
71
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Cdn/profiles'
72
+
73
+ request_url = @base_url || @client.base_url
74
+
75
+ options = {
76
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
77
+ path_params: {'subscriptionId' => @client.subscription_id},
78
+ query_params: {'api-version' => @client.api_version},
79
+ headers: request_headers.merge(custom_headers || {}),
80
+ base_url: request_url
81
+ }
82
+ promise = @client.make_request_async(:get, path_template, options)
83
+
84
+ promise = promise.then do |result|
85
+ http_response = result.response
86
+ status_code = http_response.status
87
+ response_content = http_response.body
88
+ unless status_code == 200
89
+ error_model = JSON.load(response_content)
90
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
91
+ end
92
+
93
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
94
+ # Deserialize Response
95
+ if status_code == 200
96
+ begin
97
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
98
+ result_mapper = Azure::CDN::Mgmt::V2016_04_02::Models::ProfileListResult.mapper()
99
+ result.body = @client.deserialize(result_mapper, parsed_response)
100
+ rescue Exception => e
101
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
102
+ end
103
+ end
104
+
105
+ result
106
+ end
107
+
108
+ promise.execute
109
+ end
110
+
111
+ #
112
+ # Lists the CDN profiles within a resource group.
113
+ #
114
+ # @param resource_group_name [String] Name of the resource group within the
115
+ # Azure subscription.
116
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
117
+ # will be added to the HTTP request.
118
+ #
119
+ # @return [ProfileListResult] operation results.
120
+ #
121
+ def list_by_resource_group(resource_group_name, custom_headers:nil)
122
+ response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
123
+ response.body unless response.nil?
124
+ end
125
+
126
+ #
127
+ # Lists the CDN profiles within a resource group.
128
+ #
129
+ # @param resource_group_name [String] Name of the resource group within the
130
+ # Azure subscription.
131
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
132
+ # will be added to the HTTP request.
133
+ #
134
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
135
+ #
136
+ def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil)
137
+ list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
138
+ end
139
+
140
+ #
141
+ # Lists the CDN profiles within a resource group.
142
+ #
143
+ # @param resource_group_name [String] Name of the resource group within the
144
+ # Azure subscription.
145
+ # @param [Hash{String => String}] A hash of custom headers that will be added
146
+ # to the HTTP request.
147
+ #
148
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
149
+ #
150
+ def list_by_resource_group_async(resource_group_name, custom_headers:nil)
151
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
152
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
153
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
154
+
155
+
156
+ request_headers = {}
157
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
158
+
159
+ # Set Headers
160
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
161
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
162
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles'
163
+
164
+ request_url = @base_url || @client.base_url
165
+
166
+ options = {
167
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
168
+ path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
169
+ query_params: {'api-version' => @client.api_version},
170
+ headers: request_headers.merge(custom_headers || {}),
171
+ base_url: request_url
172
+ }
173
+ promise = @client.make_request_async(:get, path_template, options)
174
+
175
+ promise = promise.then do |result|
176
+ http_response = result.response
177
+ status_code = http_response.status
178
+ response_content = http_response.body
179
+ unless status_code == 200
180
+ error_model = JSON.load(response_content)
181
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
182
+ end
183
+
184
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
185
+ # Deserialize Response
186
+ if status_code == 200
187
+ begin
188
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
189
+ result_mapper = Azure::CDN::Mgmt::V2016_04_02::Models::ProfileListResult.mapper()
190
+ result.body = @client.deserialize(result_mapper, parsed_response)
191
+ rescue Exception => e
192
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
193
+ end
194
+ end
195
+
196
+ result
197
+ end
198
+
199
+ promise.execute
200
+ end
201
+
202
+ #
203
+ # Gets a CDN profile with the specified parameters.
204
+ #
205
+ # @param profile_name [String] Name of the CDN profile within the resource
206
+ # group.
207
+ # @param resource_group_name [String] Name of the resource group within the
208
+ # Azure subscription.
209
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
210
+ # will be added to the HTTP request.
211
+ #
212
+ # @return [Profile] operation results.
213
+ #
214
+ def get(profile_name, resource_group_name, custom_headers:nil)
215
+ response = get_async(profile_name, resource_group_name, custom_headers:custom_headers).value!
216
+ response.body unless response.nil?
217
+ end
218
+
219
+ #
220
+ # Gets a CDN profile with the specified parameters.
221
+ #
222
+ # @param profile_name [String] Name of the CDN profile within the resource
223
+ # group.
224
+ # @param resource_group_name [String] Name of the resource group within the
225
+ # Azure subscription.
226
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
227
+ # will be added to the HTTP request.
228
+ #
229
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
230
+ #
231
+ def get_with_http_info(profile_name, resource_group_name, custom_headers:nil)
232
+ get_async(profile_name, resource_group_name, custom_headers:custom_headers).value!
233
+ end
234
+
235
+ #
236
+ # Gets a CDN profile with the specified parameters.
237
+ #
238
+ # @param profile_name [String] Name of the CDN profile within the resource
239
+ # group.
240
+ # @param resource_group_name [String] Name of the resource group within the
241
+ # Azure subscription.
242
+ # @param [Hash{String => String}] A hash of custom headers that will be added
243
+ # to the HTTP request.
244
+ #
245
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
246
+ #
247
+ def get_async(profile_name, resource_group_name, custom_headers:nil)
248
+ fail ArgumentError, 'profile_name is nil' if profile_name.nil?
249
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
250
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
251
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
252
+
253
+
254
+ request_headers = {}
255
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
256
+
257
+ # Set Headers
258
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
259
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
260
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}'
261
+
262
+ request_url = @base_url || @client.base_url
263
+
264
+ options = {
265
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
266
+ path_params: {'profileName' => profile_name,'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
267
+ query_params: {'api-version' => @client.api_version},
268
+ headers: request_headers.merge(custom_headers || {}),
269
+ base_url: request_url
270
+ }
271
+ promise = @client.make_request_async(:get, path_template, options)
272
+
273
+ promise = promise.then do |result|
274
+ http_response = result.response
275
+ status_code = http_response.status
276
+ response_content = http_response.body
277
+ unless status_code == 200
278
+ error_model = JSON.load(response_content)
279
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
280
+ end
281
+
282
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
283
+ # Deserialize Response
284
+ if status_code == 200
285
+ begin
286
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
287
+ result_mapper = Azure::CDN::Mgmt::V2016_04_02::Models::Profile.mapper()
288
+ result.body = @client.deserialize(result_mapper, parsed_response)
289
+ rescue Exception => e
290
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
291
+ end
292
+ end
293
+
294
+ result
295
+ end
296
+
297
+ promise.execute
298
+ end
299
+
300
+ #
301
+ # Creates a new CDN profile with the specified parameters.
302
+ #
303
+ # @param profile_name [String] Name of the CDN profile within the resource
304
+ # group.
305
+ # @param profile_properties [ProfileCreateParameters] Profile properties needed
306
+ # for creation.
307
+ # @param resource_group_name [String] Name of the resource group within the
308
+ # Azure subscription.
309
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
310
+ # will be added to the HTTP request.
311
+ #
312
+ # @return [Profile] operation results.
313
+ #
314
+ def create(profile_name, profile_properties, resource_group_name, custom_headers:nil)
315
+ response = create_async(profile_name, profile_properties, resource_group_name, custom_headers:custom_headers).value!
316
+ response.body unless response.nil?
317
+ end
318
+
319
+ #
320
+ # @param profile_name [String] Name of the CDN profile within the resource
321
+ # group.
322
+ # @param profile_properties [ProfileCreateParameters] Profile properties needed
323
+ # for creation.
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 [Concurrent::Promise] promise which provides async access to http
330
+ # response.
331
+ #
332
+ def create_async(profile_name, profile_properties, resource_group_name, custom_headers:nil)
333
+ # Send request
334
+ promise = begin_create_async(profile_name, profile_properties, resource_group_name, custom_headers:custom_headers)
335
+
336
+ promise = promise.then do |response|
337
+ # Defining deserialization method.
338
+ deserialize_method = lambda do |parsed_response|
339
+ result_mapper = Azure::CDN::Mgmt::V2016_04_02::Models::Profile.mapper()
340
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
341
+ end
342
+
343
+ # Waiting for response.
344
+ @client.get_long_running_operation_result(response, deserialize_method)
345
+ end
346
+
347
+ promise
348
+ end
349
+
350
+ #
351
+ # Updates an existing CDN profile with the specified parameters.
352
+ #
353
+ # @param profile_name [String] Name of the CDN profile within the resource
354
+ # group.
355
+ # @param profile_properties [ProfileUpdateParameters] Profile properties needed
356
+ # for update.
357
+ # @param resource_group_name [String] Name of the resource group within the
358
+ # Azure subscription.
359
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
360
+ # will be added to the HTTP request.
361
+ #
362
+ # @return [Profile] operation results.
363
+ #
364
+ def update(profile_name, profile_properties, resource_group_name, custom_headers:nil)
365
+ response = update_async(profile_name, profile_properties, resource_group_name, custom_headers:custom_headers).value!
366
+ response.body unless response.nil?
367
+ end
368
+
369
+ #
370
+ # @param profile_name [String] Name of the CDN profile within the resource
371
+ # group.
372
+ # @param profile_properties [ProfileUpdateParameters] Profile properties needed
373
+ # for update.
374
+ # @param resource_group_name [String] Name of the resource group within the
375
+ # Azure subscription.
376
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
377
+ # will be added to the HTTP request.
378
+ #
379
+ # @return [Concurrent::Promise] promise which provides async access to http
380
+ # response.
381
+ #
382
+ def update_async(profile_name, profile_properties, resource_group_name, custom_headers:nil)
383
+ # Send request
384
+ promise = begin_update_async(profile_name, profile_properties, resource_group_name, custom_headers:custom_headers)
385
+
386
+ promise = promise.then do |response|
387
+ # Defining deserialization method.
388
+ deserialize_method = lambda do |parsed_response|
389
+ result_mapper = Azure::CDN::Mgmt::V2016_04_02::Models::Profile.mapper()
390
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
391
+ end
392
+
393
+ # Waiting for response.
394
+ @client.get_long_running_operation_result(response, deserialize_method)
395
+ end
396
+
397
+ promise
398
+ end
399
+
400
+ #
401
+ # Deletes an existing CDN profile with the specified parameters. Deleting a
402
+ # profile will result in the deletion of all subresources including endpoints,
403
+ # origins and custom domains.
404
+ #
405
+ # @param profile_name [String] Name of the CDN profile within the resource
406
+ # group.
407
+ # @param resource_group_name [String] Name of the resource group within the
408
+ # Azure subscription.
409
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
410
+ # will be added to the HTTP request.
411
+ #
412
+ def delete_if_exists(profile_name, resource_group_name, custom_headers:nil)
413
+ response = delete_if_exists_async(profile_name, resource_group_name, custom_headers:custom_headers).value!
414
+ nil
415
+ end
416
+
417
+ #
418
+ # @param profile_name [String] Name of the CDN profile within the resource
419
+ # group.
420
+ # @param resource_group_name [String] Name of the resource group within the
421
+ # Azure subscription.
422
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
423
+ # will be added to the HTTP request.
424
+ #
425
+ # @return [Concurrent::Promise] promise which provides async access to http
426
+ # response.
427
+ #
428
+ def delete_if_exists_async(profile_name, resource_group_name, custom_headers:nil)
429
+ # Send request
430
+ promise = begin_delete_if_exists_async(profile_name, resource_group_name, custom_headers:custom_headers)
431
+
432
+ promise = promise.then do |response|
433
+ # Defining deserialization method.
434
+ deserialize_method = lambda do |parsed_response|
435
+ end
436
+
437
+ # Waiting for response.
438
+ @client.get_long_running_operation_result(response, deserialize_method)
439
+ end
440
+
441
+ promise
442
+ end
443
+
444
+ #
445
+ # Generates a dynamic SSO URI used to sign in to the CDN Supplemental Portal
446
+ # used for advanced management tasks, such as Country Filtering, Advanced HTTP
447
+ # Reports, and Real-time Stats and Alerts. The SSO URI changes approximately
448
+ # every 10 minutes.
449
+ #
450
+ # @param profile_name [String] Name of the CDN profile within the resource
451
+ # group.
452
+ # @param resource_group_name [String] Name of the resource group within the
453
+ # Azure subscription.
454
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
455
+ # will be added to the HTTP request.
456
+ #
457
+ # @return [SsoUri] operation results.
458
+ #
459
+ def generate_sso_uri(profile_name, resource_group_name, custom_headers:nil)
460
+ response = generate_sso_uri_async(profile_name, resource_group_name, custom_headers:custom_headers).value!
461
+ response.body unless response.nil?
462
+ end
463
+
464
+ #
465
+ # Generates a dynamic SSO URI used to sign in to the CDN Supplemental Portal
466
+ # used for advanced management tasks, such as Country Filtering, Advanced HTTP
467
+ # Reports, and Real-time Stats and Alerts. The SSO URI changes approximately
468
+ # every 10 minutes.
469
+ #
470
+ # @param profile_name [String] Name of the CDN profile within the resource
471
+ # group.
472
+ # @param resource_group_name [String] Name of the resource group within the
473
+ # Azure subscription.
474
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
475
+ # will be added to the HTTP request.
476
+ #
477
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
478
+ #
479
+ def generate_sso_uri_with_http_info(profile_name, resource_group_name, custom_headers:nil)
480
+ generate_sso_uri_async(profile_name, resource_group_name, custom_headers:custom_headers).value!
481
+ end
482
+
483
+ #
484
+ # Generates a dynamic SSO URI used to sign in to the CDN Supplemental Portal
485
+ # used for advanced management tasks, such as Country Filtering, Advanced HTTP
486
+ # Reports, and Real-time Stats and Alerts. The SSO URI changes approximately
487
+ # every 10 minutes.
488
+ #
489
+ # @param profile_name [String] Name of the CDN profile within the resource
490
+ # group.
491
+ # @param resource_group_name [String] Name of the resource group within the
492
+ # Azure subscription.
493
+ # @param [Hash{String => String}] A hash of custom headers that will be added
494
+ # to the HTTP request.
495
+ #
496
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
497
+ #
498
+ def generate_sso_uri_async(profile_name, resource_group_name, custom_headers:nil)
499
+ fail ArgumentError, 'profile_name is nil' if profile_name.nil?
500
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
501
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
502
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
503
+
504
+
505
+ request_headers = {}
506
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
507
+
508
+ # Set Headers
509
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
510
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
511
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/generateSsoUri'
512
+
513
+ request_url = @base_url || @client.base_url
514
+
515
+ options = {
516
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
517
+ path_params: {'profileName' => profile_name,'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
518
+ query_params: {'api-version' => @client.api_version},
519
+ headers: request_headers.merge(custom_headers || {}),
520
+ base_url: request_url
521
+ }
522
+ promise = @client.make_request_async(:post, path_template, options)
523
+
524
+ promise = promise.then do |result|
525
+ http_response = result.response
526
+ status_code = http_response.status
527
+ response_content = http_response.body
528
+ unless status_code == 200
529
+ error_model = JSON.load(response_content)
530
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
531
+ end
532
+
533
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
534
+ # Deserialize Response
535
+ if status_code == 200
536
+ begin
537
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
538
+ result_mapper = Azure::CDN::Mgmt::V2016_04_02::Models::SsoUri.mapper()
539
+ result.body = @client.deserialize(result_mapper, parsed_response)
540
+ rescue Exception => e
541
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
542
+ end
543
+ end
544
+
545
+ result
546
+ end
547
+
548
+ promise.execute
549
+ end
550
+
551
+ #
552
+ # Creates a new CDN profile with the specified parameters.
553
+ #
554
+ # @param profile_name [String] Name of the CDN profile within the resource
555
+ # group.
556
+ # @param profile_properties [ProfileCreateParameters] Profile properties needed
557
+ # for creation.
558
+ # @param resource_group_name [String] Name of the resource group within the
559
+ # Azure subscription.
560
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
561
+ # will be added to the HTTP request.
562
+ #
563
+ # @return [Profile] operation results.
564
+ #
565
+ def begin_create(profile_name, profile_properties, resource_group_name, custom_headers:nil)
566
+ response = begin_create_async(profile_name, profile_properties, resource_group_name, custom_headers:custom_headers).value!
567
+ response.body unless response.nil?
568
+ end
569
+
570
+ #
571
+ # Creates a new CDN profile with the specified parameters.
572
+ #
573
+ # @param profile_name [String] Name of the CDN profile within the resource
574
+ # group.
575
+ # @param profile_properties [ProfileCreateParameters] Profile properties needed
576
+ # for creation.
577
+ # @param resource_group_name [String] Name of the resource group within the
578
+ # Azure subscription.
579
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
580
+ # will be added to the HTTP request.
581
+ #
582
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
583
+ #
584
+ def begin_create_with_http_info(profile_name, profile_properties, resource_group_name, custom_headers:nil)
585
+ begin_create_async(profile_name, profile_properties, resource_group_name, custom_headers:custom_headers).value!
586
+ end
587
+
588
+ #
589
+ # Creates a new CDN profile with the specified parameters.
590
+ #
591
+ # @param profile_name [String] Name of the CDN profile within the resource
592
+ # group.
593
+ # @param profile_properties [ProfileCreateParameters] Profile properties needed
594
+ # for creation.
595
+ # @param resource_group_name [String] Name of the resource group within the
596
+ # Azure subscription.
597
+ # @param [Hash{String => String}] A hash of custom headers that will be added
598
+ # to the HTTP request.
599
+ #
600
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
601
+ #
602
+ def begin_create_async(profile_name, profile_properties, resource_group_name, custom_headers:nil)
603
+ fail ArgumentError, 'profile_name is nil' if profile_name.nil?
604
+ fail ArgumentError, 'profile_properties is nil' if profile_properties.nil?
605
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
606
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
607
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
608
+
609
+
610
+ request_headers = {}
611
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
612
+
613
+ # Set Headers
614
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
615
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
616
+
617
+ # Serialize Request
618
+ request_mapper = Azure::CDN::Mgmt::V2016_04_02::Models::ProfileCreateParameters.mapper()
619
+ request_content = @client.serialize(request_mapper, profile_properties)
620
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
621
+
622
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}'
623
+
624
+ request_url = @base_url || @client.base_url
625
+
626
+ options = {
627
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
628
+ path_params: {'profileName' => profile_name,'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
629
+ query_params: {'api-version' => @client.api_version},
630
+ body: request_content,
631
+ headers: request_headers.merge(custom_headers || {}),
632
+ base_url: request_url
633
+ }
634
+ promise = @client.make_request_async(:put, path_template, options)
635
+
636
+ promise = promise.then do |result|
637
+ http_response = result.response
638
+ status_code = http_response.status
639
+ response_content = http_response.body
640
+ unless status_code == 200 || status_code == 201 || status_code == 202
641
+ error_model = JSON.load(response_content)
642
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
643
+ end
644
+
645
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
646
+ # Deserialize Response
647
+ if status_code == 200
648
+ begin
649
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
650
+ result_mapper = Azure::CDN::Mgmt::V2016_04_02::Models::Profile.mapper()
651
+ result.body = @client.deserialize(result_mapper, parsed_response)
652
+ rescue Exception => e
653
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
654
+ end
655
+ end
656
+ # Deserialize Response
657
+ if status_code == 201
658
+ begin
659
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
660
+ result_mapper = Azure::CDN::Mgmt::V2016_04_02::Models::Profile.mapper()
661
+ result.body = @client.deserialize(result_mapper, parsed_response)
662
+ rescue Exception => e
663
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
664
+ end
665
+ end
666
+ # Deserialize Response
667
+ if status_code == 202
668
+ begin
669
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
670
+ result_mapper = Azure::CDN::Mgmt::V2016_04_02::Models::Profile.mapper()
671
+ result.body = @client.deserialize(result_mapper, parsed_response)
672
+ rescue Exception => e
673
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
674
+ end
675
+ end
676
+
677
+ result
678
+ end
679
+
680
+ promise.execute
681
+ end
682
+
683
+ #
684
+ # Updates an existing CDN profile with the specified parameters.
685
+ #
686
+ # @param profile_name [String] Name of the CDN profile within the resource
687
+ # group.
688
+ # @param profile_properties [ProfileUpdateParameters] Profile properties needed
689
+ # for update.
690
+ # @param resource_group_name [String] Name of the resource group within the
691
+ # Azure subscription.
692
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
693
+ # will be added to the HTTP request.
694
+ #
695
+ # @return [Profile] operation results.
696
+ #
697
+ def begin_update(profile_name, profile_properties, resource_group_name, custom_headers:nil)
698
+ response = begin_update_async(profile_name, profile_properties, resource_group_name, custom_headers:custom_headers).value!
699
+ response.body unless response.nil?
700
+ end
701
+
702
+ #
703
+ # Updates an existing CDN profile with the specified parameters.
704
+ #
705
+ # @param profile_name [String] Name of the CDN profile within the resource
706
+ # group.
707
+ # @param profile_properties [ProfileUpdateParameters] Profile properties needed
708
+ # for update.
709
+ # @param resource_group_name [String] Name of the resource group within the
710
+ # Azure subscription.
711
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
712
+ # will be added to the HTTP request.
713
+ #
714
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
715
+ #
716
+ def begin_update_with_http_info(profile_name, profile_properties, resource_group_name, custom_headers:nil)
717
+ begin_update_async(profile_name, profile_properties, resource_group_name, custom_headers:custom_headers).value!
718
+ end
719
+
720
+ #
721
+ # Updates an existing CDN profile with the specified parameters.
722
+ #
723
+ # @param profile_name [String] Name of the CDN profile within the resource
724
+ # group.
725
+ # @param profile_properties [ProfileUpdateParameters] Profile properties needed
726
+ # for update.
727
+ # @param resource_group_name [String] Name of the resource group within the
728
+ # Azure subscription.
729
+ # @param [Hash{String => String}] A hash of custom headers that will be added
730
+ # to the HTTP request.
731
+ #
732
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
733
+ #
734
+ def begin_update_async(profile_name, profile_properties, resource_group_name, custom_headers:nil)
735
+ fail ArgumentError, 'profile_name is nil' if profile_name.nil?
736
+ fail ArgumentError, 'profile_properties is nil' if profile_properties.nil?
737
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
738
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
739
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
740
+
741
+
742
+ request_headers = {}
743
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
744
+
745
+ # Set Headers
746
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
747
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
748
+
749
+ # Serialize Request
750
+ request_mapper = Azure::CDN::Mgmt::V2016_04_02::Models::ProfileUpdateParameters.mapper()
751
+ request_content = @client.serialize(request_mapper, profile_properties)
752
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
753
+
754
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}'
755
+
756
+ request_url = @base_url || @client.base_url
757
+
758
+ options = {
759
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
760
+ path_params: {'profileName' => profile_name,'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
761
+ query_params: {'api-version' => @client.api_version},
762
+ body: request_content,
763
+ headers: request_headers.merge(custom_headers || {}),
764
+ base_url: request_url
765
+ }
766
+ promise = @client.make_request_async(:patch, path_template, options)
767
+
768
+ promise = promise.then do |result|
769
+ http_response = result.response
770
+ status_code = http_response.status
771
+ response_content = http_response.body
772
+ unless status_code == 200 || status_code == 202
773
+ error_model = JSON.load(response_content)
774
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
775
+ end
776
+
777
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
778
+ # Deserialize Response
779
+ if status_code == 200
780
+ begin
781
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
782
+ result_mapper = Azure::CDN::Mgmt::V2016_04_02::Models::Profile.mapper()
783
+ result.body = @client.deserialize(result_mapper, parsed_response)
784
+ rescue Exception => e
785
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
786
+ end
787
+ end
788
+ # Deserialize Response
789
+ if status_code == 202
790
+ begin
791
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
792
+ result_mapper = Azure::CDN::Mgmt::V2016_04_02::Models::Profile.mapper()
793
+ result.body = @client.deserialize(result_mapper, parsed_response)
794
+ rescue Exception => e
795
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
796
+ end
797
+ end
798
+
799
+ result
800
+ end
801
+
802
+ promise.execute
803
+ end
804
+
805
+ #
806
+ # Deletes an existing CDN profile with the specified parameters. Deleting a
807
+ # profile will result in the deletion of all subresources including endpoints,
808
+ # origins and custom domains.
809
+ #
810
+ # @param profile_name [String] Name of the CDN profile within the resource
811
+ # group.
812
+ # @param resource_group_name [String] Name of the resource group within the
813
+ # Azure subscription.
814
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
815
+ # will be added to the HTTP request.
816
+ #
817
+ #
818
+ def begin_delete_if_exists(profile_name, resource_group_name, custom_headers:nil)
819
+ response = begin_delete_if_exists_async(profile_name, resource_group_name, custom_headers:custom_headers).value!
820
+ nil
821
+ end
822
+
823
+ #
824
+ # Deletes an existing CDN profile with the specified parameters. Deleting a
825
+ # profile will result in the deletion of all subresources including endpoints,
826
+ # origins and custom domains.
827
+ #
828
+ # @param profile_name [String] Name of the CDN profile within the resource
829
+ # group.
830
+ # @param resource_group_name [String] Name of the resource group within the
831
+ # Azure subscription.
832
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
833
+ # will be added to the HTTP request.
834
+ #
835
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
836
+ #
837
+ def begin_delete_if_exists_with_http_info(profile_name, resource_group_name, custom_headers:nil)
838
+ begin_delete_if_exists_async(profile_name, resource_group_name, custom_headers:custom_headers).value!
839
+ end
840
+
841
+ #
842
+ # Deletes an existing CDN profile with the specified parameters. Deleting a
843
+ # profile will result in the deletion of all subresources including endpoints,
844
+ # origins and custom domains.
845
+ #
846
+ # @param profile_name [String] Name of the CDN profile within the resource
847
+ # group.
848
+ # @param resource_group_name [String] Name of the resource group within the
849
+ # Azure subscription.
850
+ # @param [Hash{String => String}] A hash of custom headers that will be added
851
+ # to the HTTP request.
852
+ #
853
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
854
+ #
855
+ def begin_delete_if_exists_async(profile_name, resource_group_name, custom_headers:nil)
856
+ fail ArgumentError, 'profile_name is nil' if profile_name.nil?
857
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
858
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
859
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
860
+
861
+
862
+ request_headers = {}
863
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
864
+
865
+ # Set Headers
866
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
867
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
868
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}'
869
+
870
+ request_url = @base_url || @client.base_url
871
+
872
+ options = {
873
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
874
+ path_params: {'profileName' => profile_name,'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
875
+ query_params: {'api-version' => @client.api_version},
876
+ headers: request_headers.merge(custom_headers || {}),
877
+ base_url: request_url
878
+ }
879
+ promise = @client.make_request_async(:delete, path_template, options)
880
+
881
+ promise = promise.then do |result|
882
+ http_response = result.response
883
+ status_code = http_response.status
884
+ response_content = http_response.body
885
+ unless status_code == 202 || status_code == 204
886
+ error_model = JSON.load(response_content)
887
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
888
+ end
889
+
890
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
891
+
892
+ result
893
+ end
894
+
895
+ promise.execute
896
+ end
897
+
898
+ end
899
+ end