Skip to content

Commit e7e3488

Browse files
Merge pull request #38 from mxenabled/bm/update_library
Update library
2 parents 24b363b + 2252fbc commit e7e3488

230 files changed

Lines changed: 573 additions & 266 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.openapi-generator/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.2.1
1+
5.3.0

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
*This project was automatically generated by the [OpenAPI Generator](https://openapi-generator.tech).*
44

5-
# MX Platform Ruby - v0.6.1
5+
# MX Platform Ruby - v0.6.2
66

77
The Ruby gem for the MX Platform API.
88

lib/mx-platform-ruby.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
The version of the OpenAPI document: 0.1.0
77
88
Generated by: https://openapi-generator.tech
9-
OpenAPI Generator version: 5.2.1
9+
OpenAPI Generator version: 5.3.0
1010
1111
=end
1212

lib/mx-platform-ruby/api/mx_platform_api.rb

Lines changed: 97 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
The version of the OpenAPI document: 0.1.0
77
88
Generated by: https://openapi-generator.tech
9-
OpenAPI Generator version: 5.2.1
9+
OpenAPI Generator version: 5.3.0
1010
1111
=end
1212

@@ -197,7 +197,10 @@ def create_category_with_http_info(user_guid, category_create_request_body, opts
197197
# HTTP header 'Accept' (if needed)
198198
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
199199
# HTTP header 'Content-Type'
200-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
200+
content_type = @api_client.select_header_content_type(['application/json'])
201+
if !content_type.nil?
202+
header_params['Content-Type'] = content_type
203+
end
201204

202205
# form parameters
203206
form_params = opts[:form_params] || {}
@@ -274,7 +277,10 @@ def create_managed_account_with_http_info(user_guid, member_guid, managed_accoun
274277
# HTTP header 'Accept' (if needed)
275278
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
276279
# HTTP header 'Content-Type'
277-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
280+
content_type = @api_client.select_header_content_type(['application/json'])
281+
if !content_type.nil?
282+
header_params['Content-Type'] = content_type
283+
end
278284

279285
# form parameters
280286
form_params = opts[:form_params] || {}
@@ -345,7 +351,10 @@ def create_managed_member_with_http_info(user_guid, managed_member_create_reques
345351
# HTTP header 'Accept' (if needed)
346352
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
347353
# HTTP header 'Content-Type'
348-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
354+
content_type = @api_client.select_header_content_type(['application/json'])
355+
if !content_type.nil?
356+
header_params['Content-Type'] = content_type
357+
end
349358

350359
# form parameters
351360
form_params = opts[:form_params] || {}
@@ -422,7 +431,10 @@ def create_managed_transaction_with_http_info(user_guid, member_guid, managed_tr
422431
# HTTP header 'Accept' (if needed)
423432
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
424433
# HTTP header 'Content-Type'
425-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
434+
content_type = @api_client.select_header_content_type(['application/json'])
435+
if !content_type.nil?
436+
header_params['Content-Type'] = content_type
437+
end
426438

427439
# form parameters
428440
form_params = opts[:form_params] || {}
@@ -493,7 +505,10 @@ def create_member_with_http_info(user_guid, member_create_request_body, opts = {
493505
# HTTP header 'Accept' (if needed)
494506
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
495507
# HTTP header 'Content-Type'
496-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
508+
content_type = @api_client.select_header_content_type(['application/json'])
509+
if !content_type.nil?
510+
header_params['Content-Type'] = content_type
511+
end
497512

498513
# form parameters
499514
form_params = opts[:form_params] || {}
@@ -564,7 +579,10 @@ def create_tag_with_http_info(user_guid, tag_create_request_body, opts = {})
564579
# HTTP header 'Accept' (if needed)
565580
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
566581
# HTTP header 'Content-Type'
567-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
582+
content_type = @api_client.select_header_content_type(['application/json'])
583+
if !content_type.nil?
584+
header_params['Content-Type'] = content_type
585+
end
568586

569587
# form parameters
570588
form_params = opts[:form_params] || {}
@@ -635,7 +653,10 @@ def create_tagging_with_http_info(user_guid, tagging_create_request_body, opts =
635653
# HTTP header 'Accept' (if needed)
636654
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
637655
# HTTP header 'Content-Type'
638-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
656+
content_type = @api_client.select_header_content_type(['application/json'])
657+
if !content_type.nil?
658+
header_params['Content-Type'] = content_type
659+
end
639660

640661
# form parameters
641662
form_params = opts[:form_params] || {}
@@ -706,7 +727,10 @@ def create_transaction_rule_with_http_info(user_guid, transaction_rule_create_re
706727
# HTTP header 'Accept' (if needed)
707728
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
708729
# HTTP header 'Content-Type'
709-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
730+
content_type = @api_client.select_header_content_type(['application/json'])
731+
if !content_type.nil?
732+
header_params['Content-Type'] = content_type
733+
end
710734

711735
# form parameters
712736
form_params = opts[:form_params] || {}
@@ -771,7 +795,10 @@ def create_user_with_http_info(user_create_request_body, opts = {})
771795
# HTTP header 'Accept' (if needed)
772796
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
773797
# HTTP header 'Content-Type'
774-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
798+
content_type = @api_client.select_header_content_type(['application/json'])
799+
if !content_type.nil?
800+
header_params['Content-Type'] = content_type
801+
end
775802

776803
# form parameters
777804
form_params = opts[:form_params] || {}
@@ -1538,7 +1565,10 @@ def enhance_transactions_with_http_info(enhance_transactions_request_body, opts
15381565
# HTTP header 'Accept' (if needed)
15391566
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
15401567
# HTTP header 'Content-Type'
1541-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
1568+
content_type = @api_client.select_header_content_type(['application/json'])
1569+
if !content_type.nil?
1570+
header_params['Content-Type'] = content_type
1571+
end
15421572

15431573
# form parameters
15441574
form_params = opts[:form_params] || {}
@@ -5004,7 +5034,10 @@ def request_connect_widget_url_with_http_info(user_guid, opts = {})
50045034
# HTTP header 'Accept' (if needed)
50055035
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
50065036
# HTTP header 'Content-Type'
5007-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
5037+
content_type = @api_client.select_header_content_type(['application/json'])
5038+
if !content_type.nil?
5039+
header_params['Content-Type'] = content_type
5040+
end
50085041

50095042
# form parameters
50105043
form_params = opts[:form_params] || {}
@@ -5155,7 +5188,10 @@ def request_widget_url_with_http_info(user_guid, widget_request_body, opts = {})
51555188
# HTTP header 'Accept' (if needed)
51565189
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
51575190
# HTTP header 'Content-Type'
5158-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
5191+
content_type = @api_client.select_header_content_type(['application/json'])
5192+
if !content_type.nil?
5193+
header_params['Content-Type'] = content_type
5194+
end
51595195
header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?
51605196

51615197
# form parameters
@@ -5233,7 +5269,10 @@ def resume_aggregation_with_http_info(member_guid, user_guid, member_resume_requ
52335269
# HTTP header 'Accept' (if needed)
52345270
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
52355271
# HTTP header 'Content-Type'
5236-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
5272+
content_type = @api_client.select_header_content_type(['application/json'])
5273+
if !content_type.nil?
5274+
header_params['Content-Type'] = content_type
5275+
end
52375276

52385277
# form parameters
52395278
form_params = opts[:form_params] || {}
@@ -5316,7 +5355,10 @@ def update_account_by_member_with_http_info(user_guid, member_guid, account_guid
53165355
# HTTP header 'Accept' (if needed)
53175356
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
53185357
# HTTP header 'Content-Type'
5319-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
5358+
content_type = @api_client.select_header_content_type(['application/json'])
5359+
if !content_type.nil?
5360+
header_params['Content-Type'] = content_type
5361+
end
53205362

53215363
# form parameters
53225364
form_params = opts[:form_params] || {}
@@ -5393,7 +5435,10 @@ def update_category_with_http_info(category_guid, user_guid, category_update_req
53935435
# HTTP header 'Accept' (if needed)
53945436
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
53955437
# HTTP header 'Content-Type'
5396-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
5438+
content_type = @api_client.select_header_content_type(['application/json'])
5439+
if !content_type.nil?
5440+
header_params['Content-Type'] = content_type
5441+
end
53975442

53985443
# form parameters
53995444
form_params = opts[:form_params] || {}
@@ -5476,7 +5521,10 @@ def update_managed_account_with_http_info(member_guid, user_guid, account_guid,
54765521
# HTTP header 'Accept' (if needed)
54775522
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
54785523
# HTTP header 'Content-Type'
5479-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
5524+
content_type = @api_client.select_header_content_type(['application/json'])
5525+
if !content_type.nil?
5526+
header_params['Content-Type'] = content_type
5527+
end
54805528

54815529
# form parameters
54825530
form_params = opts[:form_params] || {}
@@ -5553,7 +5601,10 @@ def update_managed_member_with_http_info(member_guid, user_guid, managed_member_
55535601
# HTTP header 'Accept' (if needed)
55545602
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
55555603
# HTTP header 'Content-Type'
5556-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
5604+
content_type = @api_client.select_header_content_type(['application/json'])
5605+
if !content_type.nil?
5606+
header_params['Content-Type'] = content_type
5607+
end
55575608

55585609
# form parameters
55595610
form_params = opts[:form_params] || {}
@@ -5636,7 +5687,10 @@ def update_managed_transaction_with_http_info(member_guid, user_guid, transactio
56365687
# HTTP header 'Accept' (if needed)
56375688
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
56385689
# HTTP header 'Content-Type'
5639-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
5690+
content_type = @api_client.select_header_content_type(['application/json'])
5691+
if !content_type.nil?
5692+
header_params['Content-Type'] = content_type
5693+
end
56405694

56415695
# form parameters
56425696
form_params = opts[:form_params] || {}
@@ -5713,7 +5767,10 @@ def update_member_with_http_info(member_guid, user_guid, member_update_request_b
57135767
# HTTP header 'Accept' (if needed)
57145768
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
57155769
# HTTP header 'Content-Type'
5716-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
5770+
content_type = @api_client.select_header_content_type(['application/json'])
5771+
if !content_type.nil?
5772+
header_params['Content-Type'] = content_type
5773+
end
57175774

57185775
# form parameters
57195776
form_params = opts[:form_params] || {}
@@ -5790,7 +5847,10 @@ def update_tag_with_http_info(tag_guid, user_guid, tag_update_request_body, opts
57905847
# HTTP header 'Accept' (if needed)
57915848
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
57925849
# HTTP header 'Content-Type'
5793-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
5850+
content_type = @api_client.select_header_content_type(['application/json'])
5851+
if !content_type.nil?
5852+
header_params['Content-Type'] = content_type
5853+
end
57945854

57955855
# form parameters
57965856
form_params = opts[:form_params] || {}
@@ -5867,7 +5927,10 @@ def update_tagging_with_http_info(tagging_guid, user_guid, tagging_update_reques
58675927
# HTTP header 'Accept' (if needed)
58685928
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
58695929
# HTTP header 'Content-Type'
5870-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
5930+
content_type = @api_client.select_header_content_type(['application/json'])
5931+
if !content_type.nil?
5932+
header_params['Content-Type'] = content_type
5933+
end
58715934

58725935
# form parameters
58735936
form_params = opts[:form_params] || {}
@@ -5944,7 +6007,10 @@ def update_transaction_with_http_info(transaction_guid, user_guid, transaction_u
59446007
# HTTP header 'Accept' (if needed)
59456008
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
59466009
# HTTP header 'Content-Type'
5947-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
6010+
content_type = @api_client.select_header_content_type(['application/json'])
6011+
if !content_type.nil?
6012+
header_params['Content-Type'] = content_type
6013+
end
59486014

59496015
# form parameters
59506016
form_params = opts[:form_params] || {}
@@ -6021,7 +6087,10 @@ def update_transaction_rule_with_http_info(transaction_rule_guid, user_guid, tra
60216087
# HTTP header 'Accept' (if needed)
60226088
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
60236089
# HTTP header 'Content-Type'
6024-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
6090+
content_type = @api_client.select_header_content_type(['application/json'])
6091+
if !content_type.nil?
6092+
header_params['Content-Type'] = content_type
6093+
end
60256094

60266095
# form parameters
60276096
form_params = opts[:form_params] || {}
@@ -6092,7 +6161,10 @@ def update_user_with_http_info(user_guid, user_update_request_body, opts = {})
60926161
# HTTP header 'Accept' (if needed)
60936162
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
60946163
# HTTP header 'Content-Type'
6095-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
6164+
content_type = @api_client.select_header_content_type(['application/json'])
6165+
if !content_type.nil?
6166+
header_params['Content-Type'] = content_type
6167+
end
60966168

60976169
# form parameters
60986170
form_params = opts[:form_params] || {}

lib/mx-platform-ruby/api_client.rb

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
The version of the OpenAPI document: 0.1.0
77
88
Generated by: https://openapi-generator.tech
9-
OpenAPI Generator version: 5.2.1
9+
OpenAPI Generator version: 5.3.0
1010
1111
=end
1212

@@ -56,7 +56,8 @@ def call_api(http_method, path, opts = {})
5656
}
5757

5858
connection = Faraday.new(:url => config.base_url, :ssl => ssl_options) do |conn|
59-
conn.basic_auth(config.username, config.password)
59+
conn.request(:basic_auth, config.username, config.password)
60+
@config.configure_middleware(conn)
6061
if opts[:header_params]["Content-Type"] == "multipart/form-data"
6162
conn.request :multipart
6263
conn.request :url_encoded
@@ -117,23 +118,20 @@ def build_request(http_method, path, request, opts = {})
117118
update_params_for_auth! header_params, query_params, opts[:auth_names]
118119

119120
req_opts = {
120-
:method => http_method,
121-
:headers => header_params,
122-
:params => query_params,
123121
:params_encoding => @config.params_encoding,
124122
:timeout => @config.timeout,
125123
:verbose => @config.debugging
126124
}
127125

128126
if [:post, :patch, :put, :delete].include?(http_method)
129127
req_body = build_request_body(header_params, form_params, opts[:body])
130-
req_opts.update :body => req_body
131128
if @config.debugging
132129
@config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n"
133130
end
134131
end
135132
request.headers = header_params
136133
request.body = req_body
134+
request.options = OpenStruct.new(req_opts)
137135
request.url url
138136
request.params = query_params
139137
download_file(request) if opts[:return_type] == 'File'
@@ -301,7 +299,7 @@ def build_request_url(path, opts = {})
301299
@config.base_url(opts[:operation]) + path
302300
end
303301

304-
# Update hearder and query params based on authentication settings.
302+
# Update header and query params based on authentication settings.
305303
#
306304
# @param [Hash] header_params Header parameters
307305
# @param [Hash] query_params Query parameters
@@ -340,8 +338,8 @@ def select_header_accept(accepts)
340338
# @param [Array] content_types array for Content-Type
341339
# @return [String] the Content-Type header (e.g. application/json)
342340
def select_header_content_type(content_types)
343-
# use application/json by default
344-
return 'application/json' if content_types.nil? || content_types.empty?
341+
# return nil by default
342+
return if content_types.nil? || content_types.empty?
345343
# use JSON when present, otherwise use the first one
346344
json_content_type = content_types.find { |s| json_mime?(s) }
347345
json_content_type || content_types.first

lib/mx-platform-ruby/api_error.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
The version of the OpenAPI document: 0.1.0
77
88
Generated by: https://openapi-generator.tech
9-
OpenAPI Generator version: 5.2.1
9+
OpenAPI Generator version: 5.3.0
1010
1111
=end
1212

0 commit comments

Comments
 (0)