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,397 @@
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 QuotaRequestStatus
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the QuotaRequestStatus 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 QuotaRequest details and status by the quota request Id for the
26
+ # resources for the resource provider at a specific location. The requestId is
27
+ # returned as response to the Put requests for serviceLimits.
28
+ #
29
+ # @param subscription_id [String] Azure subscription id.
30
+ # @param provider_id [String] Azure resource provider id.
31
+ # @param location [String] Azure region.
32
+ # @param id [String] Quota Request id.
33
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
34
+ # will be added to the HTTP request.
35
+ #
36
+ # @return [QuotaRequestDetails] operation results.
37
+ #
38
+ def get(subscription_id, provider_id, location, id, custom_headers:nil)
39
+ response = get_async(subscription_id, provider_id, location, id, custom_headers:custom_headers).value!
40
+ response.body unless response.nil?
41
+ end
42
+
43
+ #
44
+ # Gets the QuotaRequest details and status by the quota request Id for the
45
+ # resources for the resource provider at a specific location. The requestId is
46
+ # returned as response to the Put requests for serviceLimits.
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 id [String] Quota Request id.
52
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
53
+ # will be added to the HTTP request.
54
+ #
55
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
56
+ #
57
+ def get_with_http_info(subscription_id, provider_id, location, id, custom_headers:nil)
58
+ get_async(subscription_id, provider_id, location, id, custom_headers:custom_headers).value!
59
+ end
60
+
61
+ #
62
+ # Gets the QuotaRequest details and status by the quota request Id for the
63
+ # resources for the resource provider at a specific location. The requestId is
64
+ # returned as response to the Put requests for serviceLimits.
65
+ #
66
+ # @param subscription_id [String] Azure subscription id.
67
+ # @param provider_id [String] Azure resource provider id.
68
+ # @param location [String] Azure region.
69
+ # @param id [String] Quota Request id.
70
+ # @param [Hash{String => String}] A hash of custom headers that will be added
71
+ # to the HTTP request.
72
+ #
73
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
74
+ #
75
+ def get_async(subscription_id, provider_id, location, id, custom_headers:nil)
76
+ fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
77
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
78
+ fail ArgumentError, 'provider_id is nil' if provider_id.nil?
79
+ fail ArgumentError, 'location is nil' if location.nil?
80
+ fail ArgumentError, 'id is nil' if id.nil?
81
+
82
+
83
+ request_headers = {}
84
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
85
+
86
+ # Set Headers
87
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
88
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
89
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimitsRequests/{id}'
90
+
91
+ request_url = @base_url || @client.base_url
92
+
93
+ options = {
94
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
95
+ path_params: {'subscriptionId' => subscription_id,'providerId' => provider_id,'location' => location,'id' => id},
96
+ query_params: {'api-version' => @client.api_version},
97
+ headers: request_headers.merge(custom_headers || {}),
98
+ base_url: request_url
99
+ }
100
+ promise = @client.make_request_async(:get, path_template, options)
101
+
102
+ promise = promise.then do |result|
103
+ http_response = result.response
104
+ status_code = http_response.status
105
+ response_content = http_response.body
106
+ unless status_code == 200
107
+ error_model = JSON.load(response_content)
108
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
109
+ end
110
+
111
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
112
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
113
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
114
+ # Deserialize Response
115
+ if status_code == 200
116
+ begin
117
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
118
+ result_mapper = Azure::Reservations::Mgmt::V2019_07_19_preview::Models::QuotaRequestDetails.mapper()
119
+ result.body = @client.deserialize(result_mapper, parsed_response)
120
+ rescue Exception => e
121
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
122
+ end
123
+ end
124
+
125
+ result
126
+ end
127
+
128
+ promise.execute
129
+ end
130
+
131
+ #
132
+ # For the specified location and Resource provider gets the current quota
133
+ # requests under the subscription over the time period of one year ago from now
134
+ # to one year back. oData filter can be used to select quota requests.
135
+ #
136
+ # @param subscription_id [String] Azure subscription id.
137
+ # @param provider_id [String] Azure resource provider id.
138
+ # @param location [String] Azure region.
139
+ # @param filter [String] | Field | Supported operators
140
+ # |---------------------|------------------------
141
+ #
142
+ # |requestSubmitTime | ge, le, eq, gt, lt
143
+ #
144
+ # @param top [Integer] Number of records to return.
145
+ # @param skiptoken [String] Skiptoken is only used if a previous operation
146
+ # returned a partial result. If a previous response contains a nextLink
147
+ # element, the value of the nextLink element will include a skiptoken parameter
148
+ # that specifies a starting point to use for subsequent calls
149
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
150
+ # will be added to the HTTP request.
151
+ #
152
+ # @return [Array<QuotaRequestDetails>] operation results.
153
+ #
154
+ def list(subscription_id, provider_id, location, filter:nil, top:nil, skiptoken:nil, custom_headers:nil)
155
+ first_page = list_as_lazy(subscription_id, provider_id, location, filter:filter, top:top, skiptoken:skiptoken, custom_headers:custom_headers)
156
+ first_page.get_all_items
157
+ end
158
+
159
+ #
160
+ # For the specified location and Resource provider gets the current quota
161
+ # requests under the subscription over the time period of one year ago from now
162
+ # to one year back. oData filter can be used to select quota requests.
163
+ #
164
+ # @param subscription_id [String] Azure subscription id.
165
+ # @param provider_id [String] Azure resource provider id.
166
+ # @param location [String] Azure region.
167
+ # @param filter [String] | Field | Supported operators
168
+ # |---------------------|------------------------
169
+ #
170
+ # |requestSubmitTime | ge, le, eq, gt, lt
171
+ #
172
+ # @param top [Integer] Number of records to return.
173
+ # @param skiptoken [String] Skiptoken is only used if a previous operation
174
+ # returned a partial result. If a previous response contains a nextLink
175
+ # element, the value of the nextLink element will include a skiptoken parameter
176
+ # that specifies a starting point to use for subsequent calls
177
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
178
+ # will be added to the HTTP request.
179
+ #
180
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
181
+ #
182
+ def list_with_http_info(subscription_id, provider_id, location, filter:nil, top:nil, skiptoken:nil, custom_headers:nil)
183
+ list_async(subscription_id, provider_id, location, filter:filter, top:top, skiptoken:skiptoken, custom_headers:custom_headers).value!
184
+ end
185
+
186
+ #
187
+ # For the specified location and Resource provider gets the current quota
188
+ # requests under the subscription over the time period of one year ago from now
189
+ # to one year back. oData filter can be used to select quota requests.
190
+ #
191
+ # @param subscription_id [String] Azure subscription id.
192
+ # @param provider_id [String] Azure resource provider id.
193
+ # @param location [String] Azure region.
194
+ # @param filter [String] | Field | Supported operators
195
+ # |---------------------|------------------------
196
+ #
197
+ # |requestSubmitTime | ge, le, eq, gt, lt
198
+ #
199
+ # @param top [Integer] Number of records to return.
200
+ # @param skiptoken [String] Skiptoken is only used if a previous operation
201
+ # returned a partial result. If a previous response contains a nextLink
202
+ # element, the value of the nextLink element will include a skiptoken parameter
203
+ # that specifies a starting point to use for subsequent calls
204
+ # @param [Hash{String => String}] A hash of custom headers that will be added
205
+ # to the HTTP request.
206
+ #
207
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
208
+ #
209
+ def list_async(subscription_id, provider_id, location, filter:nil, top:nil, skiptoken:nil, custom_headers:nil)
210
+ fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
211
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
212
+ fail ArgumentError, 'provider_id is nil' if provider_id.nil?
213
+ fail ArgumentError, 'location is nil' if location.nil?
214
+ fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1
215
+
216
+
217
+ request_headers = {}
218
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
219
+
220
+ # Set Headers
221
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
222
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
223
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimitsRequests'
224
+
225
+ request_url = @base_url || @client.base_url
226
+
227
+ options = {
228
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
229
+ path_params: {'subscriptionId' => subscription_id,'providerId' => provider_id,'location' => location},
230
+ query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top,'$skiptoken' => skiptoken},
231
+ headers: request_headers.merge(custom_headers || {}),
232
+ base_url: request_url
233
+ }
234
+ promise = @client.make_request_async(:get, path_template, options)
235
+
236
+ promise = promise.then do |result|
237
+ http_response = result.response
238
+ status_code = http_response.status
239
+ response_content = http_response.body
240
+ unless status_code == 200
241
+ error_model = JSON.load(response_content)
242
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
243
+ end
244
+
245
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
246
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
247
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
248
+ # Deserialize Response
249
+ if status_code == 200
250
+ begin
251
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
252
+ result_mapper = Azure::Reservations::Mgmt::V2019_07_19_preview::Models::QuotaRequestDetailsList.mapper()
253
+ result.body = @client.deserialize(result_mapper, parsed_response)
254
+ rescue Exception => e
255
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
256
+ end
257
+ end
258
+
259
+ result
260
+ end
261
+
262
+ promise.execute
263
+ end
264
+
265
+ #
266
+ # For the specified location and Resource provider gets the current quota
267
+ # requests under the subscription over the time period of one year ago from now
268
+ # to one year back. oData filter can be used to select quota requests.
269
+ #
270
+ # @param next_page_link [String] The NextLink from the previous successful call
271
+ # to List operation.
272
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
273
+ # will be added to the HTTP request.
274
+ #
275
+ # @return [QuotaRequestDetailsList] operation results.
276
+ #
277
+ def list_next(next_page_link, custom_headers:nil)
278
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
279
+ response.body unless response.nil?
280
+ end
281
+
282
+ #
283
+ # For the specified location and Resource provider gets the current quota
284
+ # requests under the subscription over the time period of one year ago from now
285
+ # to one year back. oData filter can be used to select quota requests.
286
+ #
287
+ # @param next_page_link [String] The NextLink from the previous successful call
288
+ # to List operation.
289
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
290
+ # will be added to the HTTP request.
291
+ #
292
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
293
+ #
294
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
295
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
296
+ end
297
+
298
+ #
299
+ # For the specified location and Resource provider gets the current quota
300
+ # requests under the subscription over the time period of one year ago from now
301
+ # to one year back. oData filter can be used to select quota requests.
302
+ #
303
+ # @param next_page_link [String] The NextLink from the previous successful call
304
+ # to List operation.
305
+ # @param [Hash{String => String}] A hash of custom headers that will be added
306
+ # to the HTTP request.
307
+ #
308
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
309
+ #
310
+ def list_next_async(next_page_link, custom_headers:nil)
311
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
312
+
313
+
314
+ request_headers = {}
315
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
316
+
317
+ # Set Headers
318
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
319
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
320
+ path_template = '{nextLink}'
321
+
322
+ request_url = @base_url || @client.base_url
323
+
324
+ options = {
325
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
326
+ skip_encoding_path_params: {'nextLink' => next_page_link},
327
+ headers: request_headers.merge(custom_headers || {}),
328
+ base_url: request_url
329
+ }
330
+ promise = @client.make_request_async(:get, path_template, options)
331
+
332
+ promise = promise.then do |result|
333
+ http_response = result.response
334
+ status_code = http_response.status
335
+ response_content = http_response.body
336
+ unless status_code == 200
337
+ error_model = JSON.load(response_content)
338
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
339
+ end
340
+
341
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
342
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
343
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
344
+ # Deserialize Response
345
+ if status_code == 200
346
+ begin
347
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
348
+ result_mapper = Azure::Reservations::Mgmt::V2019_07_19_preview::Models::QuotaRequestDetailsList.mapper()
349
+ result.body = @client.deserialize(result_mapper, parsed_response)
350
+ rescue Exception => e
351
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
352
+ end
353
+ end
354
+
355
+ result
356
+ end
357
+
358
+ promise.execute
359
+ end
360
+
361
+ #
362
+ # For the specified location and Resource provider gets the current quota
363
+ # requests under the subscription over the time period of one year ago from now
364
+ # to one year back. oData filter can be used to select quota requests.
365
+ #
366
+ # @param subscription_id [String] Azure subscription id.
367
+ # @param provider_id [String] Azure resource provider id.
368
+ # @param location [String] Azure region.
369
+ # @param filter [String] | Field | Supported operators
370
+ # |---------------------|------------------------
371
+ #
372
+ # |requestSubmitTime | ge, le, eq, gt, lt
373
+ #
374
+ # @param top [Integer] Number of records to return.
375
+ # @param skiptoken [String] Skiptoken is only used if a previous operation
376
+ # returned a partial result. If a previous response contains a nextLink
377
+ # element, the value of the nextLink element will include a skiptoken parameter
378
+ # that specifies a starting point to use for subsequent calls
379
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
380
+ # will be added to the HTTP request.
381
+ #
382
+ # @return [QuotaRequestDetailsList] which provide lazy access to pages of the
383
+ # response.
384
+ #
385
+ def list_as_lazy(subscription_id, provider_id, location, filter:nil, top:nil, skiptoken:nil, custom_headers:nil)
386
+ response = list_async(subscription_id, provider_id, location, filter:filter, top:top, skiptoken:skiptoken, custom_headers:custom_headers).value!
387
+ unless response.nil?
388
+ page = response.body
389
+ page.next_method = Proc.new do |next_page_link|
390
+ list_next_async(next_page_link, custom_headers:custom_headers)
391
+ end
392
+ page
393
+ end
394
+ end
395
+
396
+ end
397
+ end
@@ -0,0 +1,136 @@
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
+ # A service client - single point of access to the REST API.
9
+ #
10
+ class ReservationsManagementClient < MsRestAzure::AzureServiceClient
11
+ include MsRestAzure
12
+ include MsRestAzure::Serialization
13
+
14
+ # @return [String] the base URI of the service.
15
+ attr_accessor :base_url
16
+
17
+ # @return Credentials needed for the client to connect to Azure.
18
+ attr_reader :credentials
19
+
20
+ # @return [String] API version.
21
+ attr_reader :api_version
22
+
23
+ # @return [String] The preferred language for the response.
24
+ attr_accessor :accept_language
25
+
26
+ # @return [Integer] The retry timeout in seconds for Long Running
27
+ # Operations. Default value is 30.
28
+ attr_accessor :long_running_operation_retry_timeout
29
+
30
+ # @return [Boolean] Whether a unique x-ms-client-request-id should be
31
+ # generated. When set to true a unique x-ms-client-request-id value is
32
+ # generated and included in each request. Default is true.
33
+ attr_accessor :generate_client_request_id
34
+
35
+ # @return [Quota] quota
36
+ attr_reader :quota
37
+
38
+ # @return [QuotaRequestStatus] quota_request_status
39
+ attr_reader :quota_request_status
40
+
41
+ # @return [AutoQuotaIncrease] auto_quota_increase
42
+ attr_reader :auto_quota_increase
43
+
44
+ #
45
+ # Creates initializes a new instance of the ReservationsManagementClient class.
46
+ # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
47
+ # @param base_url [String] the base URI of the service.
48
+ # @param options [Array] filters to be applied to the HTTP requests.
49
+ #
50
+ def initialize(credentials = nil, base_url = nil, options = nil)
51
+ super(credentials, options)
52
+ @base_url = base_url || 'https://management.azure.com'
53
+
54
+ fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
55
+ @credentials = credentials
56
+
57
+ @quota = Quota.new(self)
58
+ @quota_request_status = QuotaRequestStatus.new(self)
59
+ @auto_quota_increase = AutoQuotaIncrease.new(self)
60
+ @api_version = '2019-07-19-preview'
61
+ @accept_language = 'en-US'
62
+ @long_running_operation_retry_timeout = 30
63
+ @generate_client_request_id = true
64
+ add_telemetry
65
+ end
66
+
67
+ #
68
+ # Makes a request and returns the body of the response.
69
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
70
+ # @param path [String] the path, relative to {base_url}.
71
+ # @param options [Hash{String=>String}] specifying any request options like :body.
72
+ # @return [Hash{String=>String}] containing the body of the response.
73
+ # Example:
74
+ #
75
+ # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
76
+ # path = "/path"
77
+ # options = {
78
+ # body: request_content,
79
+ # query_params: {'api-version' => '2016-02-01'}
80
+ # }
81
+ # result = @client.make_request(:put, path, options)
82
+ #
83
+ def make_request(method, path, options = {})
84
+ result = make_request_with_http_info(method, path, options)
85
+ result.body unless result.nil?
86
+ end
87
+
88
+ #
89
+ # Makes a request and returns the operation response.
90
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
91
+ # @param path [String] the path, relative to {base_url}.
92
+ # @param options [Hash{String=>String}] specifying any request options like :body.
93
+ # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
94
+ #
95
+ def make_request_with_http_info(method, path, options = {})
96
+ result = make_request_async(method, path, options).value!
97
+ result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
98
+ result
99
+ end
100
+
101
+ #
102
+ # Makes a request asynchronously.
103
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
104
+ # @param path [String] the path, relative to {base_url}.
105
+ # @param options [Hash{String=>String}] specifying any request options like :body.
106
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
107
+ #
108
+ def make_request_async(method, path, options = {})
109
+ fail ArgumentError, 'method is nil' if method.nil?
110
+ fail ArgumentError, 'path is nil' if path.nil?
111
+
112
+ request_url = options[:base_url] || @base_url
113
+ if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
114
+ @request_headers['Content-Type'] = options[:headers]['Content-Type']
115
+ end
116
+
117
+ request_headers = @request_headers
118
+ request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
119
+ options.merge!({headers: request_headers.merge(options[:headers] || {})})
120
+ options.merge!({credentials: @credentials}) unless @credentials.nil?
121
+
122
+ super(request_url, method, path, options)
123
+ end
124
+
125
+
126
+ private
127
+ #
128
+ # Adds telemetry information.
129
+ #
130
+ def add_telemetry
131
+ sdk_information = 'azure_mgmt_reservations'
132
+ sdk_information = "#{sdk_information}/0.20.0"
133
+ add_user_agent_information(sdk_information)
134
+ end
135
+ end
136
+ end