Class: Rapa::Client
- Inherits:
-
Object
- Object
- Rapa::Client
- Defined in:
- lib/rapa/client.rb
Instance Method Summary collapse
- #connection ⇒ Faraday::Connection
-
#initialize(access_key_id:, associate_tag:, secret_access_key:) ⇒ Client
constructor
A new instance of Client.
- #list_items(item_ids:, domain:, id_type: nil, related_item_page: nil, relationship_type: nil, response_groups: nil, search_index: nil) ⇒ Rapa::Responses::ListItemsResponse
- #lookup_browse_node(browse_node_id:, domain:, response_groups: nil) ⇒ Rapa::Responses::LookupBrowseNodeResponse
- #search_items(browse_node_id: nil, domain:, item_page: nil, keywords: nil, power: nil, related_item_page: nil, relationship_type: nil, response_groups: nil, search_index: nil) ⇒ Rapa::Responses::SearchItemsResponse
Constructor Details
#initialize(access_key_id:, associate_tag:, secret_access_key:) ⇒ Client
Returns a new instance of Client.
10 11 12 13 14 |
# File 'lib/rapa/client.rb', line 10 def initialize(access_key_id:, associate_tag:, secret_access_key:) @access_key_id = access_key_id @associate_tag = associate_tag @secret_access_key = secret_access_key end |
Instance Method Details
#connection ⇒ Faraday::Connection
17 18 19 20 21 22 23 |
# File 'lib/rapa/client.rb', line 17 def connection @connection ||= ::Faraday::Connection.new do |connection| connection.response :xml connection..params_encoder = ::Rapa::Encoder.new connection.adapter :net_http end end |
#list_items(item_ids:, domain:, id_type: nil, related_item_page: nil, relationship_type: nil, response_groups: nil, search_index: nil) ⇒ Rapa::Responses::ListItemsResponse
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/rapa/client.rb', line 50 def list_items( item_ids:, domain:, id_type: nil, related_item_page: nil, relationship_type: nil, response_groups: nil, search_index: nil ) send_request( item_ids: item_ids, domain: domain, id_type: id_type, query_class: ::Rapa::Queries::ListItemsQuery, related_item_page: , relationship_type: relationship_type, response_class: ::Rapa::Responses::ListItemsResponse, response_groups: response_groups, search_index: search_index ) end |
#lookup_browse_node(browse_node_id:, domain:, response_groups: nil) ⇒ Rapa::Responses::LookupBrowseNodeResponse
29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/rapa/client.rb', line 29 def lookup_browse_node( browse_node_id:, domain:, response_groups: nil ) send_request( browse_node_id: browse_node_id, domain: domain, query_class: ::Rapa::Queries::LookupBrowseNode, response_class: ::Rapa::Responses::LookupBrowseNodeResponse, response_groups: response_groups ) end |
#search_items(browse_node_id: nil, domain:, item_page: nil, keywords: nil, power: nil, related_item_page: nil, relationship_type: nil, response_groups: nil, search_index: nil) ⇒ Rapa::Responses::SearchItemsResponse
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/rapa/client.rb', line 82 def search_items( browse_node_id: nil, domain:, item_page: nil, keywords: nil, power: nil, related_item_page: nil, relationship_type: nil, response_groups: nil, search_index: nil ) send_request( browse_node_id: browse_node_id, domain: domain, item_page: item_page, keywords: keywords, power: power, query_class: ::Rapa::Queries::SearchItemsQuery, related_item_page: , relationship_type: relationship_type, response_class: ::Rapa::Responses::SearchItemsResponse, response_groups: response_groups, search_index: search_index, ) end |