Class: MoneyKit::AccessTokenApi
- Inherits:
-
Object
- Object
- MoneyKit::AccessTokenApi
- Defined in:
- lib/moneykit/api/access_token_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#generate_access_token(opts = {}) ⇒ GenerateAccessTokenResponse
/auth/token Create a new short-lived access token by validating your ‘client_id` and `client_secret`.
-
#generate_access_token_with_http_info(opts = {}) ⇒ Array<(GenerateAccessTokenResponse, Integer, Hash)>
/auth/token Create a new short-lived access token by validating your `client_id` and `client_secret`.
-
#get_well_known_jwks(opts = {}) ⇒ JWKSet
JSON Web Key Set The JSON Web Key Set (JWKS) is a set of keys containing the public keys used to verify webhook JSON Web Tokens (JWT) issued by MoneyKit webhooks.
-
#get_well_known_jwks_with_http_info(opts = {}) ⇒ Array<(JWKSet, Integer, Hash)>
JSON Web Key Set The JSON Web Key Set (JWKS) is a set of keys containing the public keys used to verify webhook JSON Web Tokens (JWT) issued by MoneyKit webhooks.
-
#initialize(api_client = ApiClient.default) ⇒ AccessTokenApi
constructor
A new instance of AccessTokenApi.
-
#instrospect_client(opts = {}) ⇒ IntrospectClientResponse
/auth/introspect Get details about the client and application associated with your ‘access_token`.
-
#instrospect_client_with_http_info(opts = {}) ⇒ Array<(IntrospectClientResponse, Integer, Hash)>
/auth/introspect Get details about the client and application associated with your `access_token`.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ AccessTokenApi
Returns a new instance of AccessTokenApi.
19 20 21 |
# File 'lib/moneykit/api/access_token_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/moneykit/api/access_token_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#generate_access_token(opts = {}) ⇒ GenerateAccessTokenResponse
/auth/token Create a new short-lived access token by validating your ‘client_id` and `client_secret`. The `access_token` is to be forwarded with all subsequent requests as `Authorization: Bearer access_token` HTTP header. When the token expires you must regenerate your `access_token`. The `client_id` and `client_secret` can be supplied as POST body parameters, or as a HTTP basic auth header.
31 32 33 34 |
# File 'lib/moneykit/api/access_token_api.rb', line 31 def generate_access_token(opts = {}) data, _status_code, _headers = generate_access_token_with_http_info(opts) data end |
#generate_access_token_with_http_info(opts = {}) ⇒ Array<(GenerateAccessTokenResponse, Integer, Hash)>
/auth/token Create a new short-lived access token by validating your `client_id` and `client_secret`. The `access_token` is to be forwarded with all subsequent requests as `Authorization: Bearer access_token` HTTP header. When the token expires you must regenerate your `access_token`. The `client_id` and `client_secret` can be supplied as POST body parameters, or as a HTTP basic auth header.
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 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/moneykit/api/access_token_api.rb', line 45 def generate_access_token_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AccessTokenApi.generate_access_token ...' end pattern = Regexp.new(/^(client_credentials|refresh_token)$/) if @api_client.config.client_side_validation && !opts[:'grant_type'].nil? && opts[:'grant_type'] !~ pattern fail ArgumentError, "invalid value for 'opts[:\"grant_type\"]' when calling AccessTokenApi.generate_access_token, must conform to the pattern #{pattern}." end # resource path local_var_path = '/auth/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/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) if !content_type.nil? header_params['Content-Type'] = content_type end header_params[:'moneykit-version'] = opts[:'moneykit_version'] if !opts[:'moneykit_version'].nil? # form parameters form_params = opts[:form_params] || {} form_params['grant_type'] = opts[:'grant_type'] if !opts[:'grant_type'].nil? form_params['scope'] = opts[:'scope'] if !opts[:'scope'].nil? form_params['client_id'] = opts[:'client_id'] if !opts[:'client_id'].nil? form_params['client_secret'] = opts[:'client_secret'] if !opts[:'client_secret'].nil? # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GenerateAccessTokenResponse' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBasic'] = opts.merge( :operation => :"AccessTokenApi.generate_access_token", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccessTokenApi#generate_access_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_well_known_jwks(opts = {}) ⇒ JWKSet
JSON Web Key Set The JSON Web Key Set (JWKS) is a set of keys containing the public keys used to verify webhook JSON Web Tokens (JWT) issued by MoneyKit webhooks.
109 110 111 112 |
# File 'lib/moneykit/api/access_token_api.rb', line 109 def get_well_known_jwks(opts = {}) data, _status_code, _headers = get_well_known_jwks_with_http_info(opts) data end |
#get_well_known_jwks_with_http_info(opts = {}) ⇒ Array<(JWKSet, Integer, Hash)>
JSON Web Key Set The JSON Web Key Set (JWKS) is a set of keys containing the public keys used to verify webhook JSON Web Tokens (JWT) issued by MoneyKit webhooks.
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 |
# File 'lib/moneykit/api/access_token_api.rb', line 119 def get_well_known_jwks_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AccessTokenApi.get_well_known_jwks ...' end # resource path local_var_path = '/.well-known/jwks.json' # 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/json']) header_params[:'moneykit-version'] = opts[:'moneykit_version'] if !opts[:'moneykit_version'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'JWKSet' # auth_names auth_names = opts[:debug_auth_names] || ['OAuth2ClientCredentials'] = opts.merge( :operation => :"AccessTokenApi.get_well_known_jwks", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccessTokenApi#get_well_known_jwks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#instrospect_client(opts = {}) ⇒ IntrospectClientResponse
/auth/introspect Get details about the client and application associated with your ‘access_token`.
169 170 171 172 |
# File 'lib/moneykit/api/access_token_api.rb', line 169 def instrospect_client(opts = {}) data, _status_code, _headers = instrospect_client_with_http_info(opts) data end |
#instrospect_client_with_http_info(opts = {}) ⇒ Array<(IntrospectClientResponse, Integer, Hash)>
/auth/introspect Get details about the client and application associated with your `access_token`.
179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 |
# File 'lib/moneykit/api/access_token_api.rb', line 179 def instrospect_client_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AccessTokenApi.instrospect_client ...' end # resource path local_var_path = '/auth/introspect' # 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/json']) header_params[:'moneykit-version'] = opts[:'moneykit_version'] if !opts[:'moneykit_version'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'IntrospectClientResponse' # auth_names auth_names = opts[:debug_auth_names] || ['OAuth2ClientCredentials'] = opts.merge( :operation => :"AccessTokenApi.instrospect_client", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccessTokenApi#instrospect_client\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |