Skip to content

Commit

Permalink
Merge pull request #38 from mxenabled/bm/update_library
Browse files Browse the repository at this point in the history
Update library
  • Loading branch information
brettmortensen authored Nov 5, 2021
2 parents 24b363b + 2252fbc commit e7e3488
Show file tree
Hide file tree
Showing 230 changed files with 573 additions and 266 deletions.
2 changes: 1 addition & 1 deletion .openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.2.1
5.3.0
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

# MX Platform Ruby - v0.6.1
# MX Platform Ruby - v0.6.2

The Ruby gem for the MX Platform API.

Expand Down
2 changes: 1 addition & 1 deletion lib/mx-platform-ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1.0
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 5.2.1
OpenAPI Generator version: 5.3.0
=end

Expand Down
122 changes: 97 additions & 25 deletions lib/mx-platform-ruby/api/mx_platform_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1.0
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 5.2.1
OpenAPI Generator version: 5.3.0
=end

Expand Down Expand Up @@ -197,7 +197,10 @@ def create_category_with_http_info(user_guid, category_create_request_body, opts
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
# HTTP header 'Content-Type'
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end

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

# form parameters
form_params = opts[:form_params] || {}
Expand Down Expand Up @@ -345,7 +351,10 @@ def create_managed_member_with_http_info(user_guid, managed_member_create_reques
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
# HTTP header 'Content-Type'
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end

# form parameters
form_params = opts[:form_params] || {}
Expand Down Expand Up @@ -422,7 +431,10 @@ def create_managed_transaction_with_http_info(user_guid, member_guid, managed_tr
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
# HTTP header 'Content-Type'
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end

# form parameters
form_params = opts[:form_params] || {}
Expand Down Expand Up @@ -493,7 +505,10 @@ def create_member_with_http_info(user_guid, member_create_request_body, opts = {
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
# HTTP header 'Content-Type'
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end

# form parameters
form_params = opts[:form_params] || {}
Expand Down Expand Up @@ -564,7 +579,10 @@ def create_tag_with_http_info(user_guid, tag_create_request_body, opts = {})
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
# HTTP header 'Content-Type'
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end

# form parameters
form_params = opts[:form_params] || {}
Expand Down Expand Up @@ -635,7 +653,10 @@ def create_tagging_with_http_info(user_guid, tagging_create_request_body, opts =
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
# HTTP header 'Content-Type'
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end

# form parameters
form_params = opts[:form_params] || {}
Expand Down Expand Up @@ -706,7 +727,10 @@ def create_transaction_rule_with_http_info(user_guid, transaction_rule_create_re
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
# HTTP header 'Content-Type'
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end

# form parameters
form_params = opts[:form_params] || {}
Expand Down Expand Up @@ -771,7 +795,10 @@ def create_user_with_http_info(user_create_request_body, opts = {})
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
# HTTP header 'Content-Type'
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end

# form parameters
form_params = opts[:form_params] || {}
Expand Down Expand Up @@ -1538,7 +1565,10 @@ def enhance_transactions_with_http_info(enhance_transactions_request_body, opts
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
# HTTP header 'Content-Type'
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end

# form parameters
form_params = opts[:form_params] || {}
Expand Down Expand Up @@ -5004,7 +5034,10 @@ def request_connect_widget_url_with_http_info(user_guid, opts = {})
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
# HTTP header 'Content-Type'
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end

# form parameters
form_params = opts[:form_params] || {}
Expand Down Expand Up @@ -5155,7 +5188,10 @@ def request_widget_url_with_http_info(user_guid, widget_request_body, opts = {})
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
# HTTP header 'Content-Type'
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?

# form parameters
Expand Down Expand Up @@ -5233,7 +5269,10 @@ def resume_aggregation_with_http_info(member_guid, user_guid, member_resume_requ
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
# HTTP header 'Content-Type'
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end

# form parameters
form_params = opts[:form_params] || {}
Expand Down Expand Up @@ -5316,7 +5355,10 @@ def update_account_by_member_with_http_info(user_guid, member_guid, account_guid
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
# HTTP header 'Content-Type'
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end

# form parameters
form_params = opts[:form_params] || {}
Expand Down Expand Up @@ -5393,7 +5435,10 @@ def update_category_with_http_info(category_guid, user_guid, category_update_req
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
# HTTP header 'Content-Type'
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end

# form parameters
form_params = opts[:form_params] || {}
Expand Down Expand Up @@ -5476,7 +5521,10 @@ def update_managed_account_with_http_info(member_guid, user_guid, account_guid,
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
# HTTP header 'Content-Type'
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end

# form parameters
form_params = opts[:form_params] || {}
Expand Down Expand Up @@ -5553,7 +5601,10 @@ def update_managed_member_with_http_info(member_guid, user_guid, managed_member_
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
# HTTP header 'Content-Type'
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end

# form parameters
form_params = opts[:form_params] || {}
Expand Down Expand Up @@ -5636,7 +5687,10 @@ def update_managed_transaction_with_http_info(member_guid, user_guid, transactio
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
# HTTP header 'Content-Type'
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end

# form parameters
form_params = opts[:form_params] || {}
Expand Down Expand Up @@ -5713,7 +5767,10 @@ def update_member_with_http_info(member_guid, user_guid, member_update_request_b
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
# HTTP header 'Content-Type'
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end

# form parameters
form_params = opts[:form_params] || {}
Expand Down Expand Up @@ -5790,7 +5847,10 @@ def update_tag_with_http_info(tag_guid, user_guid, tag_update_request_body, opts
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
# HTTP header 'Content-Type'
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end

# form parameters
form_params = opts[:form_params] || {}
Expand Down Expand Up @@ -5867,7 +5927,10 @@ def update_tagging_with_http_info(tagging_guid, user_guid, tagging_update_reques
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
# HTTP header 'Content-Type'
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end

# form parameters
form_params = opts[:form_params] || {}
Expand Down Expand Up @@ -5944,7 +6007,10 @@ def update_transaction_with_http_info(transaction_guid, user_guid, transaction_u
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
# HTTP header 'Content-Type'
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end

# form parameters
form_params = opts[:form_params] || {}
Expand Down Expand Up @@ -6021,7 +6087,10 @@ def update_transaction_rule_with_http_info(transaction_rule_guid, user_guid, tra
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
# HTTP header 'Content-Type'
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end

# form parameters
form_params = opts[:form_params] || {}
Expand Down Expand Up @@ -6092,7 +6161,10 @@ def update_user_with_http_info(user_guid, user_update_request_body, opts = {})
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.mx.api.v1+json'])
# HTTP header 'Content-Type'
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end

# form parameters
form_params = opts[:form_params] || {}
Expand Down
16 changes: 7 additions & 9 deletions lib/mx-platform-ruby/api_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1.0
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 5.2.1
OpenAPI Generator version: 5.3.0
=end

Expand Down Expand Up @@ -56,7 +56,8 @@ def call_api(http_method, path, opts = {})
}

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

req_opts = {
:method => http_method,
:headers => header_params,
:params => query_params,
:params_encoding => @config.params_encoding,
:timeout => @config.timeout,
:verbose => @config.debugging
}

if [:post, :patch, :put, :delete].include?(http_method)
req_body = build_request_body(header_params, form_params, opts[:body])
req_opts.update :body => req_body
if @config.debugging
@config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n"
end
end
request.headers = header_params
request.body = req_body
request.options = OpenStruct.new(req_opts)
request.url url
request.params = query_params
download_file(request) if opts[:return_type] == 'File'
Expand Down Expand Up @@ -301,7 +299,7 @@ def build_request_url(path, opts = {})
@config.base_url(opts[:operation]) + path
end

# Update hearder and query params based on authentication settings.
# Update header and query params based on authentication settings.
#
# @param [Hash] header_params Header parameters
# @param [Hash] query_params Query parameters
Expand Down Expand Up @@ -340,8 +338,8 @@ def select_header_accept(accepts)
# @param [Array] content_types array for Content-Type
# @return [String] the Content-Type header (e.g. application/json)
def select_header_content_type(content_types)
# use application/json by default
return 'application/json' if content_types.nil? || content_types.empty?
# return nil by default
return if content_types.nil? || content_types.empty?
# use JSON when present, otherwise use the first one
json_content_type = content_types.find { |s| json_mime?(s) }
json_content_type || content_types.first
Expand Down
2 changes: 1 addition & 1 deletion lib/mx-platform-ruby/api_error.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
The version of the OpenAPI document: 0.1.0
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 5.2.1
OpenAPI Generator version: 5.3.0
=end

Expand Down
Loading

0 comments on commit e7e3488

Please sign in to comment.