Class: BancoBrasilClientCredentials::DefaultApi
- Inherits:
-
Object
- Object
- BancoBrasilClientCredentials::DefaultApi
- Defined in:
- lib/bb_oauth/api/default_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#initialize(api_client = ApiClient.default) ⇒ DefaultApi
constructor
A new instance of DefaultApi.
- #oauth_token_post(grant_type, scope, authorization, content_type, opts = {}) ⇒ ResponseToken
-
#oauth_token_post_with_http_info(grant_type, scope, authorization, content_type, opts = {}) ⇒ Array<(ResponseToken, Integer, Hash)>
ResponseToken data, response status code and response headers.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ DefaultApi
Returns a new instance of DefaultApi.
5 6 7 |
# File 'lib/bb_oauth/api/default_api.rb', line 5 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
3 4 5 |
# File 'lib/bb_oauth/api/default_api.rb', line 3 def api_client @api_client end |
Instance Method Details
#oauth_token_post(grant_type, scope, authorization, content_type, opts = {}) ⇒ ResponseToken
14 15 16 17 |
# File 'lib/bb_oauth/api/default_api.rb', line 14 def oauth_token_post(grant_type, scope, , content_type, opts = {}) data, _status_code, _headers = oauth_token_post_with_http_info(grant_type, scope, , content_type, opts) data end |
#oauth_token_post_with_http_info(grant_type, scope, authorization, content_type, opts = {}) ⇒ Array<(ResponseToken, Integer, Hash)>
Returns ResponseToken data, response status code and response headers.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/bb_oauth/api/default_api.rb', line 25 def oauth_token_post_with_http_info(grant_type, scope, , content_type, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DefaultApi.oauth_token_post ...' end # verify the required parameter 'grant_type' is set if @api_client.config.client_side_validation && grant_type.nil? fail ArgumentError, "Missing the required parameter 'grant_type' when calling DefaultApi.oauth_token_post" end # verify the required parameter 'scope' is set if @api_client.config.client_side_validation && scope.nil? fail ArgumentError, "Missing the required parameter 'scope' when calling DefaultApi.oauth_token_post" end # verify the required parameter 'authorization' is set if @api_client.config.client_side_validation && .nil? fail ArgumentError, "Missing the required parameter 'authorization' when calling DefaultApi.oauth_token_post" end # verify the required parameter 'content_type' is set if @api_client.config.client_side_validation && content_type.nil? fail ArgumentError, "Missing the required parameter 'content_type' when calling DefaultApi.oauth_token_post" end # resource path local_var_path = '/oauth/token' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) # header_params['Accept'] = @api_client.select_header_accept(['application/x-www-form-urlencoded']) # HTTP header 'Content-Type' # header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) header_params['Authorization'] = header_params['Content-Type'] = content_type # form parameters form_params = opts[:form_params] || {} form_params['grant_type'] = grant_type form_params['scope'] = scope # http body (model) post_body = opts[:body] return_type = opts[:return_type] || 'ResponseToken' auth_names = opts[:auth_names] || [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type) if @api_client.config.debugging @api_client.config.logger.debug "API called: DefaultApi#oauth_token_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |