Class: MuffinMan::SpApiClient
- Inherits:
-
Object
- Object
- MuffinMan::SpApiClient
- Defined in:
- lib/muffin_man/sp_api_client.rb
Direct Known Subclasses
Authorization::V1, Awd::V20240509, CatalogItems::BaseApi, CustomerFeedback::V20240601, DataKiosk::V20231115, FbaInventory::V1, Feeds::V20210630, Finances::V0, Finances::V20240619, FulfillmentInbound::V0, FulfillmentInbound::V1, FulfillmentInbound::V20240320, FulfillmentOutbound::V20200701, Listings::V20200901, Listings::V20210801, ListingsRestrictions::V20210801, MerchantFulfillment::V0, Notifications::V1, Orders::V0, ProductFees::V0, ProductPricing::V0, Reports::V20210630, MuffinMan::Solicitations::V1, Tokens::V20210301, VendorDirectFulfillmentInventory::V1, VendorDirectFulfillmentOrders::V20211228, VendorDirectFulfillmentPayments::V1, VendorDirectFulfillmentShipping::V20211228, VendorDirectFulfillmentTransactions::V20211228, VendorInvoices::V1, VendorOrders::V1, VendorShipments::V1, VendorTransactionStatus::V1
Constant Summary collapse
- ACCESS_TOKEN_URL =
"https://api.amazon.com/auth/o2/token".freeze
- SERVICE_NAME =
"execute-api".freeze
- AWS_REGION_MAP =
{ "na" => "us-east-1", "eu" => "eu-west-1", "fe" => "us-west-2" }.freeze
- UNPROCESSABLE_ENTITY_STATUS_CODE =
422
Instance Attribute Summary collapse
-
#access_token_cache_key ⇒ Object
readonly
Returns the value of attribute access_token_cache_key.
-
#aws_access_key_id ⇒ Object
readonly
Returns the value of attribute aws_access_key_id.
-
#aws_secret_access_key ⇒ Object
readonly
Returns the value of attribute aws_secret_access_key.
-
#client_id ⇒ Object
readonly
Returns the value of attribute client_id.
-
#client_secret ⇒ Object
readonly
Returns the value of attribute client_secret.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#credentials ⇒ Object
readonly
Returns the value of attribute credentials.
-
#local_var_path ⇒ Object
readonly
Returns the value of attribute local_var_path.
-
#pii_data_elements ⇒ Object
readonly
Returns the value of attribute pii_data_elements.
-
#query_params ⇒ Object
readonly
Returns the value of attribute query_params.
-
#refresh_token ⇒ Object
readonly
Returns the value of attribute refresh_token.
-
#region ⇒ Object
readonly
Returns the value of attribute region.
-
#request_body ⇒ Object
readonly
Returns the value of attribute request_body.
-
#request_type ⇒ Object
readonly
Returns the value of attribute request_type.
-
#sandbox ⇒ Object
readonly
Returns the value of attribute sandbox.
-
#scope ⇒ Object
readonly
Returns the value of attribute scope.
-
#sts_iam_role_arn ⇒ Object
readonly
Returns the value of attribute sts_iam_role_arn.
Instance Method Summary collapse
-
#initialize(credentials, sandbox = false) ⇒ SpApiClient
constructor
A new instance of SpApiClient.
Constructor Details
#initialize(credentials, sandbox = false) ⇒ SpApiClient
Returns a new instance of SpApiClient.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/muffin_man/sp_api_client.rb', line 25 def initialize(credentials, sandbox = false) @refresh_token = credentials[:refresh_token] @client_id = credentials[:client_id] @client_secret = credentials[:client_secret] @aws_access_key_id = credentials[:aws_access_key_id] @aws_secret_access_key = credentials[:aws_secret_access_key] @sts_iam_role_arn = credentials[:sts_iam_role_arn] @region = credentials[:region] || "na" @scope = credentials[:scope] @access_token_cache_key = credentials[:access_token_cache_key] @sandbox = sandbox @credentials = credentials @pii_data_elements = [] Typhoeus::Config.user_agent = "" @config = MuffinMan.configuration end |
Instance Attribute Details
#access_token_cache_key ⇒ Object (readonly)
Returns the value of attribute access_token_cache_key.
9 10 11 |
# File 'lib/muffin_man/sp_api_client.rb', line 9 def access_token_cache_key @access_token_cache_key end |
#aws_access_key_id ⇒ Object (readonly)
Returns the value of attribute aws_access_key_id.
9 10 11 |
# File 'lib/muffin_man/sp_api_client.rb', line 9 def aws_access_key_id @aws_access_key_id end |
#aws_secret_access_key ⇒ Object (readonly)
Returns the value of attribute aws_secret_access_key.
9 10 11 |
# File 'lib/muffin_man/sp_api_client.rb', line 9 def aws_secret_access_key @aws_secret_access_key end |
#client_id ⇒ Object (readonly)
Returns the value of attribute client_id.
9 10 11 |
# File 'lib/muffin_man/sp_api_client.rb', line 9 def client_id @client_id end |
#client_secret ⇒ Object (readonly)
Returns the value of attribute client_secret.
9 10 11 |
# File 'lib/muffin_man/sp_api_client.rb', line 9 def client_secret @client_secret end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
9 10 11 |
# File 'lib/muffin_man/sp_api_client.rb', line 9 def config @config end |
#credentials ⇒ Object (readonly)
Returns the value of attribute credentials.
9 10 11 |
# File 'lib/muffin_man/sp_api_client.rb', line 9 def credentials @credentials end |
#local_var_path ⇒ Object (readonly)
Returns the value of attribute local_var_path.
9 10 11 |
# File 'lib/muffin_man/sp_api_client.rb', line 9 def local_var_path @local_var_path end |
#pii_data_elements ⇒ Object (readonly)
Returns the value of attribute pii_data_elements.
9 10 11 |
# File 'lib/muffin_man/sp_api_client.rb', line 9 def pii_data_elements @pii_data_elements end |
#query_params ⇒ Object (readonly)
Returns the value of attribute query_params.
9 10 11 |
# File 'lib/muffin_man/sp_api_client.rb', line 9 def query_params @query_params end |
#refresh_token ⇒ Object (readonly)
Returns the value of attribute refresh_token.
9 10 11 |
# File 'lib/muffin_man/sp_api_client.rb', line 9 def refresh_token @refresh_token end |
#region ⇒ Object (readonly)
Returns the value of attribute region.
9 10 11 |
# File 'lib/muffin_man/sp_api_client.rb', line 9 def region @region end |
#request_body ⇒ Object (readonly)
Returns the value of attribute request_body.
9 10 11 |
# File 'lib/muffin_man/sp_api_client.rb', line 9 def request_body @request_body end |
#request_type ⇒ Object (readonly)
Returns the value of attribute request_type.
9 10 11 |
# File 'lib/muffin_man/sp_api_client.rb', line 9 def request_type @request_type end |
#sandbox ⇒ Object (readonly)
Returns the value of attribute sandbox.
9 10 11 |
# File 'lib/muffin_man/sp_api_client.rb', line 9 def sandbox @sandbox end |
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
9 10 11 |
# File 'lib/muffin_man/sp_api_client.rb', line 9 def scope @scope end |
#sts_iam_role_arn ⇒ Object (readonly)
Returns the value of attribute sts_iam_role_arn.
9 10 11 |
# File 'lib/muffin_man/sp_api_client.rb', line 9 def sts_iam_role_arn @sts_iam_role_arn end |