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,355 @@
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_04_01_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] Supported version for this document is 2019-04-01
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 [Reservation] reservation
36
+ attr_reader :reservation
37
+
38
+ # @return [ReservationOrder] reservation_order
39
+ attr_reader :reservation_order
40
+
41
+ # @return [Operation] operation
42
+ attr_reader :operation
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
+ @reservation = Reservation.new(self)
58
+ @reservation_order = ReservationOrder.new(self)
59
+ @operation = Operation.new(self)
60
+ @api_version = '2019-04-01'
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
+ # Get the regions and skus that are available for RI purchase for the specified
127
+ # Azure subscription.
128
+ #
129
+ # @param subscription_id [String] Id of the subscription
130
+ # @param reserved_resource_type [String] The type of the resource for which the
131
+ # skus should be provided.
132
+ # @param location [String] Filters the skus based on the location specified in
133
+ # this parameter. This can be an azure region or global
134
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
135
+ # will be added to the HTTP request.
136
+ #
137
+ # @return [Array] operation results.
138
+ #
139
+ def get_catalog(subscription_id, reserved_resource_type, location:nil, custom_headers:nil)
140
+ response = get_catalog_async(subscription_id, reserved_resource_type, location:location, custom_headers:custom_headers).value!
141
+ response.body unless response.nil?
142
+ end
143
+
144
+ #
145
+ # Get the regions and skus that are available for RI purchase for the specified
146
+ # Azure subscription.
147
+ #
148
+ # @param subscription_id [String] Id of the subscription
149
+ # @param reserved_resource_type [String] The type of the resource for which the
150
+ # skus should be provided.
151
+ # @param location [String] Filters the skus based on the location specified in
152
+ # this parameter. This can be an azure region or global
153
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
154
+ # will be added to the HTTP request.
155
+ #
156
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
157
+ #
158
+ def get_catalog_with_http_info(subscription_id, reserved_resource_type, location:nil, custom_headers:nil)
159
+ get_catalog_async(subscription_id, reserved_resource_type, location:location, custom_headers:custom_headers).value!
160
+ end
161
+
162
+ #
163
+ # Get the regions and skus that are available for RI purchase for the specified
164
+ # Azure subscription.
165
+ #
166
+ # @param subscription_id [String] Id of the subscription
167
+ # @param reserved_resource_type [String] The type of the resource for which the
168
+ # skus should be provided.
169
+ # @param location [String] Filters the skus based on the location specified in
170
+ # this parameter. This can be an azure region or global
171
+ # @param [Hash{String => String}] A hash of custom headers that will be added
172
+ # to the HTTP request.
173
+ #
174
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
175
+ #
176
+ def get_catalog_async(subscription_id, reserved_resource_type, location:nil, custom_headers:nil)
177
+ fail ArgumentError, 'api_version is nil' if api_version.nil?
178
+ fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
179
+ fail ArgumentError, 'reserved_resource_type is nil' if reserved_resource_type.nil?
180
+
181
+
182
+ request_headers = {}
183
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
184
+
185
+ # Set Headers
186
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
187
+ request_headers['accept-language'] = accept_language unless accept_language.nil?
188
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Capacity/catalogs'
189
+
190
+ request_url = @base_url || self.base_url
191
+
192
+ options = {
193
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
194
+ path_params: {'subscriptionId' => subscription_id},
195
+ query_params: {'api-version' => api_version,'reservedResourceType' => reserved_resource_type,'location' => location},
196
+ headers: request_headers.merge(custom_headers || {}),
197
+ base_url: request_url
198
+ }
199
+ promise = self.make_request_async(:get, path_template, options)
200
+
201
+ promise = promise.then do |result|
202
+ http_response = result.response
203
+ status_code = http_response.status
204
+ response_content = http_response.body
205
+ unless status_code == 200
206
+ error_model = JSON.load(response_content)
207
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
208
+ end
209
+
210
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
211
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
212
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
213
+ # Deserialize Response
214
+ if status_code == 200
215
+ begin
216
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
217
+ result_mapper = {
218
+ client_side_validation: true,
219
+ required: false,
220
+ serialized_name: 'parsed_response',
221
+ type: {
222
+ name: 'Sequence',
223
+ element: {
224
+ client_side_validation: true,
225
+ required: false,
226
+ serialized_name: 'CatalogElementType',
227
+ type: {
228
+ name: 'Composite',
229
+ class_name: 'Catalog'
230
+ }
231
+ }
232
+ }
233
+ }
234
+ result.body = self.deserialize(result_mapper, parsed_response)
235
+ rescue Exception => e
236
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
237
+ end
238
+ end
239
+
240
+ result
241
+ end
242
+
243
+ promise.execute
244
+ end
245
+
246
+ #
247
+ # Get list of applicable `Reservation`s.
248
+ #
249
+ # Get applicable `Reservation`s that are applied to this subscription or a
250
+ # resource group under this subscription.
251
+ #
252
+ # @param subscription_id [String] Id of the subscription
253
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
254
+ # will be added to the HTTP request.
255
+ #
256
+ # @return [AppliedReservations] operation results.
257
+ #
258
+ def get_applied_reservation_list(subscription_id, custom_headers:nil)
259
+ response = get_applied_reservation_list_async(subscription_id, custom_headers:custom_headers).value!
260
+ response.body unless response.nil?
261
+ end
262
+
263
+ #
264
+ # Get list of applicable `Reservation`s.
265
+ #
266
+ # Get applicable `Reservation`s that are applied to this subscription or a
267
+ # resource group under this subscription.
268
+ #
269
+ # @param subscription_id [String] Id of the subscription
270
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
271
+ # will be added to the HTTP request.
272
+ #
273
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
274
+ #
275
+ def get_applied_reservation_list_with_http_info(subscription_id, custom_headers:nil)
276
+ get_applied_reservation_list_async(subscription_id, custom_headers:custom_headers).value!
277
+ end
278
+
279
+ #
280
+ # Get list of applicable `Reservation`s.
281
+ #
282
+ # Get applicable `Reservation`s that are applied to this subscription or a
283
+ # resource group under this subscription.
284
+ #
285
+ # @param subscription_id [String] Id of the subscription
286
+ # @param [Hash{String => String}] A hash of custom headers that will be added
287
+ # to the HTTP request.
288
+ #
289
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
290
+ #
291
+ def get_applied_reservation_list_async(subscription_id, custom_headers:nil)
292
+ fail ArgumentError, 'api_version is nil' if api_version.nil?
293
+ fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
294
+
295
+
296
+ request_headers = {}
297
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
298
+
299
+ # Set Headers
300
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
301
+ request_headers['accept-language'] = accept_language unless accept_language.nil?
302
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Capacity/appliedReservations'
303
+
304
+ request_url = @base_url || self.base_url
305
+
306
+ options = {
307
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
308
+ path_params: {'subscriptionId' => subscription_id},
309
+ query_params: {'api-version' => api_version},
310
+ headers: request_headers.merge(custom_headers || {}),
311
+ base_url: request_url
312
+ }
313
+ promise = self.make_request_async(:get, path_template, options)
314
+
315
+ promise = promise.then do |result|
316
+ http_response = result.response
317
+ status_code = http_response.status
318
+ response_content = http_response.body
319
+ unless status_code == 200
320
+ error_model = JSON.load(response_content)
321
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
322
+ end
323
+
324
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
325
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
326
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
327
+ # Deserialize Response
328
+ if status_code == 200
329
+ begin
330
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
331
+ result_mapper = Azure::Reservations::Mgmt::V2019_04_01_preview::Models::AppliedReservations.mapper()
332
+ result.body = self.deserialize(result_mapper, parsed_response)
333
+ rescue Exception => e
334
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
335
+ end
336
+ end
337
+
338
+ result
339
+ end
340
+
341
+ promise.execute
342
+ end
343
+
344
+
345
+ private
346
+ #
347
+ # Adds telemetry information.
348
+ #
349
+ def add_telemetry
350
+ sdk_information = 'azure_mgmt_reservations'
351
+ sdk_information = "#{sdk_information}/0.20.0"
352
+ add_user_agent_information(sdk_information)
353
+ end
354
+ end
355
+ end
@@ -0,0 +1,54 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ require 'uri'
7
+ require 'cgi'
8
+ require 'date'
9
+ require 'json'
10
+ require 'base64'
11
+ require 'erb'
12
+ require 'securerandom'
13
+ require 'time'
14
+ require 'timeliness'
15
+ require 'faraday'
16
+ require 'faraday-cookie_jar'
17
+ require 'concurrent'
18
+ require 'ms_rest'
19
+ require '2019-07-19-preview/generated/azure_mgmt_reservations/module_definition'
20
+ require 'ms_rest_azure'
21
+
22
+ module Azure::Reservations::Mgmt::V2019_07_19_preview
23
+ autoload :Quota, '2019-07-19-preview/generated/azure_mgmt_reservations/quota.rb'
24
+ autoload :QuotaRequestStatus, '2019-07-19-preview/generated/azure_mgmt_reservations/quota_request_status.rb'
25
+ autoload :AutoQuotaIncrease, '2019-07-19-preview/generated/azure_mgmt_reservations/auto_quota_increase.rb'
26
+ autoload :ReservationsManagementClient, '2019-07-19-preview/generated/azure_mgmt_reservations/reservations_management_client.rb'
27
+
28
+ module Models
29
+ autoload :QuotaRequestDetails, '2019-07-19-preview/generated/azure_mgmt_reservations/models/quota_request_details.rb'
30
+ autoload :ResourceName, '2019-07-19-preview/generated/azure_mgmt_reservations/models/resource_name.rb'
31
+ autoload :QuotaRequestDetailsList, '2019-07-19-preview/generated/azure_mgmt_reservations/models/quota_request_details_list.rb'
32
+ autoload :CurrentQuotaLimitBase, '2019-07-19-preview/generated/azure_mgmt_reservations/models/current_quota_limit_base.rb'
33
+ autoload :AqiSettings, '2019-07-19-preview/generated/azure_mgmt_reservations/models/aqi_settings.rb'
34
+ autoload :QuotaLimits, '2019-07-19-preview/generated/azure_mgmt_reservations/models/quota_limits.rb'
35
+ autoload :EmailAction, '2019-07-19-preview/generated/azure_mgmt_reservations/models/email_action.rb'
36
+ autoload :CreateGenericQuotaRequestParameters, '2019-07-19-preview/generated/azure_mgmt_reservations/models/create_generic_quota_request_parameters.rb'
37
+ autoload :EmailActions, '2019-07-19-preview/generated/azure_mgmt_reservations/models/email_actions.rb'
38
+ autoload :QuotaRequestOneResourceSubmitResponse, '2019-07-19-preview/generated/azure_mgmt_reservations/models/quota_request_one_resource_submit_response.rb'
39
+ autoload :Actions, '2019-07-19-preview/generated/azure_mgmt_reservations/models/actions.rb'
40
+ autoload :QuotaRequestSubmitResponse, '2019-07-19-preview/generated/azure_mgmt_reservations/models/quota_request_submit_response.rb'
41
+ autoload :SupportRequestAction, '2019-07-19-preview/generated/azure_mgmt_reservations/models/support_request_action.rb'
42
+ autoload :QuotaProperties, '2019-07-19-preview/generated/azure_mgmt_reservations/models/quota_properties.rb'
43
+ autoload :AutoQuotaIncreaseDetail, '2019-07-19-preview/generated/azure_mgmt_reservations/models/auto_quota_increase_detail.rb'
44
+ autoload :QuotaLimitsResponse, '2019-07-19-preview/generated/azure_mgmt_reservations/models/quota_limits_response.rb'
45
+ autoload :PhoneAction, '2019-07-19-preview/generated/azure_mgmt_reservations/models/phone_action.rb'
46
+ autoload :QuotaRequestProperties, '2019-07-19-preview/generated/azure_mgmt_reservations/models/quota_request_properties.rb'
47
+ autoload :ServiceErrorDetail, '2019-07-19-preview/generated/azure_mgmt_reservations/models/service_error_detail.rb'
48
+ autoload :CurrentQuotaLimit, '2019-07-19-preview/generated/azure_mgmt_reservations/models/current_quota_limit.rb'
49
+ autoload :ServiceError, '2019-07-19-preview/generated/azure_mgmt_reservations/models/service_error.rb'
50
+ autoload :QuotaRequestSubmitResponse201, '2019-07-19-preview/generated/azure_mgmt_reservations/models/quota_request_submit_response201.rb'
51
+ autoload :ExceptionResponse, '2019-07-19-preview/generated/azure_mgmt_reservations/models/exception_response.rb'
52
+ autoload :SubRequest, '2019-07-19-preview/generated/azure_mgmt_reservations/models/sub_request.rb'
53
+ end
54
+ end
@@ -0,0 +1,223 @@
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 AutoQuotaIncrease
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the AutoQuotaIncrease 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 Auto Quota Increase enrollment details for the specified
26
+ # subscription.
27
+ #
28
+ # @param subscription_id [String] Azure subscription id.
29
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
30
+ # will be added to the HTTP request.
31
+ #
32
+ # @return [AutoQuotaIncreaseDetail] operation results.
33
+ #
34
+ def get_properties(subscription_id, custom_headers:nil)
35
+ response = get_properties_async(subscription_id, custom_headers:custom_headers).value!
36
+ response.body unless response.nil?
37
+ end
38
+
39
+ #
40
+ # Gets the Auto Quota Increase enrollment details for the specified
41
+ # subscription.
42
+ #
43
+ # @param subscription_id [String] Azure subscription id.
44
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
45
+ # will be added to the HTTP request.
46
+ #
47
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
48
+ #
49
+ def get_properties_with_http_info(subscription_id, custom_headers:nil)
50
+ get_properties_async(subscription_id, custom_headers:custom_headers).value!
51
+ end
52
+
53
+ #
54
+ # Gets the Auto Quota Increase enrollment details for the specified
55
+ # subscription.
56
+ #
57
+ # @param subscription_id [String] Azure subscription id.
58
+ # @param [Hash{String => String}] A hash of custom headers that will be added
59
+ # to the HTTP request.
60
+ #
61
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
62
+ #
63
+ def get_properties_async(subscription_id, custom_headers:nil)
64
+ fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
65
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
66
+
67
+
68
+ request_headers = {}
69
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
70
+
71
+ # Set Headers
72
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
73
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
74
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Capacity/autoQuotaIncrease'
75
+
76
+ request_url = @base_url || @client.base_url
77
+
78
+ options = {
79
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
80
+ path_params: {'subscriptionId' => subscription_id},
81
+ query_params: {'api-version' => @client.api_version},
82
+ headers: request_headers.merge(custom_headers || {}),
83
+ base_url: request_url
84
+ }
85
+ promise = @client.make_request_async(:get, path_template, options)
86
+
87
+ promise = promise.then do |result|
88
+ http_response = result.response
89
+ status_code = http_response.status
90
+ response_content = http_response.body
91
+ unless status_code == 200
92
+ error_model = JSON.load(response_content)
93
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
94
+ end
95
+
96
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
97
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
98
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
99
+ # Deserialize Response
100
+ if status_code == 200
101
+ begin
102
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
103
+ result_mapper = Azure::Reservations::Mgmt::V2019_07_19_preview::Models::AutoQuotaIncreaseDetail.mapper()
104
+ result.body = @client.deserialize(result_mapper, parsed_response)
105
+ rescue Exception => e
106
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
107
+ end
108
+ end
109
+
110
+ result
111
+ end
112
+
113
+ promise.execute
114
+ end
115
+
116
+ #
117
+ # Sets the Auto Quota Increase enrollment properties for the specified
118
+ # subscription.
119
+ #
120
+ # @param subscription_id [String] Azure subscription id.
121
+ # @param auto_quota_increase_request [AutoQuotaIncreaseDetail] Auto Quota
122
+ # increase request payload.
123
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
124
+ # will be added to the HTTP request.
125
+ #
126
+ # @return [AutoQuotaIncreaseDetail] operation results.
127
+ #
128
+ def create(subscription_id, auto_quota_increase_request, custom_headers:nil)
129
+ response = create_async(subscription_id, auto_quota_increase_request, custom_headers:custom_headers).value!
130
+ response.body unless response.nil?
131
+ end
132
+
133
+ #
134
+ # Sets the Auto Quota Increase enrollment properties for the specified
135
+ # subscription.
136
+ #
137
+ # @param subscription_id [String] Azure subscription id.
138
+ # @param auto_quota_increase_request [AutoQuotaIncreaseDetail] Auto Quota
139
+ # increase request payload.
140
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
141
+ # will be added to the HTTP request.
142
+ #
143
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
144
+ #
145
+ def create_with_http_info(subscription_id, auto_quota_increase_request, custom_headers:nil)
146
+ create_async(subscription_id, auto_quota_increase_request, custom_headers:custom_headers).value!
147
+ end
148
+
149
+ #
150
+ # Sets the Auto Quota Increase enrollment properties for the specified
151
+ # subscription.
152
+ #
153
+ # @param subscription_id [String] Azure subscription id.
154
+ # @param auto_quota_increase_request [AutoQuotaIncreaseDetail] Auto Quota
155
+ # increase request payload.
156
+ # @param [Hash{String => String}] A hash of custom headers that will be added
157
+ # to the HTTP request.
158
+ #
159
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
160
+ #
161
+ def create_async(subscription_id, auto_quota_increase_request, custom_headers:nil)
162
+ fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
163
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
164
+ fail ArgumentError, 'auto_quota_increase_request is nil' if auto_quota_increase_request.nil?
165
+
166
+
167
+ request_headers = {}
168
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
169
+
170
+ # Set Headers
171
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
172
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
173
+
174
+ # Serialize Request
175
+ request_mapper = Azure::Reservations::Mgmt::V2019_07_19_preview::Models::AutoQuotaIncreaseDetail.mapper()
176
+ request_content = @client.serialize(request_mapper, auto_quota_increase_request)
177
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
178
+
179
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Capacity/autoQuotaIncrease'
180
+
181
+ request_url = @base_url || @client.base_url
182
+
183
+ options = {
184
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
185
+ path_params: {'subscriptionId' => subscription_id},
186
+ query_params: {'api-version' => @client.api_version},
187
+ body: request_content,
188
+ headers: request_headers.merge(custom_headers || {}),
189
+ base_url: request_url
190
+ }
191
+ promise = @client.make_request_async(:put, path_template, options)
192
+
193
+ promise = promise.then do |result|
194
+ http_response = result.response
195
+ status_code = http_response.status
196
+ response_content = http_response.body
197
+ unless status_code == 200
198
+ error_model = JSON.load(response_content)
199
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
200
+ end
201
+
202
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
203
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
204
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
205
+ # Deserialize Response
206
+ if status_code == 200
207
+ begin
208
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
209
+ result_mapper = Azure::Reservations::Mgmt::V2019_07_19_preview::Models::AutoQuotaIncreaseDetail.mapper()
210
+ result.body = @client.deserialize(result_mapper, parsed_response)
211
+ rescue Exception => e
212
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
213
+ end
214
+ end
215
+
216
+ result
217
+ end
218
+
219
+ promise.execute
220
+ end
221
+
222
+ end
223
+ end