azure_mgmt_reservations 0.19.2 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2017-11-01/generated/azure_mgmt_reservations/reservations_management_client.rb +1 -1
  3. data/lib/2018-06-01-preview/generated/azure_mgmt_reservations/reservations_management_client.rb +1 -1
  4. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/reservations_management_client.rb +1 -1
  5. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations.rb +15 -19
  6. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations/auto_quota_increase.rb +0 -18
  7. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations/models/{on_failure.rb → actions.rb} +6 -20
  8. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations/models/auto_quota_increase_detail.rb +4 -4
  9. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations/models/current_quota_limit.rb +3 -76
  10. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations/models/current_quota_limit_base.rb +3 -76
  11. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations/models/email_actions.rb +4 -5
  12. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations/models/quota_properties.rb +120 -0
  13. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations/models/quota_request_one_resource_submit_response.rb +3 -76
  14. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations/models/{current_quota_limit_base_name.rb → resource_name.rb} +4 -4
  15. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations/models/sub_request.rb +2 -2
  16. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations/models/support_request_action.rb +0 -11
  17. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations/quota.rb +692 -31
  18. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations/{quota_requests.rb → quota_request_status.rb} +30 -74
  19. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations/reservations_management_client.rb +5 -13
  20. data/lib/profiles/latest/modules/reservations_profile_module.rb +47 -59
  21. data/lib/version.rb +1 -1
  22. metadata +6 -10
  23. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations/models/on_failure_email_actions.rb +0 -55
  24. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations/models/on_failure_phone_actions.rb +0 -55
  25. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations/models/sub_request_name.rb +0 -59
  26. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations/quota_request.rb +0 -519
  27. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations/quotas.rb +0 -269
@@ -1,269 +0,0 @@
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::Reservations::Mgmt::V2019_07_19_preview
7
- #
8
- # Microsoft Azure Quota Resource Provider.
9
- #
10
- class Quotas
11
- include MsRestAzure
12
-
13
- #
14
- # Creates and initializes a new instance of the Quotas class.
15
- # @param client service class for accessing basic functionality.
16
- #
17
- def initialize(client)
18
- @client = client
19
- end
20
-
21
- # @return [ReservationsManagementClient] reference to the ReservationsManagementClient
22
- attr_reader :client
23
-
24
- #
25
- # Gets the current quota limit and usages for all the resources by the resource
26
- # provider at the specified location.
27
- #
28
- # This API gets the current quota limits and usages for the resource provider
29
- # for the specified location. This response can be used to submit
30
- # quotaRequests.
31
- #
32
- # @param subscription_id [String] Azure subscription id.
33
- # @param provider_id [String] Azure resource Provider id.
34
- # @param location [String] Azure region.
35
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
36
- # will be added to the HTTP request.
37
- #
38
- # @return [Array<CurrentQuotaLimitBase>] operation results.
39
- #
40
- def list_status(subscription_id, provider_id, location, custom_headers:nil)
41
- first_page = list_status_as_lazy(subscription_id, provider_id, location, custom_headers:custom_headers)
42
- first_page.get_all_items
43
- end
44
-
45
- #
46
- # Gets the current quota limit and usages for all the resources by the resource
47
- # provider at the specified location.
48
- #
49
- # This API gets the current quota limits and usages for the resource provider
50
- # for the specified location. This response can be used to submit
51
- # quotaRequests.
52
- #
53
- # @param subscription_id [String] Azure subscription id.
54
- # @param provider_id [String] Azure resource Provider id.
55
- # @param location [String] Azure region.
56
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
57
- # will be added to the HTTP request.
58
- #
59
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
60
- #
61
- def list_status_with_http_info(subscription_id, provider_id, location, custom_headers:nil)
62
- list_status_async(subscription_id, provider_id, location, custom_headers:custom_headers).value!
63
- end
64
-
65
- #
66
- # Gets the current quota limit and usages for all the resources by the resource
67
- # provider at the specified location.
68
- #
69
- # This API gets the current quota limits and usages for the resource provider
70
- # for the specified location. This response can be used to submit
71
- # quotaRequests.
72
- #
73
- # @param subscription_id [String] Azure subscription id.
74
- # @param provider_id [String] Azure resource Provider id.
75
- # @param location [String] Azure region.
76
- # @param [Hash{String => String}] A hash of custom headers that will be added
77
- # to the HTTP request.
78
- #
79
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
80
- #
81
- def list_status_async(subscription_id, provider_id, location, custom_headers:nil)
82
- fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
83
- fail ArgumentError, 'provider_id is nil' if provider_id.nil?
84
- fail ArgumentError, 'location is nil' if location.nil?
85
- fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
86
-
87
-
88
- request_headers = {}
89
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
90
-
91
- # Set Headers
92
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
93
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
94
- path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimits'
95
-
96
- request_url = @base_url || @client.base_url
97
-
98
- options = {
99
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
100
- path_params: {'subscriptionId' => subscription_id,'providerId' => provider_id,'location' => location},
101
- query_params: {'api-version' => @client.api_version},
102
- headers: request_headers.merge(custom_headers || {}),
103
- base_url: request_url
104
- }
105
- promise = @client.make_request_async(:get, path_template, options)
106
-
107
- promise = promise.then do |result|
108
- http_response = result.response
109
- status_code = http_response.status
110
- response_content = http_response.body
111
- unless status_code == 200
112
- error_model = JSON.load(response_content)
113
- fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
114
- end
115
-
116
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
117
- result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
118
- result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
119
- # Deserialize Response
120
- if status_code == 200
121
- begin
122
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
123
- result_mapper = Azure::Reservations::Mgmt::V2019_07_19_preview::Models::QuotaLimits.mapper()
124
- result.body = @client.deserialize(result_mapper, parsed_response)
125
- rescue Exception => e
126
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
127
- end
128
- end
129
-
130
- result
131
- end
132
-
133
- promise.execute
134
- end
135
-
136
- #
137
- # Gets the current quota limit and usages for all the resources by the resource
138
- # provider at the specified location.
139
- #
140
- # This API gets the current quota limits and usages for the resource provider
141
- # for the specified location. This response can be used to submit
142
- # quotaRequests.
143
- #
144
- # @param next_page_link [String] The NextLink from the previous successful call
145
- # to List operation.
146
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
147
- # will be added to the HTTP request.
148
- #
149
- # @return [QuotaLimits] operation results.
150
- #
151
- def list_status_next(next_page_link, custom_headers:nil)
152
- response = list_status_next_async(next_page_link, custom_headers:custom_headers).value!
153
- response.body unless response.nil?
154
- end
155
-
156
- #
157
- # Gets the current quota limit and usages for all the resources by the resource
158
- # provider at the specified location.
159
- #
160
- # This API gets the current quota limits and usages for the resource provider
161
- # for the specified location. This response can be used to submit
162
- # quotaRequests.
163
- #
164
- # @param next_page_link [String] The NextLink from the previous successful call
165
- # to List operation.
166
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
167
- # will be added to the HTTP request.
168
- #
169
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
170
- #
171
- def list_status_next_with_http_info(next_page_link, custom_headers:nil)
172
- list_status_next_async(next_page_link, custom_headers:custom_headers).value!
173
- end
174
-
175
- #
176
- # Gets the current quota limit and usages for all the resources by the resource
177
- # provider at the specified location.
178
- #
179
- # This API gets the current quota limits and usages for the resource provider
180
- # for the specified location. This response can be used to submit
181
- # quotaRequests.
182
- #
183
- # @param next_page_link [String] The NextLink from the previous successful call
184
- # to List operation.
185
- # @param [Hash{String => String}] A hash of custom headers that will be added
186
- # to the HTTP request.
187
- #
188
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
189
- #
190
- def list_status_next_async(next_page_link, custom_headers:nil)
191
- fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
192
-
193
-
194
- request_headers = {}
195
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
196
-
197
- # Set Headers
198
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
199
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
200
- path_template = '{nextLink}'
201
-
202
- request_url = @base_url || @client.base_url
203
-
204
- options = {
205
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
206
- skip_encoding_path_params: {'nextLink' => next_page_link},
207
- headers: request_headers.merge(custom_headers || {}),
208
- base_url: request_url
209
- }
210
- promise = @client.make_request_async(:get, path_template, options)
211
-
212
- promise = promise.then do |result|
213
- http_response = result.response
214
- status_code = http_response.status
215
- response_content = http_response.body
216
- unless status_code == 200
217
- error_model = JSON.load(response_content)
218
- fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
219
- end
220
-
221
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
222
- result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
223
- result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
224
- # Deserialize Response
225
- if status_code == 200
226
- begin
227
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
228
- result_mapper = Azure::Reservations::Mgmt::V2019_07_19_preview::Models::QuotaLimits.mapper()
229
- result.body = @client.deserialize(result_mapper, parsed_response)
230
- rescue Exception => e
231
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
232
- end
233
- end
234
-
235
- result
236
- end
237
-
238
- promise.execute
239
- end
240
-
241
- #
242
- # Gets the current quota limit and usages for all the resources by the resource
243
- # provider at the specified location.
244
- #
245
- # This API gets the current quota limits and usages for the resource provider
246
- # for the specified location. This response can be used to submit
247
- # quotaRequests.
248
- #
249
- # @param subscription_id [String] Azure subscription id.
250
- # @param provider_id [String] Azure resource Provider id.
251
- # @param location [String] Azure region.
252
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
253
- # will be added to the HTTP request.
254
- #
255
- # @return [QuotaLimits] which provide lazy access to pages of the response.
256
- #
257
- def list_status_as_lazy(subscription_id, provider_id, location, custom_headers:nil)
258
- response = list_status_async(subscription_id, provider_id, location, custom_headers:custom_headers).value!
259
- unless response.nil?
260
- page = response.body
261
- page.next_method = Proc.new do |next_page_link|
262
- list_status_next_async(next_page_link, custom_headers:custom_headers)
263
- end
264
- page
265
- end
266
- end
267
-
268
- end
269
- end