Class: AmzSpApi::SpConfiguration

Inherits:
Configuration show all
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

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_idObject

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_keyObject

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_idObject

Returns the value of attribute client_id.



5
6
7
# File 'lib/sp_configuration.rb', line 5

def client_id
  @client_id
end

#client_secretObject

Returns the value of attribute client_secret.



5
6
7
# File 'lib/sp_configuration.rb', line 5

def client_secret
  @client_secret
end

#credentials_providerObject

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_tokenObject

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_tokenObject

Returns the value of attribute refresh_token.



5
6
7
# File 'lib/sp_configuration.rb', line 5

def refresh_token
  @refresh_token
end

#regionObject

Returns the value of attribute region.



5
6
7
# File 'lib/sp_configuration.rb', line 5

def region
  @region
end

#sandboxObject

Returns the value of attribute sandbox.



5
6
7
# File 'lib/sp_configuration.rb', line 5

def sandbox
  @sandbox
end

#save_access_tokenObject

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

.defaultObject



36
37
38
# File 'lib/sp_configuration.rb', line 36

def self.default
  @@default ||= SpConfiguration.new
end

Instance Method Details

#access_token_keyObject



32
33
34
# File 'lib/sp_configuration.rb', line 32

def access_token_key
  Digest::MD5.hexdigest("#{client_id} #{refresh_token}")
end

#aws_regionObject



16
17
18
# File 'lib/sp_configuration.rb', line 16

def aws_region
  AWS_REGION_MAP[region]
end