File Coverage

lib/eBay/API/XML/Call/GetProductSearchResults/GetProductSearchResultsRequestType.pm
Criterion Covered Total %
statement 7 9 77.7
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 10 12 83.3


line stmt bran cond sub pod time code
1             #!/usr/bin/perl
2              
3             package eBay::API::XML::Call::GetProductSearchResults::GetProductSearchResultsRequestType;
4              
5 1     1   1413 use strict;
  1         2  
  1         25  
6 1     1   5 use warnings;
  1         1  
  1         54  
7              
8             ##########################################################################
9             #
10             # Module: ............... eBay/API/XML
11             # File: ................. GetProductSearchResultsRequestType.pm
12             # Generated by: ......... genEBayApiDataTypes.pl
13             # Last Generated: ....... 08/24/2008 16:44
14             # API Release Number: ... 579
15             #
16             ##########################################################################
17              
18             =head1 NAME
19              
20             eBay::API::XML::Call::GetProductSearchResults::GetProductSearchResultsRequestType
21              
22             =head1 DESCRIPTION
23              
24             Searches for Pre-filled Item Information within one or more characteristic sets.
25             This kind of search is only applicable in the context of the Sell Your Item use
26             case. Use the response to present the seller with a list of products found in a
27             catalog. (For buy-side searches, use GetSearchResults.)
28            
29             See the Attributes and Catalogs section of the eBay Web Services guide for
30             background information and terminology definitions, as well as information about
31             how to use this call in the Sell Your Item flow.
32            
33             You can use this call to search for different products at the same time. That is,
34             this call can perform batch searches.
35            
36             Given an array of ProductSearch properties that are configured with a list of
37             search attributes or keywords (and other information), GetProductSearchResults
38             searches an eBay catalog for products that match each query. Some queries can be
39             configured to also specify a sort order for the results.
40            
41             To configure a ProductSearch object to search by attributes, you need a valid
42             combination of search attributes. If you want to use a sort order other than the
43             default order, you also need a valid sort attribute. We offer two calls that
44             return product search and sort attributes. Use GetCategory2CS to determine which
45             one of these calls you can use for a given category. At least one approach is
46             offered for each catalog-enabled category, and some cases, both are
47             offered.
48            
49             GetProductSearchPage: Use this call when you want to configure
50             a simple query that consists of a single search attribute (with a value). This
51             retrieves a single product or a very short list of search results to choose from.
52             Some products are fairly easy to find based on a single attribute. For example, in
53             Consumer Electronics categories (Digital Cameras, Cell Phones, and PDAs), you can
54             specify a unique (or nearly unique) identifier, like a part number. In Media
55             categories (Books, DVDs & Movies, Music, and Video Games), you can specify a
56             descriptive name, like a title.
57            
58             GetProductFinder: Use this call when you want to configure a
59             complex query. In the Sell Your Item flow, this is a complex query against the
60             eBay product catalog. Currently, this type of search is available in Consumer
61             Electronics categories only. In this type of search, you specify values for
62             multiple attributes, like Brand and Resolution (i.e., number of megapixels). This
63             retrieves a list of matching products. This approach is useful when the user does
64             not know the part number, or a product does not have a single, distinguishing
65             feature that is easy to search on. For example, searching for a digital camera
66             based solely on the brand would likely yield far too many results to be useful.
67             Searching on the brand, product line, and resolution will retrieve a much shorter
68             list of results.
69            
70             Alternatively, you can search on a particular keyword that appears in a product's
71             title or Item Specifics. For this, you use GetProductSearchResults and and pass in
72             one or more text strings (with optional wildcards) in ProductSearch.QueryKeywords.
73            
74            
75             When you use a keyword query, the search criteria are not restricted to the
76             results of a product search page or product finder, so the criteria are not tied
77             to a particular characteristic set. This means you can search across multiple
78             characteristic sets using the same query. This is useful when the user wants to
79             broaden their search across multiple categories. For example, a seller who sells
80             Jazz books, Jazz CDs, and Jazz movies may want to search for "Bird" across
81             multiple categories. Specify the characteristic set IDs of interest by using
82             CharacteristicSetIDs.
83            
84             GetProductSearchResults returns a list of matching products, if any. Each product
85             is represented as a list of attributes (Item Specifics) plus other identifying
86             information, such as a product ID and a stock photo.
87            
88             Once the user selects a product from the list (this may require a call to
89             GetProductFamilyMembers to retrieve additional products to choose from), pass its
90             ID in a GetProductSellingPages request to retrieve more detailed information about
91             each product, including a set of optional Item Specifics that the seller can use
92             in addition to the pre-filled Item Specifics (see GetProductSellingPages).
93            
94            
95             To use this data in a listing, pass the product ID and the optional Item Specifics
96             in the seller's listing request (AddItem).
97              
98              
99              
100             =head1 SYNOPSIS
101              
102             =cut
103              
104              
105             =head1 INHERITANCE
106              
107             eBay::API::XML::Call::GetProductSearchResults::GetProductSearchResultsRequestType inherits from the L class
108              
109             =cut
110              
111 1     1   43 use eBay::API::XML::RequestDataType;
  0            
  0            
112             our @ISA = ("eBay::API::XML::RequestDataType");
113              
114             use eBay::API::XML::DataType::ProductSearchType;
115              
116              
117             my @gaProperties = ( [ 'ProductSearch', 'ns:ProductSearchType', '1'
118             ,'eBay::API::XML::DataType::ProductSearchType', '1' ]
119             );
120             push @gaProperties, @{eBay::API::XML::RequestDataType::getPropertiesList()};
121              
122             my @gaAttributes = (
123             );
124             push @gaAttributes, @{eBay::API::XML::RequestDataType::getAttributesList()};
125              
126             =head1 Subroutines:
127              
128             =cut
129              
130             sub new {
131             my $classname = shift;
132             my %args = @_;
133             my $self = $classname->SUPER::new(%args);
134             return $self;
135             }
136              
137             sub isScalar {
138             return 0;
139             }
140              
141              
142              
143             =head2 setProductSearch()
144              
145             Specifies the keywords or attributes that make up the product query, with
146             pagination instructions. ProductSearch is a required input. To search for
147             multiple different products at the same time (i.e., to perform a batch
148             search), pass in multiple ProductSearch properties.
149              
150             SeeLink: URL: http://developer.ebay.com/DevZone/XML/docs/WebHelp/index.htm?context=eBay_XML_API&topic=AttrProductSearch
151             Title: Searching for Pre-filled Item Information
152              
153             RequiredInput: Yes
154             # Argument: reference to an array
155             of 'ns:ProductSearchType'
156              
157             =cut
158              
159             sub setProductSearch {
160             my $self = shift;
161             $self->{'ProductSearch'} =
162             $self->convertArray_To_RefToArrayIfNeeded(@_);
163             }
164              
165             =head2 getProductSearch()
166              
167             # Returns: reference to an array
168             of 'ns:ProductSearchType'
169              
170             =cut
171              
172             sub getProductSearch {
173             my $self = shift;
174             return $self->_getDataTypeArray('ProductSearch');
175             }
176              
177              
178              
179              
180              
181             ## Attribute and Property lists
182             sub getPropertiesList {
183             my $self = shift;
184             return \@gaProperties;
185             }
186              
187             sub getAttributesList {
188             my $self = shift;
189             return \@gaAttributes;
190             }
191              
192              
193              
194             1;