Class: WalmartApIs::OauthAuthorizationApi
- Defined in:
- lib/walmart_ap_is/apis/oauth_authorization_api.rb
Overview
OauthAuthorizationApi
Constant Summary
Constants inherited from BaseApi
Instance Attribute Summary
Attributes inherited from BaseApi
Instance Method Summary collapse
-
#refresh_token_seller_auth_authorization_code(authorization, refresh_token, scope: nil, _field_parameters: nil) ⇒ ApiResponse
Obtain a new access token using a refresh token Basic auth format space-delimited list.
-
#request_token_seller_auth_authorization_code(authorization, code, redirect_uri, _field_parameters: nil) ⇒ ApiResponse
Create a new OAuth 2 token.
-
#request_token_seller_auth_client_credentials(authorization, scope: nil, _field_parameters: nil) ⇒ ApiResponse
Create a new OAuth 2 token.
-
#request_token_wallet_auth(authorization, scope: nil, _field_parameters: nil) ⇒ ApiResponse
Create a new OAuth 2 token.
Methods inherited from BaseApi
#initialize, #new_parameter, #new_request_builder, #new_response_handler, user_agent, user_agent_parameters
Constructor Details
This class inherits a constructor from WalmartApIs::BaseApi
Instance Method Details
#refresh_token_seller_auth_authorization_code(authorization, refresh_token, scope: nil, _field_parameters: nil) ⇒ ApiResponse
Obtain a new access token using a refresh token Basic auth format space-delimited list. supported by this endpoint.
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 |
# File 'lib/walmart_ap_is/apis/oauth_authorization_api.rb', line 57 def (, refresh_token, scope: nil, _field_parameters: nil) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/auth/v4/token', Server::DEFAULT) .form_param(new_parameter('refresh_token', key: 'grant_type')) .header_param(new_parameter(, key: 'Authorization') .is_required(true)) .form_param(new_parameter(refresh_token, key: 'refresh_token') .is_required(true)) .form_param(new_parameter(scope, key: 'scope')) .header_param(new_parameter('application/x-www-form-urlencoded', key: 'content-type')) .header_param(new_parameter('application/json', key: 'accept')) .additional_form_params(_field_parameters)) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(OauthToken.method(:from_hash)) .is_api_response(true) .local_error('400', 'OAuth 2 provider returned an error.', OauthProviderException) .local_error('401', 'OAuth 2 provider says client authentication failed.', OauthProviderException)) .execute end |
#request_token_seller_auth_authorization_code(authorization, code, redirect_uri, _field_parameters: nil) ⇒ ApiResponse
Create a new OAuth 2 token. Basic auth format supported by this endpoint.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/walmart_ap_is/apis/oauth_authorization_api.rb', line 17 def (, code, redirect_uri, _field_parameters: nil) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/auth/v4/token', Server::DEFAULT) .form_param(new_parameter('authorization_code', key: 'grant_type')) .header_param(new_parameter(, key: 'Authorization') .is_required(true)) .form_param(new_parameter(code, key: 'code') .is_required(true)) .form_param(new_parameter(redirect_uri, key: 'redirect_uri') .is_required(true)) .header_param(new_parameter('application/x-www-form-urlencoded', key: 'content-type')) .header_param(new_parameter('application/json', key: 'accept')) .additional_form_params(_field_parameters)) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(OauthToken.method(:from_hash)) .is_api_response(true) .local_error('400', 'OAuth 2 provider returned an error.', OauthProviderException) .local_error('401', 'OAuth 2 provider says client authentication failed.', OauthProviderException)) .execute end |
#request_token_seller_auth_client_credentials(authorization, scope: nil, _field_parameters: nil) ⇒ ApiResponse
Create a new OAuth 2 token. Basic auth format space-delimited list. supported by this endpoint.
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/walmart_ap_is/apis/oauth_authorization_api.rb', line 95 def request_token_seller_auth_client_credentials(, scope: nil, _field_parameters: nil) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/auth/v4/token', Server::DEFAULT) .form_param(new_parameter('client_credentials', key: 'grant_type')) .header_param(new_parameter(, key: 'Authorization') .is_required(true)) .form_param(new_parameter(scope, key: 'scope')) .header_param(new_parameter('application/x-www-form-urlencoded', key: 'content-type')) .header_param(new_parameter('application/json', key: 'accept')) .additional_form_params(_field_parameters)) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(OauthToken.method(:from_hash)) .is_api_response(true) .local_error('400', 'OAuth 2 provider returned an error.', OauthProviderException) .local_error('401', 'OAuth 2 provider says client authentication failed.', OauthProviderException)) .execute end |
#request_token_wallet_auth(authorization, scope: nil, _field_parameters: nil) ⇒ ApiResponse
Create a new OAuth 2 token. Basic auth format space-delimited list. supported by this endpoint.
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 |
# File 'lib/walmart_ap_is/apis/oauth_authorization_api.rb', line 130 def request_token_wallet_auth(, scope: nil, _field_parameters: nil) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/auth/token', Server::DEFAULT1) .form_param(new_parameter('client_credentials', key: 'grant_type')) .header_param(new_parameter(, key: 'Authorization') .is_required(true)) .form_param(new_parameter(scope, key: 'scope')) .header_param(new_parameter('application/x-www-form-urlencoded', key: 'content-type')) .header_param(new_parameter('application/json', key: 'accept')) .additional_form_params(_field_parameters)) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(OauthToken.method(:from_hash)) .is_api_response(true) .local_error('400', 'OAuth 2 provider returned an error.', OauthProviderException) .local_error('401', 'OAuth 2 provider says client authentication failed.', OauthProviderException)) .execute end |