azure_mgmt_confluent 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2020-03-01/generated/azure_mgmt_confluent.rb +47 -0
  4. data/lib/2020-03-01/generated/azure_mgmt_confluent/confluent_management_client.rb +139 -0
  5. data/lib/2020-03-01/generated/azure_mgmt_confluent/marketplace_agreements.rb +317 -0
  6. data/lib/2020-03-01/generated/azure_mgmt_confluent/models/confluent_agreement_resource.rb +161 -0
  7. data/lib/2020-03-01/generated/azure_mgmt_confluent/models/confluent_agreement_resource_list_response.rb +100 -0
  8. data/lib/2020-03-01/generated/azure_mgmt_confluent/models/error_response_body.rb +94 -0
  9. data/lib/2020-03-01/generated/azure_mgmt_confluent/models/offer_detail.rb +119 -0
  10. data/lib/2020-03-01/generated/azure_mgmt_confluent/models/operation_display.rb +80 -0
  11. data/lib/2020-03-01/generated/azure_mgmt_confluent/models/operation_list_result.rb +100 -0
  12. data/lib/2020-03-01/generated/azure_mgmt_confluent/models/operation_result.rb +69 -0
  13. data/lib/2020-03-01/generated/azure_mgmt_confluent/models/organization_resource.rb +176 -0
  14. data/lib/2020-03-01/generated/azure_mgmt_confluent/models/organization_resource_list_result.rb +98 -0
  15. data/lib/2020-03-01/generated/azure_mgmt_confluent/models/organization_resource_properties.rb +110 -0
  16. data/lib/2020-03-01/generated/azure_mgmt_confluent/models/organization_resource_properties_offer_detail.rb +99 -0
  17. data/lib/2020-03-01/generated/azure_mgmt_confluent/models/organization_resource_properties_user_detail.rb +68 -0
  18. data/lib/2020-03-01/generated/azure_mgmt_confluent/models/organization_resource_update.rb +54 -0
  19. data/lib/2020-03-01/generated/azure_mgmt_confluent/models/provision_state.rb +23 -0
  20. data/lib/2020-03-01/generated/azure_mgmt_confluent/models/resource_provider_default_error_response.rb +50 -0
  21. data/lib/2020-03-01/generated/azure_mgmt_confluent/models/saa_soffer_status.rb +24 -0
  22. data/lib/2020-03-01/generated/azure_mgmt_confluent/models/user_detail.rb +77 -0
  23. data/lib/2020-03-01/generated/azure_mgmt_confluent/module_definition.rb +9 -0
  24. data/lib/2020-03-01/generated/azure_mgmt_confluent/organization.rb +899 -0
  25. data/lib/2020-03-01/generated/azure_mgmt_confluent/organization_operations.rb +219 -0
  26. data/lib/azure_mgmt_confluent.rb +6 -0
  27. data/lib/module_definition.rb +7 -0
  28. data/lib/profiles/latest/confluent_latest_profile_client.rb +40 -0
  29. data/lib/profiles/latest/confluent_module_definition.rb +8 -0
  30. data/lib/profiles/latest/modules/confluent_profile_module.rb +133 -0
  31. data/lib/version.rb +7 -0
  32. metadata +147 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 002fb0fce2171a9c72d4984ab58ffeb9441abf6e2bc04772a4ce26b30d9bb045
4
+ data.tar.gz: 8041c1fa63c54741730fe523922c8f6638db4227165fa15db399daa3d37d2ecf
5
+ SHA512:
6
+ metadata.gz: dac33c956684d45786e418b0e6900b7c8af96935d3c5e37bb7f876072367ae1aa3f8681eb4e6954a2ee1bcc11bdb7d8f043c94a2254bcbc808d59193ce16d248
7
+ data.tar.gz: ffeb05ad31320e19e517e42d5cb8bccc413d1ed0bd883fe619022f15e72237971a98898188ef5209e4e54ef8dc1ba2a2a9fcfef34522b3e28a65cee52aec33b2
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Microsoft Corporation
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,47 @@
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 '2020-03-01/generated/azure_mgmt_confluent/module_definition'
20
+ require 'ms_rest_azure'
21
+
22
+ module Azure::Confluent::Mgmt::V2020_03_01
23
+ autoload :MarketplaceAgreements, '2020-03-01/generated/azure_mgmt_confluent/marketplace_agreements.rb'
24
+ autoload :OrganizationOperations, '2020-03-01/generated/azure_mgmt_confluent/organization_operations.rb'
25
+ autoload :Organization, '2020-03-01/generated/azure_mgmt_confluent/organization.rb'
26
+ autoload :ConfluentManagementClient, '2020-03-01/generated/azure_mgmt_confluent/confluent_management_client.rb'
27
+
28
+ module Models
29
+ autoload :OfferDetail, '2020-03-01/generated/azure_mgmt_confluent/models/offer_detail.rb'
30
+ autoload :UserDetail, '2020-03-01/generated/azure_mgmt_confluent/models/user_detail.rb'
31
+ autoload :ConfluentAgreementResourceListResponse, '2020-03-01/generated/azure_mgmt_confluent/models/confluent_agreement_resource_list_response.rb'
32
+ autoload :OperationDisplay, '2020-03-01/generated/azure_mgmt_confluent/models/operation_display.rb'
33
+ autoload :OperationResult, '2020-03-01/generated/azure_mgmt_confluent/models/operation_result.rb'
34
+ autoload :ErrorResponseBody, '2020-03-01/generated/azure_mgmt_confluent/models/error_response_body.rb'
35
+ autoload :OrganizationResourceUpdate, '2020-03-01/generated/azure_mgmt_confluent/models/organization_resource_update.rb'
36
+ autoload :ConfluentAgreementResource, '2020-03-01/generated/azure_mgmt_confluent/models/confluent_agreement_resource.rb'
37
+ autoload :OrganizationResourceProperties, '2020-03-01/generated/azure_mgmt_confluent/models/organization_resource_properties.rb'
38
+ autoload :ResourceProviderDefaultErrorResponse, '2020-03-01/generated/azure_mgmt_confluent/models/resource_provider_default_error_response.rb'
39
+ autoload :OrganizationResource, '2020-03-01/generated/azure_mgmt_confluent/models/organization_resource.rb'
40
+ autoload :OperationListResult, '2020-03-01/generated/azure_mgmt_confluent/models/operation_list_result.rb'
41
+ autoload :OrganizationResourceListResult, '2020-03-01/generated/azure_mgmt_confluent/models/organization_resource_list_result.rb'
42
+ autoload :OrganizationResourcePropertiesOfferDetail, '2020-03-01/generated/azure_mgmt_confluent/models/organization_resource_properties_offer_detail.rb'
43
+ autoload :OrganizationResourcePropertiesUserDetail, '2020-03-01/generated/azure_mgmt_confluent/models/organization_resource_properties_user_detail.rb'
44
+ autoload :ProvisionState, '2020-03-01/generated/azure_mgmt_confluent/models/provision_state.rb'
45
+ autoload :SaaSOfferStatus, '2020-03-01/generated/azure_mgmt_confluent/models/saa_soffer_status.rb'
46
+ end
47
+ end
@@ -0,0 +1,139 @@
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::Confluent::Mgmt::V2020_03_01
7
+ #
8
+ # A service client - single point of access to the REST API.
9
+ #
10
+ class ConfluentManagementClient < 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] Client Api Version.
21
+ attr_reader :api_version
22
+
23
+ # @return [String] Microsoft Azure subscription id
24
+ attr_accessor :subscription_id
25
+
26
+ # @return [String] The preferred language for the response.
27
+ attr_accessor :accept_language
28
+
29
+ # @return [Integer] The retry timeout in seconds for Long Running
30
+ # Operations. Default value is 30.
31
+ attr_accessor :long_running_operation_retry_timeout
32
+
33
+ # @return [Boolean] Whether a unique x-ms-client-request-id should be
34
+ # generated. When set to true a unique x-ms-client-request-id value is
35
+ # generated and included in each request. Default is true.
36
+ attr_accessor :generate_client_request_id
37
+
38
+ # @return [MarketplaceAgreements] marketplace_agreements
39
+ attr_reader :marketplace_agreements
40
+
41
+ # @return [OrganizationOperations] organization_operations
42
+ attr_reader :organization_operations
43
+
44
+ # @return [Organization] organization
45
+ attr_reader :organization
46
+
47
+ #
48
+ # Creates initializes a new instance of the ConfluentManagementClient class.
49
+ # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
50
+ # @param base_url [String] the base URI of the service.
51
+ # @param options [Array] filters to be applied to the HTTP requests.
52
+ #
53
+ def initialize(credentials = nil, base_url = nil, options = nil)
54
+ super(credentials, options)
55
+ @base_url = base_url || 'https://management.azure.com'
56
+
57
+ fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
58
+ @credentials = credentials
59
+
60
+ @marketplace_agreements = MarketplaceAgreements.new(self)
61
+ @organization_operations = OrganizationOperations.new(self)
62
+ @organization = Organization.new(self)
63
+ @api_version = '2020-03-01'
64
+ @accept_language = 'en-US'
65
+ @long_running_operation_retry_timeout = 30
66
+ @generate_client_request_id = true
67
+ add_telemetry
68
+ end
69
+
70
+ #
71
+ # Makes a request and returns the body of the response.
72
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
73
+ # @param path [String] the path, relative to {base_url}.
74
+ # @param options [Hash{String=>String}] specifying any request options like :body.
75
+ # @return [Hash{String=>String}] containing the body of the response.
76
+ # Example:
77
+ #
78
+ # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
79
+ # path = "/path"
80
+ # options = {
81
+ # body: request_content,
82
+ # query_params: {'api-version' => '2016-02-01'}
83
+ # }
84
+ # result = @client.make_request(:put, path, options)
85
+ #
86
+ def make_request(method, path, options = {})
87
+ result = make_request_with_http_info(method, path, options)
88
+ result.body unless result.nil?
89
+ end
90
+
91
+ #
92
+ # Makes a request and returns the operation response.
93
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
94
+ # @param path [String] the path, relative to {base_url}.
95
+ # @param options [Hash{String=>String}] specifying any request options like :body.
96
+ # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
97
+ #
98
+ def make_request_with_http_info(method, path, options = {})
99
+ result = make_request_async(method, path, options).value!
100
+ result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
101
+ result
102
+ end
103
+
104
+ #
105
+ # Makes a request asynchronously.
106
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
107
+ # @param path [String] the path, relative to {base_url}.
108
+ # @param options [Hash{String=>String}] specifying any request options like :body.
109
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
110
+ #
111
+ def make_request_async(method, path, options = {})
112
+ fail ArgumentError, 'method is nil' if method.nil?
113
+ fail ArgumentError, 'path is nil' if path.nil?
114
+
115
+ request_url = options[:base_url] || @base_url
116
+ if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
117
+ @request_headers['Content-Type'] = options[:headers]['Content-Type']
118
+ end
119
+
120
+ request_headers = @request_headers
121
+ request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
122
+ options.merge!({headers: request_headers.merge(options[:headers] || {})})
123
+ options.merge!({credentials: @credentials}) unless @credentials.nil?
124
+
125
+ super(request_url, method, path, options)
126
+ end
127
+
128
+
129
+ private
130
+ #
131
+ # Adds telemetry information.
132
+ #
133
+ def add_telemetry
134
+ sdk_information = 'azure_mgmt_confluent'
135
+ sdk_information = "#{sdk_information}/0.17.0"
136
+ add_user_agent_information(sdk_information)
137
+ end
138
+ end
139
+ end
@@ -0,0 +1,317 @@
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::Confluent::Mgmt::V2020_03_01
7
+ #
8
+ # MarketplaceAgreements
9
+ #
10
+ class MarketplaceAgreements
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the MarketplaceAgreements class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [ConfluentManagementClient] reference to the ConfluentManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # List Confluent marketplace agreements in the subscription.
26
+ #
27
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
28
+ # will be added to the HTTP request.
29
+ #
30
+ # @return [Array<ConfluentAgreementResource>] operation results.
31
+ #
32
+ def list(custom_headers:nil)
33
+ first_page = list_as_lazy(custom_headers:custom_headers)
34
+ first_page.get_all_items
35
+ end
36
+
37
+ #
38
+ # List Confluent marketplace agreements in the subscription.
39
+ #
40
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
41
+ # will be added to the HTTP request.
42
+ #
43
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
44
+ #
45
+ def list_with_http_info(custom_headers:nil)
46
+ list_async(custom_headers:custom_headers).value!
47
+ end
48
+
49
+ #
50
+ # List Confluent marketplace agreements in the subscription.
51
+ #
52
+ # @param [Hash{String => String}] A hash of custom headers that will be added
53
+ # to the HTTP request.
54
+ #
55
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
56
+ #
57
+ def list_async(custom_headers:nil)
58
+ @client.api_version = '2020-03-01'
59
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
60
+
61
+
62
+ request_headers = {}
63
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
64
+
65
+ # Set Headers
66
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
67
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
68
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Confluent/agreements'
69
+
70
+ request_url = @base_url || @client.base_url
71
+
72
+ options = {
73
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
74
+ path_params: {'subscriptionId' => @client.subscription_id},
75
+ query_params: {'api-version' => @client.api_version},
76
+ headers: request_headers.merge(custom_headers || {}),
77
+ base_url: request_url
78
+ }
79
+ promise = @client.make_request_async(:get, path_template, options)
80
+
81
+ promise = promise.then do |result|
82
+ http_response = result.response
83
+ status_code = http_response.status
84
+ response_content = http_response.body
85
+ unless status_code == 200
86
+ error_model = JSON.load(response_content)
87
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
88
+ end
89
+
90
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
91
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
92
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
93
+ # Deserialize Response
94
+ if status_code == 200
95
+ begin
96
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
97
+ result_mapper = Azure::Confluent::Mgmt::V2020_03_01::Models::ConfluentAgreementResourceListResponse.mapper()
98
+ result.body = @client.deserialize(result_mapper, parsed_response)
99
+ rescue Exception => e
100
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
101
+ end
102
+ end
103
+
104
+ result
105
+ end
106
+
107
+ promise.execute
108
+ end
109
+
110
+ #
111
+ # Accept marketplace terms.
112
+ #
113
+ # @param body [ConfluentAgreementResource] Confluent Agreement resource
114
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
115
+ # will be added to the HTTP request.
116
+ #
117
+ # @return [ConfluentAgreementResource] operation results.
118
+ #
119
+ def create(body:nil, custom_headers:nil)
120
+ response = create_async(body:body, custom_headers:custom_headers).value!
121
+ response.body unless response.nil?
122
+ end
123
+
124
+ #
125
+ # Accept marketplace terms.
126
+ #
127
+ # @param body [ConfluentAgreementResource] Confluent Agreement resource
128
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
129
+ # will be added to the HTTP request.
130
+ #
131
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
132
+ #
133
+ def create_with_http_info(body:nil, custom_headers:nil)
134
+ create_async(body:body, custom_headers:custom_headers).value!
135
+ end
136
+
137
+ #
138
+ # Accept marketplace terms.
139
+ #
140
+ # @param body [ConfluentAgreementResource] Confluent Agreement resource
141
+ # @param [Hash{String => String}] A hash of custom headers that will be added
142
+ # to the HTTP request.
143
+ #
144
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
145
+ #
146
+ def create_async(body:nil, custom_headers:nil)
147
+ @client.api_version = '2020-03-01'
148
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
149
+
150
+
151
+ request_headers = {}
152
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
153
+
154
+ # Set Headers
155
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
156
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
157
+
158
+ # Serialize Request
159
+ request_mapper = Azure::Confluent::Mgmt::V2020_03_01::Models::ConfluentAgreementResource.mapper()
160
+ request_content = @client.serialize(request_mapper, body)
161
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
162
+
163
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Confluent/agreements/default'
164
+
165
+ request_url = @base_url || @client.base_url
166
+
167
+ options = {
168
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
169
+ path_params: {'subscriptionId' => @client.subscription_id},
170
+ query_params: {'api-version' => @client.api_version},
171
+ body: request_content,
172
+ headers: request_headers.merge(custom_headers || {}),
173
+ base_url: request_url
174
+ }
175
+ promise = @client.make_request_async(:put, path_template, options)
176
+
177
+ promise = promise.then do |result|
178
+ http_response = result.response
179
+ status_code = http_response.status
180
+ response_content = http_response.body
181
+ unless status_code == 200
182
+ error_model = JSON.load(response_content)
183
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
184
+ end
185
+
186
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
187
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
188
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
189
+ # Deserialize Response
190
+ if status_code == 200
191
+ begin
192
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
193
+ result_mapper = Azure::Confluent::Mgmt::V2020_03_01::Models::ConfluentAgreementResource.mapper()
194
+ result.body = @client.deserialize(result_mapper, parsed_response)
195
+ rescue Exception => e
196
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
197
+ end
198
+ end
199
+
200
+ result
201
+ end
202
+
203
+ promise.execute
204
+ end
205
+
206
+ #
207
+ # List Confluent marketplace agreements in the subscription.
208
+ #
209
+ # @param next_page_link [String] The NextLink from the previous successful call
210
+ # to List operation.
211
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
212
+ # will be added to the HTTP request.
213
+ #
214
+ # @return [ConfluentAgreementResourceListResponse] operation results.
215
+ #
216
+ def list_next(next_page_link, custom_headers:nil)
217
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
218
+ response.body unless response.nil?
219
+ end
220
+
221
+ #
222
+ # List Confluent marketplace agreements in the subscription.
223
+ #
224
+ # @param next_page_link [String] The NextLink from the previous successful call
225
+ # to List operation.
226
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
227
+ # will be added to the HTTP request.
228
+ #
229
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
230
+ #
231
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
232
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
233
+ end
234
+
235
+ #
236
+ # List Confluent marketplace agreements in the subscription.
237
+ #
238
+ # @param next_page_link [String] The NextLink from the previous successful call
239
+ # to List operation.
240
+ # @param [Hash{String => String}] A hash of custom headers that will be added
241
+ # to the HTTP request.
242
+ #
243
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
244
+ #
245
+ def list_next_async(next_page_link, custom_headers:nil)
246
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
247
+
248
+
249
+ request_headers = {}
250
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
251
+
252
+ # Set Headers
253
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
254
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
255
+ path_template = '{nextLink}'
256
+
257
+ request_url = @base_url || @client.base_url
258
+
259
+ options = {
260
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
261
+ skip_encoding_path_params: {'nextLink' => next_page_link},
262
+ headers: request_headers.merge(custom_headers || {}),
263
+ base_url: request_url
264
+ }
265
+ promise = @client.make_request_async(:get, path_template, options)
266
+
267
+ promise = promise.then do |result|
268
+ http_response = result.response
269
+ status_code = http_response.status
270
+ response_content = http_response.body
271
+ unless status_code == 200
272
+ error_model = JSON.load(response_content)
273
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
274
+ end
275
+
276
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
277
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
278
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
279
+ # Deserialize Response
280
+ if status_code == 200
281
+ begin
282
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
283
+ result_mapper = Azure::Confluent::Mgmt::V2020_03_01::Models::ConfluentAgreementResourceListResponse.mapper()
284
+ result.body = @client.deserialize(result_mapper, parsed_response)
285
+ rescue Exception => e
286
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
287
+ end
288
+ end
289
+
290
+ result
291
+ end
292
+
293
+ promise.execute
294
+ end
295
+
296
+ #
297
+ # List Confluent marketplace agreements in the subscription.
298
+ #
299
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
300
+ # will be added to the HTTP request.
301
+ #
302
+ # @return [ConfluentAgreementResourceListResponse] which provide lazy access to
303
+ # pages of the response.
304
+ #
305
+ def list_as_lazy(custom_headers:nil)
306
+ response = list_async(custom_headers:custom_headers).value!
307
+ unless response.nil?
308
+ page = response.body
309
+ page.next_method = Proc.new do |next_page_link|
310
+ list_next_async(next_page_link, custom_headers:custom_headers)
311
+ end
312
+ page
313
+ end
314
+ end
315
+
316
+ end
317
+ end