Class: AmzSpApi::SpConfiguration
- Inherits:
-
Configuration
- Object
- Configuration
- AmzSpApi::SpConfiguration
- Defined in:
- lib/sp_configuration.rb
Constant Summary collapse
- AWS_REGION_MAP =
{ 'na' => 'us-east-1', 'eu' => 'eu-west-1', 'fe' => 'us-west-2' }.freeze
Instance Attribute Summary collapse
-
#aws_access_key_id ⇒ Object
Returns the value of attribute aws_access_key_id.
-
#aws_secret_access_key ⇒ Object
Returns the value of attribute aws_secret_access_key.
-
#client_id ⇒ Object
Returns the value of attribute client_id.
-
#client_secret ⇒ Object
Returns the value of attribute client_secret.
-
#credentials_provider ⇒ Object
Returns the value of attribute credentials_provider.
-
#get_access_token ⇒ Object
Returns the value of attribute get_access_token.
-
#refresh_token ⇒ Object
Returns the value of attribute refresh_token.
-
#region ⇒ Object
Returns the value of attribute region.
-
#sandbox ⇒ Object
Returns the value of attribute sandbox.
-
#save_access_token ⇒ Object
Returns the value of attribute save_access_token.
Attributes inherited from Configuration
#access_token, #api_key, #api_key_prefix, #base_path, #cert_file, #client_side_validation, #debugging, #force_ending_format, #host, #inject_format, #key_file, #logger, #params_encoding, #password, #scheme, #ssl_ca_cert, #temp_folder_path, #timeout, #username, #verify_ssl, #verify_ssl_host
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Configuration
#api_key_with_prefix, #auth_settings, #base_url, #basic_auth_token, #configure, #initialize
Constructor Details
This class inherits a constructor from AmzSpApi::Configuration
Instance Attribute Details
#aws_access_key_id ⇒ Object
Returns the value of attribute aws_access_key_id.
5 6 7 |
# File 'lib/sp_configuration.rb', line 5 def aws_access_key_id @aws_access_key_id end |
#aws_secret_access_key ⇒ Object
Returns the value of attribute aws_secret_access_key.
5 6 7 |
# File 'lib/sp_configuration.rb', line 5 def aws_secret_access_key @aws_secret_access_key end |
#client_id ⇒ Object
Returns the value of attribute client_id.
5 6 7 |
# File 'lib/sp_configuration.rb', line 5 def client_id @client_id end |
#client_secret ⇒ Object
Returns the value of attribute client_secret.
5 6 7 |
# File 'lib/sp_configuration.rb', line 5 def client_secret @client_secret end |
#credentials_provider ⇒ Object
Returns the value of attribute credentials_provider.
5 6 7 |
# File 'lib/sp_configuration.rb', line 5 def credentials_provider @credentials_provider end |
#get_access_token ⇒ Object
Returns the value of attribute get_access_token.
5 6 7 |
# File 'lib/sp_configuration.rb', line 5 def get_access_token @get_access_token end |
#refresh_token ⇒ Object
Returns the value of attribute refresh_token.
5 6 7 |
# File 'lib/sp_configuration.rb', line 5 def refresh_token @refresh_token end |
#region ⇒ Object
Returns the value of attribute region.
5 6 7 |
# File 'lib/sp_configuration.rb', line 5 def region @region end |
#sandbox ⇒ Object
Returns the value of attribute sandbox.
5 6 7 |
# File 'lib/sp_configuration.rb', line 5 def sandbox @sandbox end |
#save_access_token ⇒ Object
Returns the value of attribute save_access_token.
5 6 7 |
# File 'lib/sp_configuration.rb', line 5 def save_access_token @save_access_token end |
Class Method Details
.default ⇒ Object
36 37 38 |
# File 'lib/sp_configuration.rb', line 36 def self.default @@default ||= SpConfiguration.new end |
Instance Method Details
#access_token_key ⇒ Object
32 33 34 |
# File 'lib/sp_configuration.rb', line 32 def access_token_key Digest::MD5.hexdigest("#{client_id} #{refresh_token}") end |
#aws_region ⇒ Object
16 17 18 |
# File 'lib/sp_configuration.rb', line 16 def aws_region AWS_REGION_MAP[region] end |