azure_mgmt_reservations 0.20.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 +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2017-11-01/generated/azure_mgmt_reservations.rb +53 -0
  4. data/lib/2017-11-01/generated/azure_mgmt_reservations/models/applied_reservation_list.rb +66 -0
  5. data/lib/2017-11-01/generated/azure_mgmt_reservations/models/applied_reservations.rb +85 -0
  6. data/lib/2017-11-01/generated/azure_mgmt_reservations/models/catalog.rb +166 -0
  7. data/lib/2017-11-01/generated/azure_mgmt_reservations/models/error.rb +48 -0
  8. data/lib/2017-11-01/generated/azure_mgmt_reservations/models/extended_error_info.rb +84 -0
  9. data/lib/2017-11-01/generated/azure_mgmt_reservations/models/extended_status_info.rb +61 -0
  10. data/lib/2017-11-01/generated/azure_mgmt_reservations/models/kind.rb +15 -0
  11. data/lib/2017-11-01/generated/azure_mgmt_reservations/models/merge_request.rb +56 -0
  12. data/lib/2017-11-01/generated/azure_mgmt_reservations/models/operation_display.rb +80 -0
  13. data/lib/2017-11-01/generated/azure_mgmt_reservations/models/operation_list.rb +98 -0
  14. data/lib/2017-11-01/generated/azure_mgmt_reservations/models/operation_response.rb +70 -0
  15. data/lib/2017-11-01/generated/azure_mgmt_reservations/models/patch.rb +66 -0
  16. data/lib/2017-11-01/generated/azure_mgmt_reservations/models/reservation_list.rb +98 -0
  17. data/lib/2017-11-01/generated/azure_mgmt_reservations/models/reservation_merge_properties.rb +70 -0
  18. data/lib/2017-11-01/generated/azure_mgmt_reservations/models/reservation_order_list.rb +98 -0
  19. data/lib/2017-11-01/generated/azure_mgmt_reservations/models/reservation_order_response.rb +187 -0
  20. data/lib/2017-11-01/generated/azure_mgmt_reservations/models/reservation_properties.rb +176 -0
  21. data/lib/2017-11-01/generated/azure_mgmt_reservations/models/reservation_response.rb +137 -0
  22. data/lib/2017-11-01/generated/azure_mgmt_reservations/models/reservation_split_properties.rb +70 -0
  23. data/lib/2017-11-01/generated/azure_mgmt_reservations/models/sku_capability.rb +58 -0
  24. data/lib/2017-11-01/generated/azure_mgmt_reservations/models/sku_name.rb +47 -0
  25. data/lib/2017-11-01/generated/azure_mgmt_reservations/models/sku_restriction.rb +79 -0
  26. data/lib/2017-11-01/generated/azure_mgmt_reservations/models/split_request.rb +69 -0
  27. data/lib/2017-11-01/generated/azure_mgmt_reservations/module_definition.rb +9 -0
  28. data/lib/2017-11-01/generated/azure_mgmt_reservations/operation.rb +232 -0
  29. data/lib/2017-11-01/generated/azure_mgmt_reservations/reservation.rb +1125 -0
  30. data/lib/2017-11-01/generated/azure_mgmt_reservations/reservation_order.rb +338 -0
  31. data/lib/2017-11-01/generated/azure_mgmt_reservations/reservations_management_client.rb +339 -0
  32. data/lib/2018-06-01-preview/generated/azure_mgmt_reservations.rb +58 -0
  33. data/lib/2018-06-01-preview/generated/azure_mgmt_reservations/models/applied_reservation_list.rb +66 -0
  34. data/lib/2018-06-01-preview/generated/azure_mgmt_reservations/models/applied_reservations.rb +85 -0
  35. data/lib/2018-06-01-preview/generated/azure_mgmt_reservations/models/applied_scope_type.rb +16 -0
  36. data/lib/2018-06-01-preview/generated/azure_mgmt_reservations/models/catalog.rb +143 -0
  37. data/lib/2018-06-01-preview/generated/azure_mgmt_reservations/models/error.rb +48 -0
  38. data/lib/2018-06-01-preview/generated/azure_mgmt_reservations/models/error_response_code.rb +69 -0
  39. data/lib/2018-06-01-preview/generated/azure_mgmt_reservations/models/extended_error_info.rb +84 -0
  40. data/lib/2018-06-01-preview/generated/azure_mgmt_reservations/models/extended_status_info.rb +61 -0
  41. data/lib/2018-06-01-preview/generated/azure_mgmt_reservations/models/instance_flexibility.rb +17 -0
  42. data/lib/2018-06-01-preview/generated/azure_mgmt_reservations/models/merge_request.rb +56 -0
  43. data/lib/2018-06-01-preview/generated/azure_mgmt_reservations/models/operation_display.rb +80 -0
  44. data/lib/2018-06-01-preview/generated/azure_mgmt_reservations/models/operation_list.rb +98 -0
  45. data/lib/2018-06-01-preview/generated/azure_mgmt_reservations/models/operation_response.rb +70 -0
  46. data/lib/2018-06-01-preview/generated/azure_mgmt_reservations/models/patch.rb +89 -0
  47. data/lib/2018-06-01-preview/generated/azure_mgmt_reservations/models/reservation_list.rb +98 -0
  48. data/lib/2018-06-01-preview/generated/azure_mgmt_reservations/models/reservation_merge_properties.rb +70 -0
  49. data/lib/2018-06-01-preview/generated/azure_mgmt_reservations/models/reservation_order_list.rb +98 -0
  50. data/lib/2018-06-01-preview/generated/azure_mgmt_reservations/models/reservation_order_response.rb +184 -0
  51. data/lib/2018-06-01-preview/generated/azure_mgmt_reservations/models/reservation_properties.rb +208 -0
  52. data/lib/2018-06-01-preview/generated/azure_mgmt_reservations/models/reservation_response.rb +120 -0
  53. data/lib/2018-06-01-preview/generated/azure_mgmt_reservations/models/reservation_split_properties.rb +70 -0
  54. data/lib/2018-06-01-preview/generated/azure_mgmt_reservations/models/reservation_status_code.rb +23 -0
  55. data/lib/2018-06-01-preview/generated/azure_mgmt_reservations/models/reservation_term.rb +16 -0
  56. data/lib/2018-06-01-preview/generated/azure_mgmt_reservations/models/reserved_resource_type.rb +19 -0
  57. data/lib/2018-06-01-preview/generated/azure_mgmt_reservations/models/sku_name.rb +47 -0
  58. data/lib/2018-06-01-preview/generated/azure_mgmt_reservations/models/sku_property.rb +58 -0
  59. data/lib/2018-06-01-preview/generated/azure_mgmt_reservations/models/sku_restriction.rb +79 -0
  60. data/lib/2018-06-01-preview/generated/azure_mgmt_reservations/models/split_request.rb +69 -0
  61. data/lib/2018-06-01-preview/generated/azure_mgmt_reservations/module_definition.rb +9 -0
  62. data/lib/2018-06-01-preview/generated/azure_mgmt_reservations/operation.rb +232 -0
  63. data/lib/2018-06-01-preview/generated/azure_mgmt_reservations/reservation.rb +1125 -0
  64. data/lib/2018-06-01-preview/generated/azure_mgmt_reservations/reservation_order.rb +338 -0
  65. data/lib/2018-06-01-preview/generated/azure_mgmt_reservations/reservations_management_client.rb +352 -0
  66. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations.rb +76 -0
  67. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/models/applied_reservation_list.rb +66 -0
  68. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/models/applied_reservations.rb +85 -0
  69. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/models/applied_scope_type.rb +16 -0
  70. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/models/calculate_price_response.rb +48 -0
  71. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/models/calculate_price_response_properties.rb +130 -0
  72. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/models/calculate_price_response_properties_billing_currency_total.rb +59 -0
  73. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/models/calculate_price_response_properties_pricing_currency_total.rb +59 -0
  74. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/models/catalog.rb +171 -0
  75. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/models/error.rb +48 -0
  76. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/models/error_response_code.rb +69 -0
  77. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/models/extended_error_info.rb +84 -0
  78. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/models/extended_status_info.rb +61 -0
  79. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/models/instance_flexibility.rb +16 -0
  80. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/models/merge_request.rb +56 -0
  81. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/models/operation_display.rb +80 -0
  82. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/models/operation_list.rb +98 -0
  83. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/models/operation_response.rb +70 -0
  84. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/models/patch.rb +111 -0
  85. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/models/patch_properties_renew_properties.rb +48 -0
  86. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/models/payment_detail.rb +118 -0
  87. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/models/payment_status.rb +18 -0
  88. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/models/price.rb +59 -0
  89. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/models/properties.rb +48 -0
  90. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/models/purchase_request.rb +183 -0
  91. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/models/purchase_request_properties_reserved_resource_properties.rb +48 -0
  92. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/models/renew_properties_response.rb +76 -0
  93. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/models/renew_properties_response_billing_currency_total.rb +59 -0
  94. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/models/renew_properties_response_pricing_currency_total.rb +60 -0
  95. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/models/reservation_billing_plan.rb +16 -0
  96. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/models/reservation_list.rb +98 -0
  97. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/models/reservation_merge_properties.rb +70 -0
  98. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/models/reservation_order_billing_plan_information.rb +91 -0
  99. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/models/reservation_order_list.rb +98 -0
  100. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/models/reservation_order_response.rb +207 -0
  101. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/models/reservation_properties.rb +290 -0
  102. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/models/reservation_response.rb +120 -0
  103. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/models/reservation_split_properties.rb +70 -0
  104. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/models/reservation_status_code.rb +23 -0
  105. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/models/reservation_term.rb +16 -0
  106. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/models/reserved_resource_type.rb +22 -0
  107. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/models/scope_properties.rb +58 -0
  108. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/models/sku_name.rb +47 -0
  109. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/models/sku_property.rb +58 -0
  110. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/models/sku_restriction.rb +79 -0
  111. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/models/split_request.rb +69 -0
  112. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/models/subscription_scope_properties.rb +56 -0
  113. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/module_definition.rb +9 -0
  114. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/operation.rb +232 -0
  115. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/reservation.rb +1266 -0
  116. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/reservation_order.rb +607 -0
  117. data/lib/2019-04-01-preview/generated/azure_mgmt_reservations/reservations_management_client.rb +355 -0
  118. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations.rb +54 -0
  119. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations/auto_quota_increase.rb +223 -0
  120. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations/models/actions.rb +47 -0
  121. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations/models/aqi_settings.rb +46 -0
  122. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations/models/auto_quota_increase_detail.rb +119 -0
  123. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations/models/create_generic_quota_request_parameters.rb +55 -0
  124. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations/models/current_quota_limit.rb +71 -0
  125. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations/models/current_quota_limit_base.rb +47 -0
  126. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations/models/email_action.rb +46 -0
  127. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations/models/email_actions.rb +55 -0
  128. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations/models/exception_response.rb +47 -0
  129. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations/models/phone_action.rb +57 -0
  130. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations/models/quota_limits.rb +99 -0
  131. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations/models/quota_limits_response.rb +68 -0
  132. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations/models/quota_properties.rb +120 -0
  133. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations/models/quota_request_details.rb +128 -0
  134. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations/models/quota_request_details_list.rb +99 -0
  135. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations/models/quota_request_one_resource_submit_response.rb +121 -0
  136. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations/models/quota_request_properties.rb +92 -0
  137. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations/models/quota_request_submit_response.rb +83 -0
  138. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations/models/quota_request_submit_response201.rb +96 -0
  139. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations/models/resource_name.rb +59 -0
  140. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations/models/service_error.rb +78 -0
  141. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations/models/service_error_detail.rb +59 -0
  142. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations/models/sub_request.rb +118 -0
  143. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations/models/support_request_action.rb +142 -0
  144. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations/module_definition.rb +9 -0
  145. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations/quota.rb +805 -0
  146. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations/quota_request_status.rb +397 -0
  147. data/lib/2019-07-19-preview/generated/azure_mgmt_reservations/reservations_management_client.rb +136 -0
  148. data/lib/azure_mgmt_reservations.rb +9 -0
  149. data/lib/module_definition.rb +7 -0
  150. data/lib/profiles/latest/modules/reservations_profile_module.rb +359 -0
  151. data/lib/profiles/latest/reservations_latest_profile_client.rb +40 -0
  152. data/lib/profiles/latest/reservations_module_definition.rb +8 -0
  153. data/lib/version.rb +7 -0
  154. metadata +269 -0
@@ -0,0 +1,9 @@
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 end
7
+ module Azure::Reservations end
8
+ module Azure::Reservations::Mgmt end
9
+ module Azure::Reservations::Mgmt::V2019_07_19_preview end
@@ -0,0 +1,805 @@
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 Quota
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Quota 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 service limits (quotas) and usage of a resource. The
26
+ # response from Get API can be leveraged to submit quota update requests.
27
+ #
28
+ # @param subscription_id [String] Azure subscription id.
29
+ # @param provider_id [String] Azure resource provider id.
30
+ # @param location [String] Azure region.
31
+ # @param resource_name [String] The resource name for a resource provider, such
32
+ # as SKU name for Microsoft.Compute, Sku or TotalLowPriorityCores for
33
+ # Microsoft.MachineLearningServices
34
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
35
+ # will be added to the HTTP request.
36
+ #
37
+ # @return [CurrentQuotaLimitBase] operation results.
38
+ #
39
+ def get(subscription_id, provider_id, location, resource_name, custom_headers:nil)
40
+ response = get_async(subscription_id, provider_id, location, resource_name, custom_headers:custom_headers).value!
41
+ response.body unless response.nil?
42
+ end
43
+
44
+ #
45
+ # Gets the current service limits (quotas) and usage of a resource. The
46
+ # response from Get API can be leveraged to submit quota update requests.
47
+ #
48
+ # @param subscription_id [String] Azure subscription id.
49
+ # @param provider_id [String] Azure resource provider id.
50
+ # @param location [String] Azure region.
51
+ # @param resource_name [String] The resource name for a resource provider, such
52
+ # as SKU name for Microsoft.Compute, Sku or TotalLowPriorityCores for
53
+ # Microsoft.MachineLearningServices
54
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
55
+ # will be added to the HTTP request.
56
+ #
57
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
58
+ #
59
+ def get_with_http_info(subscription_id, provider_id, location, resource_name, custom_headers:nil)
60
+ get_async(subscription_id, provider_id, location, resource_name, custom_headers:custom_headers).value!
61
+ end
62
+
63
+ #
64
+ # Gets the current service limits (quotas) and usage of a resource. The
65
+ # response from Get API can be leveraged to submit quota update requests.
66
+ #
67
+ # @param subscription_id [String] Azure subscription id.
68
+ # @param provider_id [String] Azure resource provider id.
69
+ # @param location [String] Azure region.
70
+ # @param resource_name [String] The resource name for a resource provider, such
71
+ # as SKU name for Microsoft.Compute, Sku or TotalLowPriorityCores for
72
+ # Microsoft.MachineLearningServices
73
+ # @param [Hash{String => String}] A hash of custom headers that will be added
74
+ # to the HTTP request.
75
+ #
76
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
77
+ #
78
+ def get_async(subscription_id, provider_id, location, resource_name, custom_headers:nil)
79
+ fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
80
+ fail ArgumentError, 'provider_id is nil' if provider_id.nil?
81
+ fail ArgumentError, 'location is nil' if location.nil?
82
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
83
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
84
+
85
+
86
+ request_headers = {}
87
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
88
+
89
+ # Set Headers
90
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
91
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
92
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimits/{resourceName}'
93
+
94
+ request_url = @base_url || @client.base_url
95
+
96
+ options = {
97
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
98
+ path_params: {'subscriptionId' => subscription_id,'providerId' => provider_id,'location' => location,'resourceName' => resource_name},
99
+ query_params: {'api-version' => @client.api_version},
100
+ headers: request_headers.merge(custom_headers || {}),
101
+ base_url: request_url
102
+ }
103
+ promise = @client.make_request_async(:get, path_template, options)
104
+
105
+ promise = promise.then do |result|
106
+ http_response = result.response
107
+ status_code = http_response.status
108
+ response_content = http_response.body
109
+ unless status_code == 200
110
+ error_model = JSON.load(response_content)
111
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
112
+ end
113
+
114
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
115
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
116
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
117
+ # Deserialize Response
118
+ if status_code == 200
119
+ begin
120
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
121
+ result_mapper = Azure::Reservations::Mgmt::V2019_07_19_preview::Models::CurrentQuotaLimitBase.mapper()
122
+ result.body = @client.deserialize(result_mapper, parsed_response)
123
+ rescue Exception => e
124
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
125
+ end
126
+ end
127
+
128
+ result
129
+ end
130
+
131
+ promise.execute
132
+ end
133
+
134
+ #
135
+ # Create or update the service limits (quota) of a resource to requested value.
136
+ # Steps:
137
+ #
138
+ # 1. Make the Get request to get the quota information for specific resource.
139
+ #
140
+ # 2. To increase the quota, update the limit field in the response from Get
141
+ # request to new value.
142
+ #
143
+ # 3. Submit the JSON to the quota request API to update the quota.
144
+ # The Create quota request may be constructed as follows. The PUT operation can
145
+ # be used to update the quota.
146
+ #
147
+ # @param subscription_id [String] Azure subscription id.
148
+ # @param provider_id [String] Azure resource provider id.
149
+ # @param location [String] Azure region.
150
+ # @param resource_name [String] The resource name for a resource provider, such
151
+ # as SKU name for Microsoft.Compute, Sku or TotalLowPriorityCores for
152
+ # Microsoft.MachineLearningServices
153
+ # @param create_quota_request [CurrentQuotaLimitBase] Quota requests payload.
154
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
155
+ # will be added to the HTTP request.
156
+ #
157
+ # @return [Object] operation results.
158
+ #
159
+ def create_or_update(subscription_id, provider_id, location, resource_name, create_quota_request, custom_headers:nil)
160
+ response = create_or_update_async(subscription_id, provider_id, location, resource_name, create_quota_request, custom_headers:custom_headers).value!
161
+ response.body unless response.nil?
162
+ end
163
+
164
+ #
165
+ # @param subscription_id [String] Azure subscription id.
166
+ # @param provider_id [String] Azure resource provider id.
167
+ # @param location [String] Azure region.
168
+ # @param resource_name [String] The resource name for a resource provider, such
169
+ # as SKU name for Microsoft.Compute, Sku or TotalLowPriorityCores for
170
+ # Microsoft.MachineLearningServices
171
+ # @param create_quota_request [CurrentQuotaLimitBase] Quota requests payload.
172
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
173
+ # will be added to the HTTP request.
174
+ #
175
+ # @return [Concurrent::Promise] promise which provides async access to http
176
+ # response.
177
+ #
178
+ def create_or_update_async(subscription_id, provider_id, location, resource_name, create_quota_request, custom_headers:nil)
179
+ # Send request
180
+ promise = begin_create_or_update_async(subscription_id, provider_id, location, resource_name, create_quota_request, custom_headers:custom_headers)
181
+
182
+ promise = promise.then do |response|
183
+ # Defining deserialization method.
184
+ deserialize_method = lambda do |parsed_response|
185
+ result_mapper = {
186
+ client_side_validation: true,
187
+ required: false,
188
+ serialized_name: 'parsed_response',
189
+ type: {
190
+ name: 'Object'
191
+ }
192
+ }
193
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
194
+ end
195
+
196
+ # Waiting for response.
197
+ @client.get_long_running_operation_result(response, deserialize_method)
198
+ end
199
+
200
+ promise
201
+ end
202
+
203
+ #
204
+ # Update the service limits (quota) of a resource to requested value.
205
+ # Steps:
206
+ #
207
+ # 1. Make the Get request to get the quota information for specific resource.
208
+ #
209
+ # 2. To increase the quota, update the limit field in the response from Get
210
+ # request to new value.
211
+ #
212
+ # 3. Submit the JSON to the quota request API to update the quota.
213
+ # The Update quota request may be constructed as follows. The PATCH operation
214
+ # can be used to update the quota.
215
+ #
216
+ # @param subscription_id [String] Azure subscription id.
217
+ # @param provider_id [String] Azure resource provider id.
218
+ # @param location [String] Azure region.
219
+ # @param resource_name [String] The resource name for a resource provider, such
220
+ # as SKU name for Microsoft.Compute, Sku or TotalLowPriorityCores for
221
+ # Microsoft.MachineLearningServices
222
+ # @param create_quota_request [CurrentQuotaLimitBase] Quota requests payload.
223
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
224
+ # will be added to the HTTP request.
225
+ #
226
+ # @return [Object] operation results.
227
+ #
228
+ def update(subscription_id, provider_id, location, resource_name, create_quota_request, custom_headers:nil)
229
+ response = update_async(subscription_id, provider_id, location, resource_name, create_quota_request, custom_headers:custom_headers).value!
230
+ response.body unless response.nil?
231
+ end
232
+
233
+ #
234
+ # @param subscription_id [String] Azure subscription id.
235
+ # @param provider_id [String] Azure resource provider id.
236
+ # @param location [String] Azure region.
237
+ # @param resource_name [String] The resource name for a resource provider, such
238
+ # as SKU name for Microsoft.Compute, Sku or TotalLowPriorityCores for
239
+ # Microsoft.MachineLearningServices
240
+ # @param create_quota_request [CurrentQuotaLimitBase] Quota requests payload.
241
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
242
+ # will be added to the HTTP request.
243
+ #
244
+ # @return [Concurrent::Promise] promise which provides async access to http
245
+ # response.
246
+ #
247
+ def update_async(subscription_id, provider_id, location, resource_name, create_quota_request, custom_headers:nil)
248
+ # Send request
249
+ promise = begin_update_async(subscription_id, provider_id, location, resource_name, create_quota_request, custom_headers:custom_headers)
250
+
251
+ promise = promise.then do |response|
252
+ # Defining deserialization method.
253
+ deserialize_method = lambda do |parsed_response|
254
+ result_mapper = {
255
+ client_side_validation: true,
256
+ required: false,
257
+ serialized_name: 'parsed_response',
258
+ type: {
259
+ name: 'Object'
260
+ }
261
+ }
262
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
263
+ end
264
+
265
+ # Waiting for response.
266
+ @client.get_long_running_operation_result(response, deserialize_method)
267
+ end
268
+
269
+ promise
270
+ end
271
+
272
+ #
273
+ # Get a list of current service limits (quota) and usages of all the resources.
274
+ # The response from List API can be leveraged to submit quota update requests.
275
+ #
276
+ # @param subscription_id [String] Azure subscription id.
277
+ # @param provider_id [String] Azure resource provider id.
278
+ # @param location [String] Azure region.
279
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
280
+ # will be added to the HTTP request.
281
+ #
282
+ # @return [Array<CurrentQuotaLimitBase>] operation results.
283
+ #
284
+ def list(subscription_id, provider_id, location, custom_headers:nil)
285
+ first_page = list_as_lazy(subscription_id, provider_id, location, custom_headers:custom_headers)
286
+ first_page.get_all_items
287
+ end
288
+
289
+ #
290
+ # Get a list of current service limits (quota) and usages of all the resources.
291
+ # The response from List API can be leveraged to submit quota update requests.
292
+ #
293
+ # @param subscription_id [String] Azure subscription id.
294
+ # @param provider_id [String] Azure resource provider id.
295
+ # @param location [String] Azure region.
296
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
297
+ # will be added to the HTTP request.
298
+ #
299
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
300
+ #
301
+ def list_with_http_info(subscription_id, provider_id, location, custom_headers:nil)
302
+ list_async(subscription_id, provider_id, location, custom_headers:custom_headers).value!
303
+ end
304
+
305
+ #
306
+ # Get a list of current service limits (quota) and usages of all the resources.
307
+ # The response from List API can be leveraged to submit quota update requests.
308
+ #
309
+ # @param subscription_id [String] Azure subscription id.
310
+ # @param provider_id [String] Azure resource provider id.
311
+ # @param location [String] Azure region.
312
+ # @param [Hash{String => String}] A hash of custom headers that will be added
313
+ # to the HTTP request.
314
+ #
315
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
316
+ #
317
+ def list_async(subscription_id, provider_id, location, custom_headers:nil)
318
+ fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
319
+ fail ArgumentError, 'provider_id is nil' if provider_id.nil?
320
+ fail ArgumentError, 'location is nil' if location.nil?
321
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
322
+
323
+
324
+ request_headers = {}
325
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
326
+
327
+ # Set Headers
328
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
329
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
330
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimits'
331
+
332
+ request_url = @base_url || @client.base_url
333
+
334
+ options = {
335
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
336
+ path_params: {'subscriptionId' => subscription_id,'providerId' => provider_id,'location' => location},
337
+ query_params: {'api-version' => @client.api_version},
338
+ headers: request_headers.merge(custom_headers || {}),
339
+ base_url: request_url
340
+ }
341
+ promise = @client.make_request_async(:get, path_template, options)
342
+
343
+ promise = promise.then do |result|
344
+ http_response = result.response
345
+ status_code = http_response.status
346
+ response_content = http_response.body
347
+ unless status_code == 200
348
+ error_model = JSON.load(response_content)
349
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
350
+ end
351
+
352
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
353
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
354
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
355
+ # Deserialize Response
356
+ if status_code == 200
357
+ begin
358
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
359
+ result_mapper = Azure::Reservations::Mgmt::V2019_07_19_preview::Models::QuotaLimits.mapper()
360
+ result.body = @client.deserialize(result_mapper, parsed_response)
361
+ rescue Exception => e
362
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
363
+ end
364
+ end
365
+
366
+ result
367
+ end
368
+
369
+ promise.execute
370
+ end
371
+
372
+ #
373
+ # Create or update the service limits (quota) of a resource to requested value.
374
+ # Steps:
375
+ #
376
+ # 1. Make the Get request to get the quota information for specific resource.
377
+ #
378
+ # 2. To increase the quota, update the limit field in the response from Get
379
+ # request to new value.
380
+ #
381
+ # 3. Submit the JSON to the quota request API to update the quota.
382
+ # The Create quota request may be constructed as follows. The PUT operation can
383
+ # be used to update the quota.
384
+ #
385
+ # @param subscription_id [String] Azure subscription id.
386
+ # @param provider_id [String] Azure resource provider id.
387
+ # @param location [String] Azure region.
388
+ # @param resource_name [String] The resource name for a resource provider, such
389
+ # as SKU name for Microsoft.Compute, Sku or TotalLowPriorityCores for
390
+ # Microsoft.MachineLearningServices
391
+ # @param create_quota_request [CurrentQuotaLimitBase] Quota requests payload.
392
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
393
+ # will be added to the HTTP request.
394
+ #
395
+ # @return [Object] operation results.
396
+ #
397
+ def begin_create_or_update(subscription_id, provider_id, location, resource_name, create_quota_request, custom_headers:nil)
398
+ response = begin_create_or_update_async(subscription_id, provider_id, location, resource_name, create_quota_request, custom_headers:custom_headers).value!
399
+ response.body unless response.nil?
400
+ end
401
+
402
+ #
403
+ # Create or update the service limits (quota) of a resource to requested value.
404
+ # Steps:
405
+ #
406
+ # 1. Make the Get request to get the quota information for specific resource.
407
+ #
408
+ # 2. To increase the quota, update the limit field in the response from Get
409
+ # request to new value.
410
+ #
411
+ # 3. Submit the JSON to the quota request API to update the quota.
412
+ # The Create quota request may be constructed as follows. The PUT operation can
413
+ # be used to update the quota.
414
+ #
415
+ # @param subscription_id [String] Azure subscription id.
416
+ # @param provider_id [String] Azure resource provider id.
417
+ # @param location [String] Azure region.
418
+ # @param resource_name [String] The resource name for a resource provider, such
419
+ # as SKU name for Microsoft.Compute, Sku or TotalLowPriorityCores for
420
+ # Microsoft.MachineLearningServices
421
+ # @param create_quota_request [CurrentQuotaLimitBase] Quota requests payload.
422
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
423
+ # will be added to the HTTP request.
424
+ #
425
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
426
+ #
427
+ def begin_create_or_update_with_http_info(subscription_id, provider_id, location, resource_name, create_quota_request, custom_headers:nil)
428
+ begin_create_or_update_async(subscription_id, provider_id, location, resource_name, create_quota_request, custom_headers:custom_headers).value!
429
+ end
430
+
431
+ #
432
+ # Create or update the service limits (quota) of a resource to requested value.
433
+ # Steps:
434
+ #
435
+ # 1. Make the Get request to get the quota information for specific resource.
436
+ #
437
+ # 2. To increase the quota, update the limit field in the response from Get
438
+ # request to new value.
439
+ #
440
+ # 3. Submit the JSON to the quota request API to update the quota.
441
+ # The Create quota request may be constructed as follows. The PUT operation can
442
+ # be used to update the quota.
443
+ #
444
+ # @param subscription_id [String] Azure subscription id.
445
+ # @param provider_id [String] Azure resource provider id.
446
+ # @param location [String] Azure region.
447
+ # @param resource_name [String] The resource name for a resource provider, such
448
+ # as SKU name for Microsoft.Compute, Sku or TotalLowPriorityCores for
449
+ # Microsoft.MachineLearningServices
450
+ # @param create_quota_request [CurrentQuotaLimitBase] Quota requests payload.
451
+ # @param [Hash{String => String}] A hash of custom headers that will be added
452
+ # to the HTTP request.
453
+ #
454
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
455
+ #
456
+ def begin_create_or_update_async(subscription_id, provider_id, location, resource_name, create_quota_request, custom_headers:nil)
457
+ fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
458
+ fail ArgumentError, 'provider_id is nil' if provider_id.nil?
459
+ fail ArgumentError, 'location is nil' if location.nil?
460
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
461
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
462
+ fail ArgumentError, 'create_quota_request is nil' if create_quota_request.nil?
463
+
464
+
465
+ request_headers = {}
466
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
467
+
468
+ # Set Headers
469
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
470
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
471
+
472
+ # Serialize Request
473
+ request_mapper = Azure::Reservations::Mgmt::V2019_07_19_preview::Models::CurrentQuotaLimitBase.mapper()
474
+ request_content = @client.serialize(request_mapper, create_quota_request)
475
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
476
+
477
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimits/{resourceName}'
478
+
479
+ request_url = @base_url || @client.base_url
480
+
481
+ options = {
482
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
483
+ path_params: {'subscriptionId' => subscription_id,'providerId' => provider_id,'location' => location,'resourceName' => resource_name},
484
+ query_params: {'api-version' => @client.api_version},
485
+ body: request_content,
486
+ headers: request_headers.merge(custom_headers || {}),
487
+ base_url: request_url
488
+ }
489
+ promise = @client.make_request_async(:put, path_template, options)
490
+
491
+ promise = promise.then do |result|
492
+ http_response = result.response
493
+ status_code = http_response.status
494
+ response_content = http_response.body
495
+ unless status_code == 200 || status_code == 201
496
+ error_model = JSON.load(response_content)
497
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
498
+ end
499
+
500
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
501
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
502
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
503
+ # Deserialize Response
504
+ if status_code == 200
505
+ begin
506
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
507
+ result_mapper = Azure::Reservations::Mgmt::V2019_07_19_preview::Models::QuotaRequestOneResourceSubmitResponse.mapper()
508
+ result.body = @client.deserialize(result_mapper, parsed_response)
509
+ rescue Exception => e
510
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
511
+ end
512
+ end
513
+ # Deserialize Response
514
+ if status_code == 201
515
+ begin
516
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
517
+ result_mapper = Azure::Reservations::Mgmt::V2019_07_19_preview::Models::QuotaRequestSubmitResponse201.mapper()
518
+ result.body = @client.deserialize(result_mapper, parsed_response)
519
+ rescue Exception => e
520
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
521
+ end
522
+ end
523
+
524
+ result
525
+ end
526
+
527
+ promise.execute
528
+ end
529
+
530
+ #
531
+ # Update the service limits (quota) of a resource to requested value.
532
+ # Steps:
533
+ #
534
+ # 1. Make the Get request to get the quota information for specific resource.
535
+ #
536
+ # 2. To increase the quota, update the limit field in the response from Get
537
+ # request to new value.
538
+ #
539
+ # 3. Submit the JSON to the quota request API to update the quota.
540
+ # The Update quota request may be constructed as follows. The PATCH operation
541
+ # can be used to update the quota.
542
+ #
543
+ # @param subscription_id [String] Azure subscription id.
544
+ # @param provider_id [String] Azure resource provider id.
545
+ # @param location [String] Azure region.
546
+ # @param resource_name [String] The resource name for a resource provider, such
547
+ # as SKU name for Microsoft.Compute, Sku or TotalLowPriorityCores for
548
+ # Microsoft.MachineLearningServices
549
+ # @param create_quota_request [CurrentQuotaLimitBase] Quota requests payload.
550
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
551
+ # will be added to the HTTP request.
552
+ #
553
+ # @return [Object] operation results.
554
+ #
555
+ def begin_update(subscription_id, provider_id, location, resource_name, create_quota_request, custom_headers:nil)
556
+ response = begin_update_async(subscription_id, provider_id, location, resource_name, create_quota_request, custom_headers:custom_headers).value!
557
+ response.body unless response.nil?
558
+ end
559
+
560
+ #
561
+ # Update the service limits (quota) of a resource to requested value.
562
+ # Steps:
563
+ #
564
+ # 1. Make the Get request to get the quota information for specific resource.
565
+ #
566
+ # 2. To increase the quota, update the limit field in the response from Get
567
+ # request to new value.
568
+ #
569
+ # 3. Submit the JSON to the quota request API to update the quota.
570
+ # The Update quota request may be constructed as follows. The PATCH operation
571
+ # can be used to update the quota.
572
+ #
573
+ # @param subscription_id [String] Azure subscription id.
574
+ # @param provider_id [String] Azure resource provider id.
575
+ # @param location [String] Azure region.
576
+ # @param resource_name [String] The resource name for a resource provider, such
577
+ # as SKU name for Microsoft.Compute, Sku or TotalLowPriorityCores for
578
+ # Microsoft.MachineLearningServices
579
+ # @param create_quota_request [CurrentQuotaLimitBase] Quota requests payload.
580
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
581
+ # will be added to the HTTP request.
582
+ #
583
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
584
+ #
585
+ def begin_update_with_http_info(subscription_id, provider_id, location, resource_name, create_quota_request, custom_headers:nil)
586
+ begin_update_async(subscription_id, provider_id, location, resource_name, create_quota_request, custom_headers:custom_headers).value!
587
+ end
588
+
589
+ #
590
+ # Update the service limits (quota) of a resource to requested value.
591
+ # Steps:
592
+ #
593
+ # 1. Make the Get request to get the quota information for specific resource.
594
+ #
595
+ # 2. To increase the quota, update the limit field in the response from Get
596
+ # request to new value.
597
+ #
598
+ # 3. Submit the JSON to the quota request API to update the quota.
599
+ # The Update quota request may be constructed as follows. The PATCH operation
600
+ # can be used to update the quota.
601
+ #
602
+ # @param subscription_id [String] Azure subscription id.
603
+ # @param provider_id [String] Azure resource provider id.
604
+ # @param location [String] Azure region.
605
+ # @param resource_name [String] The resource name for a resource provider, such
606
+ # as SKU name for Microsoft.Compute, Sku or TotalLowPriorityCores for
607
+ # Microsoft.MachineLearningServices
608
+ # @param create_quota_request [CurrentQuotaLimitBase] Quota requests payload.
609
+ # @param [Hash{String => String}] A hash of custom headers that will be added
610
+ # to the HTTP request.
611
+ #
612
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
613
+ #
614
+ def begin_update_async(subscription_id, provider_id, location, resource_name, create_quota_request, custom_headers:nil)
615
+ fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
616
+ fail ArgumentError, 'provider_id is nil' if provider_id.nil?
617
+ fail ArgumentError, 'location is nil' if location.nil?
618
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
619
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
620
+ fail ArgumentError, 'create_quota_request is nil' if create_quota_request.nil?
621
+
622
+
623
+ request_headers = {}
624
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
625
+
626
+ # Set Headers
627
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
628
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
629
+
630
+ # Serialize Request
631
+ request_mapper = Azure::Reservations::Mgmt::V2019_07_19_preview::Models::CurrentQuotaLimitBase.mapper()
632
+ request_content = @client.serialize(request_mapper, create_quota_request)
633
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
634
+
635
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimits/{resourceName}'
636
+
637
+ request_url = @base_url || @client.base_url
638
+
639
+ options = {
640
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
641
+ path_params: {'subscriptionId' => subscription_id,'providerId' => provider_id,'location' => location,'resourceName' => resource_name},
642
+ query_params: {'api-version' => @client.api_version},
643
+ body: request_content,
644
+ headers: request_headers.merge(custom_headers || {}),
645
+ base_url: request_url
646
+ }
647
+ promise = @client.make_request_async(:patch, path_template, options)
648
+
649
+ promise = promise.then do |result|
650
+ http_response = result.response
651
+ status_code = http_response.status
652
+ response_content = http_response.body
653
+ unless status_code == 200 || status_code == 201
654
+ error_model = JSON.load(response_content)
655
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
656
+ end
657
+
658
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
659
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
660
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
661
+ # Deserialize Response
662
+ if status_code == 200
663
+ begin
664
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
665
+ result_mapper = Azure::Reservations::Mgmt::V2019_07_19_preview::Models::QuotaRequestOneResourceSubmitResponse.mapper()
666
+ result.body = @client.deserialize(result_mapper, parsed_response)
667
+ rescue Exception => e
668
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
669
+ end
670
+ end
671
+ # Deserialize Response
672
+ if status_code == 201
673
+ begin
674
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
675
+ result_mapper = Azure::Reservations::Mgmt::V2019_07_19_preview::Models::QuotaRequestSubmitResponse201.mapper()
676
+ result.body = @client.deserialize(result_mapper, parsed_response)
677
+ rescue Exception => e
678
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
679
+ end
680
+ end
681
+
682
+ result
683
+ end
684
+
685
+ promise.execute
686
+ end
687
+
688
+ #
689
+ # Get a list of current service limits (quota) and usages of all the resources.
690
+ # The response from List API can be leveraged to submit quota update requests.
691
+ #
692
+ # @param next_page_link [String] The NextLink from the previous successful call
693
+ # to List operation.
694
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
695
+ # will be added to the HTTP request.
696
+ #
697
+ # @return [QuotaLimits] operation results.
698
+ #
699
+ def list_next(next_page_link, custom_headers:nil)
700
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
701
+ response.body unless response.nil?
702
+ end
703
+
704
+ #
705
+ # Get a list of current service limits (quota) and usages of all the resources.
706
+ # The response from List API can be leveraged to submit quota update requests.
707
+ #
708
+ # @param next_page_link [String] The NextLink from the previous successful call
709
+ # to List operation.
710
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
711
+ # will be added to the HTTP request.
712
+ #
713
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
714
+ #
715
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
716
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
717
+ end
718
+
719
+ #
720
+ # Get a list of current service limits (quota) and usages of all the resources.
721
+ # The response from List API can be leveraged to submit quota update requests.
722
+ #
723
+ # @param next_page_link [String] The NextLink from the previous successful call
724
+ # to List operation.
725
+ # @param [Hash{String => String}] A hash of custom headers that will be added
726
+ # to the HTTP request.
727
+ #
728
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
729
+ #
730
+ def list_next_async(next_page_link, custom_headers:nil)
731
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
732
+
733
+
734
+ request_headers = {}
735
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
736
+
737
+ # Set Headers
738
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
739
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
740
+ path_template = '{nextLink}'
741
+
742
+ request_url = @base_url || @client.base_url
743
+
744
+ options = {
745
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
746
+ skip_encoding_path_params: {'nextLink' => next_page_link},
747
+ headers: request_headers.merge(custom_headers || {}),
748
+ base_url: request_url
749
+ }
750
+ promise = @client.make_request_async(:get, path_template, options)
751
+
752
+ promise = promise.then do |result|
753
+ http_response = result.response
754
+ status_code = http_response.status
755
+ response_content = http_response.body
756
+ unless status_code == 200
757
+ error_model = JSON.load(response_content)
758
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
759
+ end
760
+
761
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
762
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
763
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
764
+ # Deserialize Response
765
+ if status_code == 200
766
+ begin
767
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
768
+ result_mapper = Azure::Reservations::Mgmt::V2019_07_19_preview::Models::QuotaLimits.mapper()
769
+ result.body = @client.deserialize(result_mapper, parsed_response)
770
+ rescue Exception => e
771
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
772
+ end
773
+ end
774
+
775
+ result
776
+ end
777
+
778
+ promise.execute
779
+ end
780
+
781
+ #
782
+ # Get a list of current service limits (quota) and usages of all the resources.
783
+ # The response from List API can be leveraged to submit quota update requests.
784
+ #
785
+ # @param subscription_id [String] Azure subscription id.
786
+ # @param provider_id [String] Azure resource provider id.
787
+ # @param location [String] Azure region.
788
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
789
+ # will be added to the HTTP request.
790
+ #
791
+ # @return [QuotaLimits] which provide lazy access to pages of the response.
792
+ #
793
+ def list_as_lazy(subscription_id, provider_id, location, custom_headers:nil)
794
+ response = list_async(subscription_id, provider_id, location, custom_headers:custom_headers).value!
795
+ unless response.nil?
796
+ page = response.body
797
+ page.next_method = Proc.new do |next_page_link|
798
+ list_next_async(next_page_link, custom_headers:custom_headers)
799
+ end
800
+ page
801
+ end
802
+ end
803
+
804
+ end
805
+ end